Author Topic: Amp meter using arduino  (Read 6956 times)

0 Members and 1 Guest are viewing this topic.

Offline DarkZeroTopic starter

  • Regular Contributor
  • *
  • Posts: 163
  • Country: cs
Amp meter using arduino
« on: September 06, 2015, 07:33:26 pm »

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.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Amp meter using arduino
« Reply #1 on: September 06, 2015, 07:36:46 pm »
The common mode voltage of this configuration would be 19V. Not going to work.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Amp meter using arduino
« Reply #2 on: September 06, 2015, 07:40:49 pm »
  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.

 

 

Offline tron9000

  • Frequent Contributor
  • **
  • Posts: 423
  • Country: gb
  • Still an Electronics Lab Tech
    • My Hack-a-day project page
Re: Amp meter using arduino
« Reply #3 on: September 07, 2015, 08:22:35 am »
The common mode voltage of this configuration would be 19V. Not going to work.

Yep, up your op-amp supply voltage to +/-22V odd (LM293 ain't rail to rail so stick some headroom in there)
« Last Edit: September 07, 2015, 08:24:39 am by tron9000 »
Partsbox.io - orangise your parts!
"If you're green you can only ripen. If you're ripe you can only rot!"
 

Offline oPossum

  • Super Contributor
  • ***
  • Posts: 1415
  • Country: us
  • Very dangerous - may attack at any time
Re: Amp meter using arduino
« Reply #4 on: September 07, 2015, 02:13:57 pm »
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-anyhow
There 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/

 

Offline LarsT

  • Contributor
  • Posts: 40
Re: Amp meter using arduino
« Reply #5 on: September 09, 2015, 09:23:20 am »
The common mode voltage of this configuration would be 19V. Not going to work.

Can 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.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Amp meter using arduino
« Reply #6 on: September 09, 2015, 09:31:05 am »
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.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Amp meter using arduino
« Reply #7 on: September 09, 2015, 09:33:11 am »
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
 

Offline LarsT

  • Contributor
  • Posts: 40
Re: Amp meter using arduino
« Reply #8 on: September 09, 2015, 10:31:17 am »
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.

Thanks.

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?
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Amp meter using arduino
« Reply #9 on: September 09, 2015, 10:35:15 am »
Wow, I completely missed the elephant in the room. Brace yourselves...

LM293 is a comparator. :palm:
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline tron9000

  • Frequent Contributor
  • **
  • Posts: 423
  • Country: gb
  • Still an Electronics Lab Tech
    • My Hack-a-day project page
Re: Amp meter using arduino
« Reply #10 on: September 09, 2015, 03:15:29 pm »
Wow, I completely missed the elephant in the room. Brace yourselves...

LM293 is a comparator. :palm:

Whoops! :palm:

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.
« Last Edit: September 09, 2015, 03:18:37 pm by tron9000 »
Partsbox.io - orangise your parts!
"If you're green you can only ripen. If you're ripe you can only rot!"
 

Offline DarkZeroTopic starter

  • Regular Contributor
  • *
  • Posts: 163
  • Country: cs
Re: Amp meter using arduino
« Reply #11 on: September 09, 2015, 07:40:45 pm »
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 lm293

in attachement there is full schematic of this supply i made and here is the thing working


now 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.



« Last Edit: September 09, 2015, 07:54:03 pm by DarkZero »
 

Offline LarsT

  • Contributor
  • Posts: 40
Re: Amp meter using arduino
« Reply #12 on: September 10, 2015, 08:20:25 am »
Wow, I completely missed the elephant in the room. Brace yourselves...

LM293 is a comparator. :palm:

Whoops! :palm:

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.

Would an lm358 work?
 

Offline Connoiseur

  • Regular Contributor
  • *
  • Posts: 104
  • Country: in
Re: Amp meter using arduino
« Reply #13 on: September 10, 2015, 08:40:55 am »
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.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Amp meter using arduino
« Reply #14 on: September 10, 2015, 10:12:08 am »
Would an lm358 work?
Yes.

ok will mc1458 work and with supply of +22.5v and -6v?
Yes.
Also, your schematic is incredibly obfuscated, you might want to clean that thing up if you plan on submitting it anywhere.

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.
Yeah, but do you learn anything if you just avoid whatever seems difficult?
« Last Edit: September 10, 2015, 10:18:51 am by Dave »
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Amp meter using arduino
« Reply #15 on: September 10, 2015, 10:55:01 am »
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.
This 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf