I am dealing with an Arduino project where I am designing a digital multimeter which reads up to 120 VAC voltages and displays it on screen. I am using a voltage divider for the division, a bridge for rectification. Now at the Arduino am reading between ADC values and resolution. The formula which I am using is:
All setup is complete and is fine to launch. Just confused with this formula. All suggestions are welcome.
Hi
What model arduino are you using?
Can you tell us your electronics, programming, Arduino, hardware experience?
ADC reading is the 0 to 1023 that will come from your ADC when you do a analogRead.
0 == 0V and 1023 == 5V at the analog input of the controller.
Resolution of ADC is the max value of the ADC == 1023.
System Voltage == the reference voltage for the ADC, usually the controller supply volts == 5V
So if you fill in the equation.
Analog Voltage Measured (AT THE CONTROLLER INPUT PIN) = (ADC from analogRead) * ( 5 ) / (1023)
Your voltage divider will provide the drop from 120V to 5V.
If you are rectifying the AC, you will end up with pulsed DC, your readings will keep changing with the waveform.
If you put a filter capacitor in circuit you will then get the peak voltage of the waveform, this will be higher than without the capacitor.
PLEASE before connecting to the arduino, use your DMM to check your voltages at the analog input, it must not be over 5Vdc.
Before you turn anything on please can you post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Tom....
I am using a voltage divider for the division,
Have you factored in the fact that the maximum voltage will not be 120V but:-
1.41421356237 x 120V = 169.7V
Which is the peak voltage on the system, 120V is ONLY the RMS value.
First, be VERY CAREFUL when connecting the Arduino to power line voltage! Normally, I'd say DON'T DO IT but maybe I'm too late for that...
Even with a voltage divider it can be dangerous to you, your Arduino, and to your computer (if the USB is connected). If the whole thing is enclosed in a plastic case and battery operated (like a regular portable multimeter) it can be safe but it can still be dangerous during development/debugging/troubleshooting.
If the voltage divider is on the AC side of the rectifier, you'll need a pull-down resistor between the Arduino's input and ground. Without the resistor, the ADC input is floating (in one direction) and it may float-up even with no voltage coming-in. (The resistor should be at least 10 times the "bottom" resistor in your resistor divider because it will affect the voltage divider). If the voltage divider is on the DC side you don't need a pull-down.
Also, add a capacitor between the ADC input and ground. The capacitor will charge to the AC peak(~170VDC) so your software doesn't have to hunt for the peak or calculate RMS or average, etc. (Look-up "RC time constant" to help with the capacitor value).
It's also a good idea to add a [u]protection diode[/u] in case of an unexpected over-voltage. (All multimeters have protection so you don't fry the meter by connecting it to high voltage when set to a low-voltage range.)
All setup is complete and is fine to launch. Just confused with this formula. All suggestions are welcome
Start by reading the ADC. Once you're getting "good readings", add the expression (formula).
Besides the peak factor, you'll get a ~1.4V drop across the full-wave bridge. You can subtract that out, but it makes low-voltage readings inaccurate or impossible.
Just re read the initial post.
Note that the Mains voltage must be isolated, that normally means use a small transformer before the bridge rectifier. You should never connect any part of the Arduino to any part of the mains.
HI,
You haven't stated an accuracy goal so I'll just mention this for your information.
The bridge rectifier (which appears to be on the already reduced side of the divider / transformer) will "chop" off between a 1 - 1.5 volts of your waveform. I guess it could be calibrated out but it will not be svery stable.
For safety reasons, you should follow this very sensible tutorial at Open Energy Monitor
Multimeters are designed for high voltage and are encased in plastic and no live parts are accessible to the
fingers - for instance mine has a USB interface, but that is opto-isolated in its own little internal compartment in
the case...
Making your own to the same safety standard needs care.
TomGeorge:
PLEASE before connecting to the arduino, use your DMM to check your voltages at the analog input, it must not be over 5Vdc.
It is mega 2560. My circuit is set to provide the 5 V to Arduino. One thing about voltages, the official docs on website say that it can have the voltage limit 6-20 V Link: https://store.arduino.cc/usa/arduino-mega-2560-rev3 which input voltage is this?
Hi, The other forum members are very/extremely/absolutely correct regarding safety.
Personally I use a split bobbin transformer when building something requiring mains power. The reason is I like the extra degree of safety that comes from having the primary and secondary windings separated by a plastic wall. This is not required, just my personal choice. You can google "split bobbin transformer" and find many choices.
Regarding your question,
See this for a description of the Mega 2560 pinout Pinout Link
Note: Electrical component specifications are not meant to be misleading but often can be if you aren't familiar with application details. Here you must limit the max input voltage to not damage the on board powersupply (see p3 of the above link).
Electrical:
It is mega 2560. My circuit is set to provide the 5 V to Arduino. One thing about voltages, the official docs on website say that it can have the voltage limit 6-20 V Link: https://store.arduino.cc/usa/arduino-mega-2560-rev3 which input voltage is this?
Those input voltages only apply to the Vin pin or the power jack.
Electrical:
I am dealing with an Arduino project where I am designing a digital multimeter which reads up to 120 VAC voltages and displays it on screen. I am using a voltage divider for the division, a bridge for rectification. Now at the Arduino am reading between ADC values and resolution. The formula which I am using is:
All setup is complete and is fine to launch. Just confused with this formula. All suggestions are welcome.
ADC reading would be a digital value between say 0 and whatever the maximum value is for this digital system, right? eg. 0 and 1023 for a 10 bit system.
Resolution is generally the smallest increment for any system. For a typical digital system, the smallest increment is '1', since the values of the digital system goes from 0, 1, 2, 3, .... 1023. So the resolution is 1, but need to also specify the number of levels the system works with (eg. 1024 levels, or 10 bit).
If the digital range from 0 to 1023 is hypothetically assigned to a span of 5 volt, then could hypothetically divide up this 5 volt into 1024 values.... 5/1024. So the 'analog' resolution would be something like 5/1024 volt.
So if we get a reading of 0 for the digital level, then that would translate to 0 * (5/1024), which is 0 volt. And a digital level reading of 1 would be 1 * (5/1024) volt. And a digital level reading of 2 would translate to 2 * (5/1024) volt. etc. And the highest possible digital level reading of 1023 would translate to 1023 * (5/1024), which is not quite 5 volt..... just under it. We don't have a digital reading of 1024, because we only go up to 1023......since level 0 to level 1023 will cover 1024 values already.
In the figure that says 'resolution of ADC' ....... they probably meant to say 'total number of ADC levels'. So if 10 bit....total number of levels would be 1024. The figure should be changed (modified) in order to address the erroneous portion (ie. "resolution of ADC").
Where did that formula come from anyway? Where did you get it from?