Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Built-in voltmeter on PIC12F675. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Measuring technology

Comments on the article Comments on the article

In this device, the author used an original method of controlling a four-digit seven-element LED indicator with signals from only four microcontroller pins. The microcontroller program provides for automatic calibration of the voltmeter.

The traditional connection of an LED digital indicator with a microcontroller through a serial-to-parallel converter 74HC595 requires the use of three outputs of the microcontroller to control the code converter and one more output for each digit of the indicator. Therefore, a four-digit indicator requires seven pins. This makes it impossible to use such indicators with low-output microcontrollers, for example, with PIC12F675, which has only six pins (not including power pins).

I propose to combine the control of the code converter and the indicator bits using only four microcontroller outputs. At the same time, the algorithm embedded in the program will ensure that the indicator does not affect the work with the converter and parasitic illumination of the indicator elements.

As usual, information is displayed on the indicator bit by bit on interrupt requests from the microcontroller timer, following with a period of 2 ms. The procedure for processing each request consists of five stages. At the first stage, it sets a low level at pin 10 of the 74HC595 chip, thereby resetting its shift register. This stage is the only one at which a parasitic current flows through the indicator elements, but since the duration of its pulses is only 1 μs with a repetition period of 2000 μs, the parasitic glow is imperceptible even in the dark.

At the second stage, the rising level difference at pin 12 of the 74HC595 chip rewrites the zero contents of the shift register into the holding register. This completely extinguishes the indicator.

At the third stage, information is loaded into the shift register of the 74HC595 microcircuit with a serial code generated by the microcontroller at pin 14 of the microcircuit. Its pin 11 receives clock pulses.

At the fourth stage, with an increasing level difference at pin 12 of the 74HC595 microcircuit, information from its shift register enters the storage register, and due to the high levels at the cathodes, the indicator discharges remain extinguished.

At the fifth stage, on the common cathode of the discharge, for which the parallel code output to the outputs of the 74HC595 microcircuit is intended, the program sets a low level, turning on its elements in accordance with this code. This completes the interrupt processing, and the set indicator state remains unchanged until the next interrupt.

To control an eight-digit indicator, eight microcontroller outputs are required. In this case, the signals from the additional four outputs simply control the levels on the cathodes of the discharges. It should be noted that in this case it is possible to use indicators with both common cathodes and common anodes, connecting elements or discharges to the outputs of the code converter, respectively. For the reasons stated below, it is preferable to organize the dynamic indication element-by-element in the first case, and bit-by-bit in the second.

Now let's talk about a voltmeter that uses the described principle.

Main Specifications

  • Measured voltage, V ....... 0...80
  • Measurement resolution, V ....... 0,1
  • Accuracy.......0,5% + units ml. res.
  • Supply voltage, V......7...15
  • Consumption current, mA, not more ....... 30

The voltmeter circuit is shown in fig. 1. It uses element-by-element dynamic indication. At each moment of time, a high level is set on the anodes of one group of like-named elements of all bits of the HG1 indicator. On the common cathode terminals of the discharges in which these elements should glow, a low level is set, otherwise it is high. Please note that elements of the same name can be included simultaneously in all categories, but only one element is included in each category at the current time. That is why it was chosen to connect the anodes of the elements to the outputs of the DD2 microcircuit, the load capacity of which is higher than the outputs of the microcontroller.

Built-in voltmeter on PIC12F675
Rice. 1. Voltmeter circuit (click to enlarge)

With an interrupt period of 2 ms, the refresh rate of the image on the indicator is 64 Hz and its blinking is imperceptible to the eye. The selected method of dynamic indication also made it possible to halve the number of resistors (R4-R7) that limit the current through the indicator LEDs.

The microcontroller PIC12F675-I / P (DD1) remain unoccupied in the dynamic indication of the I / O lines GP0 and GP3. The first one is used as an ADC input; the measured voltage is fed to it through the divider R1R2. On line GP3, in the absence of jumper S1, thanks to resistor R3, a high logic level is set, which serves as a signal that puts the voltmeter into calibration mode. If the jumper is installed, the level on this pin is low and the voltmeter operates normally.

When you first turn on the voltmeter with the missing jumper S1, the HG1 indicator will display with a flashing rightmost sign. In this state, a voltage as close as possible to 80 V should be applied to the input of the device, controlling it with an exemplary voltmeter. With a short-term connection of the contact pads intended for jumper S1, the device will calculate and remember the calibration factor and will use it in the future.

However, 80 V is a rather large voltage, and difficulties in obtaining it are not ruled out. In this case, during the indication of the value of the reference voltage, the device must be turned off and on again. The indicator will show , and at the next off and on - , , again and further in a circle. Calibration should be performed at the highest available voltage of these values. The higher the reference voltage, the more accurate the calibration. If at the time of calibration the input voltage differs too much from the reference voltage, the coefficient will not be calculated, and the indicator will display

After calibration, turn off the voltmeter and finally install the jumper S1, otherwise you will have to repeat everything the next time you turn it on. The voltmeter can also work without calibration if the jumper S1 is already installed when it is first turned on. In this case, it uses the coefficient written in the program, but the error can exceed 10%. This will be warned by the included dot in the rightmost digit of the indicator.

Analog-to-digital conversion is performed in the "sleep" mode of the microcontroller to reduce interference from its operating nodes. From this state, it automatically exits at the end of the conversion.

The device is powered by a voltage of 5 V, obtained using an integrated voltage regulator DA1. You can use the 78L05 stabilizer instead of the one indicated in the diagram only as a last resort, since the stability of its output voltage is an order of magnitude worse. Without degrading the parameters, you can use the LP2951 stabilizer. The Zener diode VD1 for a voltage of 5,6 V, together with the internal protective diode of the microcontroller, protects the latter from damage when the measured voltage exceeds the permissible value. Without a limiter, the microcontroller supply voltage in this situation can critically increase.

The device is assembled on a 40x36 mm printed circuit board made of 1,5 mm thick one-sided foil fiberglass, shown in fig. 2. Most resistors and capacitors are size 0805 for surface mounting. Resistor R1 for reliable operation at high voltage is used with an output power of 0,5 W. Capacitor C1 can be installed both ceramic and output oxide, for which the board has a seat marked C1'. The FYQ-3641AHR-11 indicator can be replaced with another from the 3641A series or a three-digit 3631A series without reworking the board. A photograph of the assembled board of the device is shown in fig. 3.

Built-in voltmeter on PIC12F675
Rice. 2. PCB

Built-in voltmeter on PIC12F675
Rice. 3. Photograph of the assembled device board

The microcontroller program is written in C language in the MikroC development environment.

The PCB file in Sprint Layout 5.0 format and the microcontroller program can be downloaded from ftp://ftp.radio.ru/pub/2016/04/voltmeter.zip.

Author: B. Balaev

See other articles Section Measuring technology.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

The world's tallest astronomical observatory opened 04.05.2024

Exploring space and its mysteries is a task that attracts the attention of astronomers from all over the world. In the fresh air of the high mountains, far from city light pollution, the stars and planets reveal their secrets with greater clarity. A new page is opening in the history of astronomy with the opening of the world's highest astronomical observatory - the Atacama Observatory of the University of Tokyo. The Atacama Observatory, located at an altitude of 5640 meters above sea level, opens up new opportunities for astronomers in the study of space. This site has become the highest location for a ground-based telescope, providing researchers with a unique tool for studying infrared waves in the Universe. Although the high altitude location provides clearer skies and less interference from the atmosphere, building an observatory on a high mountain poses enormous difficulties and challenges. However, despite the difficulties, the new observatory opens up broad research prospects for astronomers. ... >>

Controlling objects using air currents 04.05.2024

The development of robotics continues to open up new prospects for us in the field of automation and control of various objects. Recently, Finnish scientists presented an innovative approach to controlling humanoid robots using air currents. This method promises to revolutionize the way objects are manipulated and open new horizons in the field of robotics. The idea of ​​controlling objects using air currents is not new, but until recently, implementing such concepts remained a challenge. Finnish researchers have developed an innovative method that allows robots to manipulate objects using special air jets as "air fingers". The air flow control algorithm, developed by a team of specialists, is based on a thorough study of the movement of objects in the air flow. The air jet control system, carried out using special motors, allows you to direct objects without resorting to physical ... >>

Purebred dogs get sick no more often than purebred dogs 03.05.2024

Caring for the health of our pets is an important aspect of the life of every dog ​​owner. However, there is a common assumption that purebred dogs are more susceptible to diseases compared to mixed dogs. New research led by researchers at the Texas School of Veterinary Medicine and Biomedical Sciences brings new perspective to this question. A study conducted by the Dog Aging Project (DAP) of more than 27 companion dogs found that purebred and mixed dogs were generally equally likely to experience various diseases. Although some breeds may be more susceptible to certain diseases, the overall diagnosis rate is virtually the same between both groups. The Dog Aging Project's chief veterinarian, Dr. Keith Creevy, notes that there are several well-known diseases that are more common in certain breeds of dogs, which supports the notion that purebred dogs are more susceptible to disease. ... >>

Random news from the Archive

Digital music player SONY NW-E107 24.02.2005

The digital music player NW-E107 from SONY CORPORATION provides up to 70 hours of continuous playback on a single battery charge, has a built-in memory of 1 Gbps, and a liquid crystal display.

Plays in ATRAC3 and MP3 audio formats.

Other interesting news:

▪ Noctua Cooling Systems with Active Noise Canceling Technology

▪ The dam is about to burst

▪ Mobile phone tracked by a special signal

▪ microwave computer

▪ Organic sensors for cameras

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Protection of electrical equipment. Article selection

▪ article Possible emergencies of a social nature on the territory of Russia. Basics of safe life

▪ article Why were dead souls recorded in the crew on the ships of the British Navy? Detailed answer

▪ article Glass cutter. Standard instruction on labor protection

▪ article Restoring faded ink on parchment. Simple recipes and tips

▪ article Unbreakable beads. Focus secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024