Arduino voltmeter and ammeter - Page 1
Forum section: electronics / general

author: jwbrooks
author_rank: Contributor
timestamp: November 15, 2013, 10:52:43 pm
content: Hello,I'm a little out my depth, and I was hoping I could get some pointers or in the very least a few links to relevant material.My ObjectiveI need to build a "unit" that measures both voltage and current of the power passing through it, and passes these values on to my microcontroller. I'm looking to use ICs or breakout boards instead of full multimeters. Please, refer to the attached picture.SpecsThe power source will be AC stepped down and rectified to ~50V DC. The current will likely be on the order of 0.25 to 1.5 amps. The two meters will need have a minimum of 12 bit resolution (16 would be better) and be as noise free as possible. The sampling rate can be as slow as 1Hz.My questions1. What ADCs or breakout boards do people recommend?2. Do these ADCs measure voltage and current directly, or do i need to build an additional circuit to support the ADCs?3. Is rectified or unrectified AC easier to measure? For my end application, it doesn't matter which I provide. I just want the cleanest and most precise measurement.Thank you. I appreciate whatever feedback you can offer.

author: timb
author_rank: Super Contributor
timestamp: November 16, 2013, 12:35:04 am
content: 1) The Arduino has built-in ADC inputs (Eight 10-bit channels on the 328P). You could double them up to improve the resolution, otherwise I'd just get a 16-bit ADC from TI and solder it onto a SOIC breakout board yourself. It may be a good idea to run the input through a high performance instrumentation OP-amp first as well.2) Normal ADCs measure voltage. To measure current what you'll need to do is use a shunt resistor (or series resistor). If you want to "cheat" you could use something like anACS712current sensor, which you place in-line with what you want to measure and it outputs a voltage to measure (e.g., 1mV = 1mA).3) You'll have to rectify the voltage to measure it with an ADC. You'll also need to attenuate the voltage down to what the ADC can handle as well. What you want to do is rectify the voltage and then run it through a voltage divider. (This is how multimeter's work, when you change ranges you're changing the voltage dividers the input goes through.)Can you explain what you end goal is? Why can't you use a multimeter? Getting clean, noise free, precise voltage measurements at 16-bits is going to be really hard without designing a custom PCB (with separate analog and digital supplies and proper ground planes). You canbuy a $30 multimeter on Amazonthat has an RS-232 output, which you could bring into the microcontroller a hell of a lot easier than you're going to build this circuit.

author: dannyf
author_rank: Super Contributor
timestamp: November 16, 2013, 01:09:48 am
content: Quote16-bit on current measurement is quite difficult: most current sensors are good to 1% (~8 bits).QuoteADI and Microchip have some of those chips.QuoteMeasuring AC is generally beyond what most people are capable of doing.

author: Jon Chandler
author_rank: Frequent Contributor
timestamp: November 16, 2013, 02:30:59 am
content: Look at the TI TMP512/513 chips. They'll handle up to 28 volts and have a high resolution ADC to measure current with a shunt resistor. It's an I2C interface.

author: Kappes Buur
author_rank: Regular Contributor
timestamp: November 16, 2013, 04:58:20 am
content: For a first experiment take a look at these:http://startingelectronics.com/articles/arduino/measuring-voltage-with-arduino/http://startingelectronics.com/projects/arduino-projects/arduino-4-channel-LCD-voltmeter/

author: johnboxall
author_rank: Unknown
timestamp: November 17, 2013, 10:13:07 pm
content: http://www.linear.com/product/LTC2945

author: synapsis
author_rank: Regular Contributor
timestamp: November 18, 2013, 04:58:13 am
content: I used this on a programmable load project. You can read current, voltage, and power from the single device.http://www.ti.com/product/INA226

author: jwbrooks
author_rank: Contributor
timestamp: November 19, 2013, 08:56:44 pm
content: Thanks for the feedback!I've done a bit of research on peoples suggestions, and I think I'd prefer (for the time being) to not reinvent the wheel and use one of these "power monitor" ICs.What do people think about something like this? I could keep the 120VAC as it is (no step down or rectification). Is the 24 bit resolution for real?http://www.ti.com/lit/ml/slyt428/slyt428.pdf

author: jwbrooks
author_rank: Contributor
timestamp: November 19, 2013, 09:56:31 pm
content: Or this one?http://media.digikey.com/PDF/Data%20Sheets/Maxim%20PDFs/MAXQ314.pdf

author: tszaboo
author_rank: Super Contributor
timestamp: November 23, 2013, 10:22:06 am
content: I would use the DC value.Divide the 50 Volt by 15-20 with a resistor divider, buffer it with an opamp, connect it to ADC. Put a shunt on the high side, and connect a high side current sense amplifier to it, connect it to a ADC.http://nandblog.com/types-current-sense-amplifiers/If you can tell us not only the resolution, but also the accuracy, maybe we can give you more detail.

author: timb
author_rank: Super Contributor
timestamp: November 25, 2013, 11:15:54 pm
content: Quote from: jwbrooks on November 19, 2013, 08:56:44 pmThe MSP430AFE won't take straight 120VAC... You need to use a resistor divider to bring it down to under 400mV (which is the range of the ADC). For current you'd need expensive current transformers or shunt resistors. You'd also need to add filtering for voltage spikes and some form of over voltage clamping.Then you'd need to optically/magnetically isolate the data output to your PC/second microcontroller.That's way too complex for what you want to do I think.

author: timb
author_rank: Super Contributor
timestamp: November 25, 2013, 11:17:37 pm
content: Seriously, just get one of these:http://www.amazon.com/TekPower-TP4000ZC-RS232-Interaced-Ranging-Multimeter/dp/B000OPDFLM$35 Multimeter with an RS-232 interface. The protocol is available online (I've got a copy if you need it) so you could easily interface it with a computer/microcontroller or whatever. Boom, done.

author: SixD
author_rank: Contributor
timestamp: December 16, 2013, 06:48:44 pm
content: I found this pagehttp://arduinoprojects101.com/arduino-voltmeter/maybe it can be any help.