Amp meter using arduino - Page 1
Forum section: electronics / beginners

author: DarkZero
author_rank: Regular Contributor
timestamp: September 06, 2015, 07:33:26 pm
content: I want to make volt/amp meter using arduino for my PSU. i use 0.05 Ohms as shunt current is 0-2A and 0-20V in the attachment i configured op-amp as differential amplifier with gain of 20 that will give me 0-2V output corresponding to 0-2A ( ill probably end up using 40 gain ) .now some questions im not sure how i would calibrate this since i probably cant get exact gain.

author: Dave
author_rank: Super Contributor
timestamp: September 06, 2015, 07:36:46 pm
content: The common mode voltage of this configuration would be 19V. Not going to work.

author: retrolefty
author_rank: Super Contributor
timestamp: September 06, 2015, 07:40:49 pm
content: Keep in mind that you can easily add 'calibration numbers' into your sketch rather then having to hand select the external components. It just takes a few test runs to come up with the correction factors and because you are dealing with just a 10 bit ADC and the internal reference tolerance on the 328P chip, it's best to keep it simple. Test and compensate with firmware.

author: tron9000
author_rank: Frequent Contributor
timestamp: September 07, 2015, 08:22:35 am
content: Quote from: Dave on September 06, 2015, 07:36:46 pmYep, up your op-amp supply voltage to +/-22V odd (LM293 ain't rail to rail so stick some headroom in there)

author: oPossum
author_rank: Super Contributor
timestamp: September 07, 2015, 02:13:57 pm
content: There is a common circuit that will perform better than the obvious differential amp. It is explained by Bob Pease here:http://electronicdesign.com/power/whats-all-error-budget-stuff-anyhowThere are many chips made for high side current sensing that have most of the circuit in the chip. TI and others make them.There are also combo current and voltage measurement chips like the INA219 that greatly simplify making a volt/amp/watt meter.Here is a project I did using the INA219, MSP430 and a small graphic LCD:http://forum.43oh.com/topic/2351-voltampwatt-meter/

author: LarsT
author_rank: Contributor
timestamp: September 09, 2015, 09:23:20 am
content: Quote from: Dave on September 06, 2015, 07:36:46 pmCan you please explain what you mean by that?I was trying to build a similar project a while ago but couldn't get it to work.

author: Dave
author_rank: Super Contributor
timestamp: September 09, 2015, 09:31:05 am
content: Common mode voltage = the average potential of both opamp inputs (they are both pretty much the same) with respect to circuit ground. If this voltage exceeds the opamp's input voltage range (usually determined by the supply rails, but not always), your circuit isn't going to work.

author: Jeroen3
author_rank: Super Contributor
timestamp: September 09, 2015, 09:33:11 am
content: Move the load above the shunt to eliminate most of the common mode voltage. Thus: Low Side sensing. Now you have High Side sensing.http://www.ti.com/lit/ml/slyb194a/slyb194a.pdf

author: LarsT
author_rank: Contributor
timestamp: September 09, 2015, 10:31:17 am
content: Quote from: Dave on September 09, 2015, 09:31:05 amThanks.I used ground as the negative supply to the opamp, which means the output from the lm293 always will have a certain offset from ground?

author: Dave
author_rank: Super Contributor
timestamp: September 09, 2015, 10:35:15 am
content: Wow, I completely missed the elephant in the room. Brace yourselves...LM293 is a comparator.

author: tron9000
author_rank: Frequent Contributor
timestamp: September 09, 2015, 03:15:29 pm
content: Quote from: Dave on September 09, 2015, 10:35:15 amWhoops!So it is - well Darkzero that will never work, not in a month of sundays! Its an open collector output on that op-amp.so many op-amps, can't know what they all do off by heart.Oddly I've seen loads of students do exactly the same mistake: use a comparator for linear applications.

author: DarkZero
author_rank: Regular Contributor
timestamp: September 09, 2015, 07:40:45 pm
content: ok will mc1458 work and with supply of +22.5v and -6v? its what i planed to use i just picked random symbol and it just so happen to be lm293in attachement there is full schematic of this supply i made and here is the thing workingnow i want to make amp/volt meter using arduino so i can see both current and voltage which i have to use switch now since its single display, now i could make second display but it would not be in spirit of this power supply which is to be dirt cheap.

author: LarsT
author_rank: Contributor
timestamp: September 10, 2015, 08:20:25 am
content: Quote from: tron9000 on September 09, 2015, 03:15:29 pmWould an lm358 work?

author: Connoiseur
author_rank: Regular Contributor
timestamp: September 10, 2015, 08:40:55 am
content: I think easier the solution is to use hall effect current sensor (like ACS712 by Allegro Microsystems). You can do away with the tricky analog part completely.

author: Dave
author_rank: Super Contributor
timestamp: September 10, 2015, 10:12:08 am
content: Quote from: LarsT on September 10, 2015, 08:20:25 amYes.Quote from: DarkZero on September 09, 2015, 07:40:45 pmYes.Also, your schematic is incredibly obfuscated, you might want to clean that thing up if you plan on submitting it anywhere.Quote from: Connoiseur on September 10, 2015, 08:40:55 amYeah, but do you learn anything if you just avoid whatever seems difficult?

author: Jeroen3
author_rank: Super Contributor
timestamp: September 10, 2015, 10:55:01 am
content: Quote from: Connoiseur on September 10, 2015, 08:40:55 amThis will come with compromises regarding resolution, bandwidth, phase and latency.If the common mode voltage is unavoidable, take a look at the INA series from Texas Instruments, they have specialized amplifiers for this type of shunt measuring with common mode voltages of 30 volt-ish.