AC current measurement using avr. How to Measure Negative Voltage Using an ADC

A simple alternating voltage voltmeter with a frequency of 50 Hz is made in the form of a built-in module that can be used either separately or built into a finished device.
The voltmeter is assembled on a PIC16F676 microcontroller and a 3-digit indicator and does not contain very many parts.

Main characteristics of the voltmeter:
The shape of the measured voltage is sinusoidal
The maximum value of the measured voltage is 250 V;
Frequency of measured voltage - 40…60 Hz;
The resolution of displaying the measurement result is 1 V;
Voltmeter supply voltage is 7…15 V.
Average current consumption - 20 mA
Two design options: with and without power supply on board
Single Sided PCB
Compact design
Display of measured values ​​on a 3-digit LED indicator

Schematic diagram of a voltmeter for measuring alternating voltage


Implemented direct measurement of alternating voltage with subsequent calculation of its value and output to the indicator. The measured voltage is supplied to the input divider made on R3, R4, R5 and through the separating capacitor C4 is supplied to the ADC input of the microcontroller.

Resistors R6 and R7 create a voltage of 2.5 volts (half the power) at the ADC input. Capacitor C5, of relatively small capacity, bypasses the ADC input and helps reduce measurement errors. The microcontroller organizes the operation of the indicator in dynamic mode based on interruptions from the timer.

--
Thank you for your attention!
Igor Kotov, editor-in-chief of Datagor magazine


🕗 01/07/14 ⚖️ 19.18 Kb ⇣ 239 Hello, reader! My name is Igor, I'm 45, I'm a Siberian and an avid amateur electronics engineer. I came up with, created and have been maintaining this wonderful site since 2006.
For more than 10 years, our magazine has existed only at my expense.

Good! The freebie is over. If you want files and useful articles, help me!

Connecting the current sensor to the microcontroller

Having familiarized ourselves with the basics of the theory, we can move on to the issue of reading, transforming and visualizing data. In other words, we will design a simple DC current meter.

The analog output of the sensor is connected to one of the ADC channels of the microcontroller. All necessary transformations and calculations are implemented in the microcontroller program. A 2-line character LCD indicator is used to display data.

Experimental design

To experiment with a current sensor, it is necessary to assemble the structure according to the diagram shown in Figure 8. The author used a breadboard and a microcontroller-based module for this (Figure 9).

The ACS712-05B current sensor module can be purchased ready-made (it is sold very inexpensively on eBay), or you can make it yourself. The capacitance of the filter capacitor is chosen to be 1 nF, and a blocking capacitor of 0.1 µF is installed for the power supply. To indicate power on, an LED with a quenching resistor is soldered. The power supply and output signal of the sensor are connected to the connector on one side of the module board, a 2-pin connector for measuring the flowing current is located on the opposite side.

For current measurement experiments, we connect an adjustable constant voltage source to the current measuring terminals of the sensor through a 2.7 Ohm / 2 W series resistor. The sensor output is connected to the RA0/AN0 port (pin 17) of the microcontroller. A two-line character LCD indicator is connected to port B of the microcontroller and operates in 4-bit mode.

The microcontroller is powered by a voltage of +5 V, the same voltage is used as a reference for the ADC. The necessary calculations and transformations are implemented in the microcontroller program.

The mathematical expressions used in the conversion process are given below.

Current sensor sensitivity Sens = 0.185 V/A. With a supply Vcc = 5 V and a reference voltage Vref = 5 V, the calculated relationships will be as follows:

ADC output code

Hence

As a result, the formula for calculating the current is as follows:

Important note. The above relationships are based on the assumption that the supply voltage and reference voltage for the ADC are equal to 5 V. However, the last expression relating the current I and the ADC output code Count remains valid even if the power supply voltage fluctuates. This was discussed in the theoretical part of the description.

From the last expression it can be seen that the current resolution of the sensor is 26.4 mA, which corresponds to 513 ADC samples, which is one sample more than the expected result. Thus, we can conclude that this implementation does not allow the measurement of small currents. To increase resolution and sensitivity when measuring small currents, you will need to use an operational amplifier. An example of such a circuit is shown in Figure 10.

Microcontroller program

The PIC16F1847 microcontroller program is written in C language and compiled in the mikroC Pro environment (mikroElektronika). The measurement results are displayed on a two-line LCD indicator with an accuracy of two decimal places.

Exit

With zero input current, the ACS712 output voltage should ideally be strictly Vcc/2, i.e. The number 512 should be read from the ADC. The drift of the sensor output voltage by 4.9 mV causes the conversion result to shift by 1 least significant bit of the ADC (Figure 11). (For Vref = 5.0 V, the resolution of the 10-bit ADC will be 5/1024 = 4.9 mV), which corresponds to 26 mA of input current. Note that to reduce the influence of fluctuations, it is advisable to make several measurements and then average their results.

If the output voltage of the regulated power supply is set equal to 1 V, through
the resistor should carry a current of about 370 mA. The measured current value in the experiment is 390 mA, which exceeds the correct result by one unit of the least significant digit of the ADC (Figure 12).

Figure 12.

At a voltage of 2 V, the indicator will show 760 mA.

This concludes our discussion of the ACS712 current sensor. However, we did not touch upon one more issue. How to measure AC current using this sensor? Keep in mind that the sensor provides an instantaneous response corresponding to the current flowing through the test leads. If the current flows in the positive direction (from pins 1 and 2 to pins 3 and 4), the sensitivity of the sensor is positive and the output voltage is greater than Vcc/2. If the current changes direction, the sensitivity will be negative and the output voltage of the sensor will drop below the Vcc/2 level. This means that when measuring an AC signal, the microcontroller's ADC must sample fast enough to be able to calculate the RMS value of the current.

Downloads

Source code of the microcontroller program and file for firmware -

AC Voltmeter

N. OSTROUKHOV, Surgut

The article describes an alternating voltage voltmeter. It is assembled on
microcontroller and can be used as a stand-alone measuring device
or as a built-in voltmeter in a low-frequency generator.

The proposed voltmeter is designed
for measuring sinusoidal alternating voltage with a frequency from 1 Hz to
800 kHz. Measured voltage interval - 0…3 V (or 0…30 V with external
voltage divider 1:10). The measurement result is displayed on
four-digit LED indicator. The measurement accuracy is determined
parameters of the ADC built into the microcontroller and the reference source
voltage and is equal to 2 mV (for the interval 0...3 V). The voltmeter is powered by
source of stabilized voltage 5 V and consumes current 40...65 mA V
depending on the indicator used and the brightness of its glow. Current consumption
from the built-in polarity converter, does not exceed 5 mA.

The device includes (see diagram on
rice. 1) includes an AC-DC voltage converter, a buffer
DC voltage amplifier, digital voltmeter and converter
polarity of the supply voltage. AC to AC voltage converter
constant collected on comparator DA1, pulse generator on elements
DD1.1-DD1.4 and switching transistor VT1. Let's look at his work
more details. Let's assume that there is no signal at the input of the device. Then the tension
at the inverting input of the comparator DA1 is equal to zero, and at the non-inverting input it is determined
voltage divider R19R22 and with the ratings indicated on the diagram it is about -80
mV. In this case, there is a low level at the output of the comparator, which
allows the pulse generator to operate. The peculiarity of the generator is that when
each voltage drop at the output of the comparator DA1 at the generator output (pin 8
element DD1.2) one pulse is generated. If by the time it subsides there is a day off
the state of the comparator will not change, the next pulse will be generated, etc.

The duration of the pulses depends on
values ​​of elements R16, C5 and is approximately 0.5 μs. At low level
voltage at the output of element DD1.2, transistor VT1 opens. Denominations
resistors R17, R18 and R20 are selected so that through an open transistor
a current of 10 mA flowed, which charges capacitors C8 and C11. During the validity period
Each pulse charges these capacitors by fractions of a millivolt. In steady state
mode, the voltage on them will increase from -80 mV to zero, the repetition rate
generator pulses will decrease and the collector current pulses of transistor VT1
will only compensate for the slow discharge of capacitor C11 through a resistor
R22. Thus, due to the small initial negative offset,
even in the absence of an input signal, the inverter operates normally
mode. When an AC input voltage is applied due to a change in repetition rate
generator pulses, the voltage on capacitor C11 changes in accordance with
amplitude of the input signal. Low-pass filter R21C12 smoothes the output voltage
converter It should be noted that only
positive half-wave of the input voltage, so if it is asymmetrical
relative to zero, an additional error will arise.

Buffer amplifier with gain
gears 1.2 are assembled on op-amp DA3. The diode VD1 connected to its output protects
microcontroller inputs from voltage of negative polarity. From the output of op-amp DA3
through resistive voltage dividers R1R2R3 and R4R5 constant voltage
arrives on lines PC0 and PC1 of microcontroller DD2, which are configured as
ADC inputs. Capacitors C1 and C2 additionally suppress interference and interference. Actually
digital voltmeter is assembled on a DD2 microcontroller, which uses
Built-in 10-bit ADC and internal 1.1 V reference voltage source.

Program for microcontroller
written using the BASCOM-AVR environment and allows the use of three- or
four-digit digital LED indicators with a common anode or common
cathode and allows you to display the current (for a sinusoidal signal) or
amplitude value of the input signal voltage, as well as change the brightness
indicator light The logical level of the signal on the PC3 line specifies the type of applied
indicator - with a common anode (low) or with a common cathode (high), and on the line
PC4 is the number of its digits, four for low and three for high. Program
at the beginning of work, reads the signal levels on these lines once and adjusts
microcontroller to work with the corresponding indicator. For four-bit
indicator, the measurement result is displayed in the form X.ХХХ (B), for a three-digit
- XXX (mV) up to 1 V and Х.ХХ (V), if the voltage is more than 1 V. When used
of a three-digit indicator, the terminals of its digits are connected as the terminals of three
the most significant bits of the four-bit in Fig. 1.

The signal level on the PC2 line controls
multiplying the measurement result by 10, which is necessary when using external
voltage divider 1:10. When the level is low, the result is not multiplied Signal by
line PB6 controls the brightness of the indicator; at a high level it
decreases. The change in brightness occurs as a result of a change in the ratio between
the time of illumination and the time of extinguishing of the indicator within each measurement cycle.
With the constants specified in the program, the brightness changes approximately twice.
The effective value of the input voltage is displayed when applied to the PB7 line
high level and amplitude - low. Signal levels on lines RS2, PB6 and
The PB7 program analyzes the measurements in each cycle, and therefore they can be
changed at any time, for which it is convenient to use switches. Duration
one measurement cycle is equal to 1.1 s. During this time, the ADC performs about 1100
samples, the maximum one is selected and multiplied, if necessary, by
the required coefficient.

For constant measured
voltage would be enough for one measurement for the entire cycle, and for alternating
with a frequency of less than 500 Hz, the voltage on capacitors C8. C11 changes noticeably
during the cycle. Therefore, 1100 measurements at 1 ms intervals allow
record the maximum value for the period. Polarity converter
supply voltage is assembled on the DA2 chip according to the standard circuit. It's his day off
voltage -5 V powers comparator DA1 and op-amp DA3. The XP2 connector is intended for
in-hardware programming of the microcontroller.

The voltmeter uses constant
resistors C2-23, MLT, tuning - Bourns series 3296, oxide
capacitors are imported, the rest are K10-17. The 74AC00 microcircuit can be
replace with KR555LAZ, transistor KT361G - with any of the KT3107 series. Diode 1N5818
replace with any germanium or Schottky diode with a permissible direct current of at least
50 mA. The replacement for the ICL7660 chip is unknown to the author, but the converter
voltage polarity +5/-5 V can be collected according to one of those published in
magazine "Radio" schemes. In addition, the converter can be eliminated
completely, using a bipolar stabilized power supply. Especially
you should focus on choosing a comparator, since the range depends on it
operating frequencies. The choice of comparator LM319 (analogs KA319, LT319) is due to two
criteria - the necessary speed and availability. Comparators LM306,
LM361, LM710 are faster, but it turned out to be more difficult to acquire them, because
besides, they are more expensive. More accessible are LM311 (domestic analogue of KR554SAZ) and
LM393. When installing the LM311 comparator into the device, as one would expect,
the frequency range narrowed to 250 kHz. Resistor R6 has a relatively
slight resistance since the device was used as a built-in
voltmeter in the woofer generator. When using the device in a stand-alone meter, it
the resistance can be increased, but the measurement error will increase due to the relatively
large input current of comparator DA1.

Voltage divider circuit 1:10
shown in Fig. 2. Here the functions of resistor R2 in the divider are performed by resistor
R6 (see Fig. 1). The voltage divider is set up in a certain sequence.
Rectangular pulses with a frequency of several kilohertz are supplied to its input,
amplitude 2...3 V (such a calibration signal is available in many
oscilloscopes), and the oscilloscope input is connected to the output (to pin 5 of DA1). Adjustment
capacitor C1 achieves a rectangular pulse shape. The oscilloscope follows
use with an input voltage divider of 1:10. All parts except the indicator are mounted
on a prototype circuit board measuring 100×70 mm using wired
installation The appearance of one of the device options is shown in Fig. 3. For
for ease of connection of the digital indicator, a connector is used (not shown in the diagram
shown). During installation, the common wire of the XP1 input plug and the corresponding capacitor terminals
C8, C10, C11 and C13 should be connected to the common wire in one place with wires
minimum length. Elements VT1, R20, C8, C10, C11 and C13 and comparator DA1
should be placed as compactly as possible, capacitors C3, C6 - as much as possible
closer to the terminals of the comparator DA1, and C4, C14, C15 - to the terminals of the microcontroller
DD2. To set up, the input of the device is closed, the common output of the oscilloscope probe
connected to the positive terminal of capacitor C13, and the signal terminal to the emitter
transistor VT1. A pulse of negative polarity should appear on the screen
with an amplitude of about 0.6 V and a duration of 0.5 μs. If due to low frequency
the sequence of pulses will be difficult to observe, then temporarily parallel
A resistor with a resistance of 0.1... 1 kOhm is connected to capacitor C11. Voltage
on capacitor C12 is controlled with a high-impedance voltmeter, it should be
close to zero (plus or minus a few millivolts).

Output voltage of op amp DA3
(which should not exceed a few millivolts) with resistor R27
set equal to zero. Required operating mode of the microcontroller
set by supplying the required levels to lines PB6, PB7, RS2-RS4, for which they
connected to a common wire or to a +5 V power line through resistors
resistance 20...30 kOhm. An exemplary one is connected to the input of the device
voltmeter and apply a constant voltage of 0.95 ... 1 V. Substring resistor
R4 equalizes the readings of both voltmeters. Then the voltage is increased to
2.95...3 V and resistor R1 again equalizes the readings. A selection of resistors
R8-R15 you can set the desired brightness of the indicator. First they select
the required denomination of only one of them, and then set the rest. At
selection, it should be remembered that the maximum output current of the port applied
microcontroller should not exceed 40 mA, and the total current consumption - 200
mA.

From the editor. The program for the microcontroller is on our
FTP-cep-vere at ftp://ftp.radio.ru/pub/ 2011/02/Vmetr.zip

Preface

In the old, pre-digital times, any of us had to be content with pointer measuring instruments, starting from ordinary watches, scales and ending with... hmm, so right away we can’t even find the limit of their use! Well, let's say - a precision laboratory micro- or even more impressive - picoammeter. And there were quite a lot of accuracy classes, depending on the purpose.

For example, an ordinary indicator of the amount of fuel in a car tank is the clearest example of the maximum inaccuracy of readings! I don’t know a single motorist who would rely on this “display meter” and would not refuel in advance. The inveterate pessimists of the drivers never drove out without a canister of fuel in the trunk!

But in the laboratories, especially in the State Verification Committee, there were switchmen with a mirror scale and an accuracy class much better than 0.5.

And almost all of us were satisfied and happy. And if they were not satisfied, then they purchased more accurate instruments, of course, if possible!

But now the digital age has arrived. We were all happy about it - now we can immediately see the numbers on the indicators and are happy with the “accuracy” offered to us. Moreover, in modern times, these ubiquitous “digitals” cost an order of magnitude less than the “inaccurate switchmen” that have become a rarity. However, few people think that the quantities shown to us in numbers still remain analog, whether it is weight or current strength - it does not matter. This means that these quantities are still measured analogue! And only for processing and presentation they are converted into a digital value. This is where errors are hidden, leading us to surprise when two different room thermometers in the same place show different values!

Path from measured value to indicator

Let's take a look at the entire measurement-indication process. Moreover, I deliberately choose an electrical quantity. Firstly, we are still on the site of electronics engineers, not thermal physicists or bakers, may they forgive my license of comparison! Secondly, I want to strengthen my reasoning with examples from personal experience.

First, I choose the current strength!

I will have to repeat the platitude that to obtain a digital representation of an analog quantity, you need an analog-to-digital converter (ADC). But since by itself it is still of little use to us, we will need other nodes to complete everything planned. Namely:

  1. in front of the ADC itself, you need a normalizing device, say: a normalizing amplifier or attenuator, depending on the ratio of the input value to the ADC conversion range;
  2. decoder after the ADC, to represent the converted numerical equivalent into the digital code of the corresponding indicator.

There are ready-made microcircuits that combine both an ADC and a decoder. For example, ICL7136 or similar, used in multimeters.

Essentially, all these nodes in one form or another are simply necessary. I have not yet named the sensor itself - in this case, a current-to-voltage converter, or simply a shunt.

So, let's briefly go through the entire chain. Current flowing through a shunt (a powerful resistor with very low resistance) creates a potential difference at its poles. Guten Tag, Herr Ohm! But this difference is quite small and not every ADC is able to fully convert this value, so the signal (voltage) from the shunt must be amplified to an acceptable value. This is why a normalizing amplifier is needed. Now the ADC, having received a digestible voltage at the input, will perform the conversion with the minimum possible error. At its output we get a number corresponding to the current value of the measured current in the selected range, which must be decoded accordingly to be displayed on the indicator. For example, convert it to a seven-segment indicator code.

Here I do not see the need to dwell in more detail on each of the above stages, since in the article I pursue a different goal. And details can be found in abundance on the Internet.

Specifics

I have a so-called electronic load with current flow indicator. There is a basic diagram of the load itself, but there you will need an external ammeter to more accurately set the current. I decided to connect both devices to save space and not have a whole flock of multimeters.

My built-in ammeter is assembled and programmed on the Tiny26L MK. Part of this ammeter is the second (free) op-amp of the LM358 chip, which is part of the basic ballast circuit. Those. This is my standardizing amplifier because the maximum voltage drop across the shunt (5A x 0.1 ohm) is only 0.5 volts, which is clearly not enough for the full conversion range with the internal reference voltage.

According to T.O. (English = Datasheet) the nominal voltage of the built-in reference source (ION) is 2.56 volts. Very convenient size! However, in practice it doesn’t turn out so great: the adjusted ION voltage of my MK turned out to be 2.86 volts! How I determined this is a separate topic. Let's still go back to a convenient 2.56 volts. Look what happens: a maximum of 0.5 volts drops on the shunt, the ADC converts a maximum of 2.56 volts. A normalizing amplifier with a gain of 5 suggests itself, then the number obtained during the conversion will not require any advanced arithmetic to represent the result: 5 amperes = 2.5 volts = 250 units (for 8-bit conversion). You just have to multiply the result by two and put a decimal point between hundreds and tens to get a very convenient representation: units, tenths and hundredths of an ampere. The final transformation into seven-segment signs is a matter of technology. Everything is fine, you can implement it in hardware!

However, as I have already shown with the example of the built-in ION, it is not so easy to obtain acceptable (not to mention high!) accuracy with the components used. You can take the path of compensating for errors mathematically, using a program in the MK, although this will require calibration. This path is quite easily implemented in C and other high-level languages. But for me, a stubborn assembler, messing around with mathematics using RISC instructions is an extra headache!

I chose a different path - correction of the gain of the normalizing amplifier (NA). You don’t need much for this – one trimming resistor! Its value must be chosen correctly so that the adjustment range is sufficient, but not exaggerated.

Selection of normalizing amplifier elements

So, it is necessary to determine the adjustment range. The first step is to determine the tolerances of the components. For example, my shunt has an error tolerance of 1%. Other resistors in the normalizing amplifier circuit may have a tolerance of up to 10%. And don’t forget the inaccuracy of our ION, which in my case amounted to almost +12%! This means that the actual converted number will be almost 12% less. But since I already know this error, I take it into account in the NU gain, which should be 5.72. And since the real errors of other components are not known, it remains to find the maximum possible total error in order to calculate the adjustment range.

A simple sum of these “percentages” suggests itself: 1% of the shunt plus 2 times 10% of the op-amp feedback resistors. Total: 21%.

Let's see if this is really so. To do this, let’s take a look at the part of the diagram where this NU with already selected values ​​is presented:

As you can see, there is a non-inverting amplifier with a tunable transmission coefficient, theoretically adjustable from 4.979 to 6.735 at the ratings indicated in the diagram. But, if we take into account our ±10% possible error of each of the resistors, we get, with the worst combination, Ku = 5.864 - 8.009, which clearly exceeds the required coefficient! If this combination occurs, then you will have to take other denominations. It’s better to immediately increase the value of the tuning resistor, for example, to 39k. Then the lower limit of Ku will be 5.454, which is already acceptable.

Well, I – a “real radio junkie” – had to choose a trimmer from what was available, and was simply lucky to invest in the range! If I had a trimmer of a different value, it wouldn’t matter, I would recalculate R2 and R3, which in my case have a tolerance of 5%, so I didn’t have to take another trimmer.

Overcoming your shortcomings and omissions

It would seem that everything has been thought out and calculated - add a fee. Let's test this design on a breadboard first! No sooner said than done! Ku is being rebuilt not quite as expected, but within the limits of what is necessary. However, the indicator was not going to show 0.00 when there was no load current! First of all, I suspected the program was in the MK, but when the ADC input was short-circuited to the common wire, the treasured zeroes appeared. This means that something does come to the input of the MK, other than zero volts. Testing with a multimeter confirmed this assumption and set the next task. Without going into details of my research, I will only describe the result.

The reason turned out to be the following: I completely did not take into account that the op-amp I used was far from being of the best quality. He's not even so-called. "rail-to-rail". This means that its output potential will never reach any of the supply poles, i.e. in my case it will never be equal to 0 volts! Now, if it were powered from a bipolar source, then the output would be the expected zero. But my power supply is unipolar and I did not intend to complicate the circuit with any converter. The solution was found in the creation of a “virtual land”, i.e. Thanks to a separate power source (as opposed to the basic circuit), I was able to use a diode to shift the potential of the common wire relative to the negative pole of the battery.

So, the board is etched and soldered. It's time to pack this design into a case. Which, in fact, was done. However, during operation, another small flaw emerged - drift of the input circuits of the op-amp. This was expressed in a negative shift in readings, i.e. at a current of a couple of tens of milliamps, the indicator still showed zeros, which did not suit me! I would allow a shift of several mA - still milliamp units are not displayed. I had to introduce a bias circuit to the input of the NU.

The ratings of R4 and RZ are selected so as to provide a bias of plus/minus several tens of millivolts relative to the “virtual ground”. I had no desire to remake the finished board and I added the necessary adjustable divider in place of the Ku adjuster.

In general, the resulting device satisfies my needs. Of course, it can be improved for a long time, but there is no need yet!

I’ll talk about the digital part and mathematics next time using the example of a volt-ampere meter in a laboratory power supply.

A fairly simple device that measures voltage, current and shows the total power consumed by the load at a frequency of 50 Hz.

During repair work or when checking and testing new devices, it is often necessary to supply voltage from the LATR, and it is necessary to control the voltage and current. For these purposes, a voltmeter-ammeter was developed and assembled on a microcontroller with an LCD indicator. Since voltage and current are measured, the total power is easily calculated. The result is a very compact meter.
Specifications
1. The limits of change in the measured voltage are 0 – 255 Volts, resolution 0.5 volts. Readings are displayed in 1 volt increments.
2. Limits for changing the measured current 0 – 10 Amperes, resolution 20 mA. Readings are displayed in 10 mA increments.
3. Apparent power is calculated as the product of current and voltage and only the integer value in Volt-Amps is displayed.

Schematic diagram

Fragment excluded. Our magazine exists on donations from readers. The full version of this article is available only


Applied in the scheme direct measurement of AC voltage and current microcontroller.
The measured voltage through the divider R7, R9, R12 and C12 is supplied to the microcontroller input through the capacitor C10. Capacitor C12, together with the input voltage divider, forms an integrating circuit that prevents the penetration of impulse noise.

The measured current flows through the shunt R1, the voltage removed from it is amplified by the operational amplifier and, through the chain R8 and C8, is supplied to the input of the microcontroller. The first stage at OP1 is an inverting amplifier with an integrating capacitor C3 in the feedback circuit. Due to the fact that the voltage swing removed from OP1 should be about 5 Volts, the amplifier chip receives increased power (9-15 Volts). The second stage on OP2 is switched on by a repeater and has no special features. Capacitor C3 serves to reduce interference during the operation of the microcontroller's ADC.

The measuring inputs RA0 and RA1 receive a constant stabilized bias of 2.5 volts through resistors R11 and R13. This voltage allows you to correctly measure the positive and negative half-cycles of the input voltages.
An LCD display is connected to the PIC16F690 microcontroller, displaying 2 lines of 16 characters. Resistor R14 is used to set the optimal display contrast. Resistor R15 determines the display backlight current.
The device is powered from a separate 9-12 Volt transformer. The +5 Volt power stabilizer is assembled on a 78L05 chip and has no special features.


I powered the device from the telephone adapter. Due to the fact that the board has its own bridge Br1, the polarity of the connection does not matter. It is important that the voltage across capacitor C4 is between 10 and 15 Volts.

--
Thank you for your attention!


🕗 08/20/12 ⚖️ 18.04 Kb ⇣ 442 Hello, reader!

--
Thank you for your attention!
Igor Kotov, editor-in-chief of Datagor magazine


🕗 08/20/12 ⚖️ 6.41 Kb ⇣ 457 Hello, reader! My name is Igor, I'm 45, I'm a Siberian and an avid amateur electronics engineer. I came up with, created and have been maintaining this wonderful site since 2006.
For more than 10 years, our magazine has existed only at my expense.

Good! The freebie is over. If you want files and useful articles, help me!