Pages: [1] 2   Go Down
Author Topic: Arduino as a V-A multimeter  (Read 9261 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I have a PSU and I want to use an Arduino with ATmega328 for a PSU's multimeter. The Voltage and Current should be displayed on a 16x2 character LCD. My question is what I need to measure the voltage and current and how to convert it.
Regards.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27144
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Measure the voltage - use a divider so the highest voltage you see is <5 , then connect to an analot pin & read it:
voltage_measure = analogRead (A0);  for example.

http://arduino.cc/en/Reference/AnalogRead

For the current, add a shunt resistor just above the ground point for your returns, then measure the voltage across the shunt.
Current will equal voltage measured/shunt resistance.
Or find any known place in your circuit where current is flowing thru a resistor measure the 2 sides of the resistor
(Voltage_high - Voltage_low)/resistor = current.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The PSU is 30V and 3A, but I'll use separate power supply for the Arduino board.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27144
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Shunt resistor examples
http://www.dipmicro.com/store/index.php?searchStr=shunt&act=viewCat&Submit=Search


Keep Vout <5V for voltage measurement.  Pick R1 + R2 so their total is greater than 30V/.001amp = 30K ohm


Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm looking at implementing this too in a bench top power supply I am building.  I had a quick question, do the analog pins read negative values as well?  I'm looking at having a +/-12v adjustable supply and didn't know if I would be able to directly read the negative values off of that branch.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27144
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No, you cannot exceed 0 to +5V.
However if the arduino ground is not connected to the PS ground, that is, floating like a multimeter, you can connect the arduino ground to -12 and the analog-in to the voltage divider above,  and take a reading that way. Make sense?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks! That's exactly what I wanted to know. I like the idea but since I am using the arduino to monitor other voltages as  well I think I may use a simple inverting amplifier with a gain of 1 to switch the polarity.  I was also thinking of using a sinple amplifier circuit to amplify the volatge across the shunt resistor so I can use a smaller shunt and still maintain a high level of granularity in my measurement.  Any thoughts?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27144
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Those would would work, you do have the +/-12V to work with.
You have 6 inputs you could scan thru, or you could set up some analog switches to scan thru.  Lots of options.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I was also thinking of using a sinple amplifier circuit to amplify the volatge across the shunt resistor so I can use a smaller shunt and still maintain a high level of granularity in my measurement.  Any thoughts?

Depends if your shunt is high-side or in the ground-return.  A high gain opamp circuit will work in the latter case, but then ground isn't quite at ground because of the voltage drop across the shunt.  There are modules that can do voltage and high-side current sensing/amplification yielding outputs in the 0--5V range.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was wondering if an amplifier would work with a high side shunt or not.  I don't know of anything that would work on the high side but have not had a chance to look yet.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27144
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

High side shunt, you could set up a differential amplifier and feed that output to the arduino.
Make sure the voltages on the shunt are within the range of your opamp +/-supply or use voltage divider to get them down.
Or measure both sides separately and just do the math.

http://www.electronics-tutorials.ws/opamp/opamp_5.html
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey,

Well, i don't know what is the range of current and voltage you're looking for measurement. There is a simple way out though-

Go for an I2C measurement IC. I have worked on Texas instruments INA219 before with arduino fio. It works perfectly well, though for voltage till 26V and current 4Amps. Best part is, you need to make only 4 connections(Data, clock, Vcc and ground. I2c code is also simple to work out.
Here's a good tutorial to start with I2c
http://naneau.nl/2009/01/18/arduino-and-an-i2c-temperature-sensor/

Good luck.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AWESOME that is exactly what I am looking for, I just put some of those INA219 chips on order to play around with.  Will need to work out the code.  Although I know the basics of C++ haven't done much with Arduino code yet.  Will need to figure out the bus code and what not, should be fun.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am working on a load simulator for solar panel testing. The load simulator circuit is pretty straightforward and has been discussed in literature:

http://www.springerlink.com/content/778809q969528p42/

The hard part is measuring 0-100V on the Arduino accurately for the panel voltage and current (I am using a current shunt). I was thinking of using a simple voltage divider circuit, however I am afraid I will not get good accuracy. Connecting the voltage divider to a digital Arduino pin (0-5V)  means that I would need a tolerance of about 0.05V on the digital pin to achieve single volt accuracy. Is this feasible on the Arduino?

Edit: The end goal here is to simultaneously measure current and voltage during a load sweep and write the values to a memory card. This would be a portable handheld device
« Last Edit: March 28, 2011, 05:25:17 pm by Eric E. » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27144
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino accuracy is 0.0048V/bit with a 0 to 5V input into an Analog pin (not digital).
So 100/20 = 5V = a reading of 1023
Thus 1 bit = 0.0048 * 20 = 0.098V.

However, if your arduino is  a handheld device, that means your ground is not really ground - and  if you connect across the shunt with arduin ground on 1 side side and the Analog input on the other, you should be seeing much less voltage.
For example, this 10mOhm shunt available at dipmicro.com.   You would have to put 500A thru it to see a 5V across it (5V/0.01ohm = 500).
How many amps are you expecting?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1] 2   Go Up
Jump to: