Shop OBEX P1 Docs P2 Docs Learn Events
Reading a shunt resistor with an adc — Parallax Forums

Reading a shunt resistor with an adc

mosquito56mosquito56 Posts: 387
edited 2009-07-30 01:45 in Propeller 1
I am trying to find a way to read an alternator output with an adc. The problem is when the curcuit discharges instead of charge as when starting an engine.
·A normal meter has 2 way deflection, neg discharge, pos charge. Does anyone know of a curcuit I can use to read·voltage on a shunt?

Thanx
Don

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······

······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet
········

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-24 23:31
    You need a 2 channel ADC like the ADC0832 or the MCP3202 plus some kind of dual buffer that can handle the alternator output voltage (12-14V or more). The buffer would be set up to reduce the voltage range to something the ADC can handle like 0-3.3V for the MCP3202 or 0-5V for the ADC0832. You'd digitize the voltage at both ends of the shunt and the difference would be the voltage across the shunt which could be positive or negative.

    The LM358 that Parallax carries is an old design, but it can handle voltages up to 30V and is a dual op-amp.

    Post Edited (Mike Green) : 7/24/2009 11:36:33 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-24 23:42
    There's a nice example of "Ground Referencing a Differential Input Signal" in this datasheet:
    instruct1.cit.cornell.edu/courses/ee476/labs/s2009/LM358.pdf on page 16
  • mosquito56mosquito56 Posts: 387
    edited 2009-07-25 05:36
    ADC Input Driver FULLY DIFFERENTIAL AMPLIFIER
    http://www.ecircuitcenter.com/Circuits/adcin_fully_diff/adcin_fully_diff1.htm

    I found this with a search of differential amplifiers. With voltage dividers from 12 v to 5 volts on the shunt·and a vref of 2.5 volts , the output should be 0-5 volts? I have a feeling this is wrong with the dividers. Maybe the 12v is vcc and the shunt is pos and neg to the opamp?


    Ground Referencing a Differential Input Signal only shows 1 op amp but you mention 2.· I have bunches of lm358 and adco832 so we are in the perfect ball bark.

    I have only just begun to understand voltage gain op-amps with the thermocouples and differential is a whole new ball game.



    Am I in the area anywhere?

    Thanx

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·······

    ······· "What do you mean, it doesn't have any tubes?"
    ······· "No such thing as a dumb question" unless it's on the internet
    ········
  • Nick MuellerNick Mueller Posts: 815
    edited 2009-07-25 09:16
    The most obvious way is to use an OpAmp as an adder.
    Say the ADC can read 0..5V, then you dimension the shunt to have a voltage-drop of 2.5V, either + or -.
    So the shunt gives you -2.5V ... +2.5V.
    To be able to feed that into the ADC, you have to add 2.5V, thus shifting the voltage 2.5V up and giving you 0...5V for the ADC.
    And adder with an OpAmp is an easy thing.

    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-07-25 14:17
    Are you monitoring the output of the alternator or the input/output of the battery ?

    The alt should only give out as the diodes block it from being a motor,

    The ratio of batt in/out is huge and depending on which one you want data on will determin which way you measure. If the battery current is the point of measurement them the large starting ( discharge ) current result is going to have to be clamped off if there is to be any meaningful resolution to the charging level, unless you use more than 8 bits.

    Rather than 50/50 it would be 200/10

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • mosquito56mosquito56 Posts: 387
    edited 2009-07-25 17:20
    The battery is connected thru a 20amp shunt. I want the charging and discharging of the battery I guess in answer to your question. I thought that since the alternator goes thru the voltage reg to the battery it is the same but I forgot about the voltage regulator.

    ·I am only interesting in the charge and discharge of the battery if that makes a difference.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·······

    ······· "What do you mean, it doesn't have any tubes?"
    ······· "No such thing as a dumb question" unless it's on the internet
    ········
  • Nick MuellerNick Mueller Posts: 815
    edited 2009-07-25 17:36
    Oh, one thing forgotten!
    You are measuring on the high side! You might investigate into "high side current sensors".


    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-07-25 19:55
    assuming that the starting current doesn't go through the shunt ( it would only manage to do a fraction of one attempt ) then the sensing could be brought out of a bridge of resistors ie two identical values from + to - on either side of the shunt. The difference would be halved but would be placed at half volts potential and provide a sort of protection from the brute force, if suitably high values are chosen.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2009-07-28 21:00
    A while ago Maxim put out an App-Note for signal conditioning just this type of measurement...

    Take a look:

    http://pdfserv.maxim-ic.com/en/an/AN1949.pdf

    My caution is that you probably want to be careful how you connect your circuit - place the shunt between the battery and the load/alternator, but hook the starter directly up to the battery.· Depending on the size of your engine, some starters can draw over 800Amps (and if you only put in a 100Amp shunt for your loads, you'll probably damage the op-amps/ADC). ·If you·NEED to measure the current of the starter (I did in my engine management app, for auto-start), you can calculate the current by measuring the voltage drop across the starter's positive wire (which is actually measurable between 20mV-1.5V), then calculate the current from that.

    It's an easy way to tell if the starter is actually under load (contributing to the spin of the engine).

    -Tim
  • mikedivmikediv Posts: 825
    edited 2009-07-28 23:16
    I was curious when I read this so I went out and put my voltage meter accross the car·battery it read 13.4 when just sitting there and 12.6 when I tired to start the car and 14.2 when running ,, maybe you could read accross the battery terminals ???
    ·
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-07-29 00:23
    Don, have you tried out that Hall-Effect Current sensor? If you're using an alternator, I imagine you're using some pretty heavy currents... The sensor is designed for large currents, and has all the differential amps built in. The output is Vs/2 for 0A, and swings below that for negative currents, above that for positive currents. You can then use an ADC to read the output.
  • mosquito56mosquito56 Posts: 387
    edited 2009-07-29 05:23
    phil, that sounds perfects vs/2 at 0 volts. You have a pn or description?
    · I found an ampmeter at autozone for $15. I will probably go that route as the starting current is going to be a bear.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·······

    ······· "What do you mean, it doesn't have any tubes?"
    ······· "No such thing as a dumb question" unless it's on the internet
    ········
  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-07-29 05:42
    Er? I can't recall the exact p/n, but the thing I'm talking about is one of those strange "things" I sent you a while back. It has two thick copper(with tinning) bus bars sticking out. They also have three small pins on the other side of the device. Come to think of it, I THINK the P/N is ACS754... or at least part of it is anyway. They are 5V devices, btw, but I'm pretty sure you can power them just fine with 3.3V.
  • shanghai_foolshanghai_fool Posts: 149
    edited 2009-07-29 07:30
    Try this

    http://www.allegromicro.com/en/Products/Part_Numbers/0756/index.asp



    I have used them and they work great.
  • mosquito56mosquito56 Posts: 387
    edited 2009-07-29 12:42
    Phil, when you mentioned the hall effect first time, I thought that was one you sent me. Unfortunately alot of the stuff u sent don't have p/n on them. I did find the one you described. Then shangai-fool suggested something with a very close p/n.

    · As soon as I get the engine installed I will start playing with them. I am pretty sure these are what I need.

    ·Thanx much.





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·······

    ······· "What do you mean, it doesn't have any tubes?"
    ······· "No such thing as a dumb question" unless it's on the internet
    ········
  • Tired2Tired2 Posts: 29
    edited 2009-07-30 01:45
    Wow, those are nice.

    It looks like they will do +/- 50A and +/- 100A depending on the model.

    I assume this could be increased by paralleling these devices with a larger cable of known resistance... for instance, the alternator problem... If you pass a known load through the cable, and measure the voltage drop across the wire, you can calculate its resistance with R=V/I .. (which no meter would read accurately)...

    So, say the resistance of the high current wire is (just for easy math's sake) 13 micro-ohm. Since the chips listed above claim 130 micro-ohm, if you paralleled the two... then the shunt (in this case, the hall effect sensor), would see 1/10 of the current of the larger alternator charging wire... that would allow you to measure currents (granted, with less precision) of up to 500A if you scaled by the ratio of shunt:wire resistance (10 in this hypothetical case).

    Does anyone see why that would be a problem?

    I was also curious if the same method would work using an ADC0832 (or similar chip) in differential mode. If you connected a voltage probe to both ends of the cable, provided you were certain of its resistance value, the differential voltage from the supply side to the resulting side would relate to the amperage as: I=V/R, correct? (of course, this also assumes the adc received allowable voltage references, not full 12v).

    My current project requires me to be able to read amperage spikes over 2000A DC, so this topic interests me a good bit.

    Of course, once you get a system working, you can use a (hopefully well calibrated) ammeter or power supply/load combination to check your accuracy, and adjust your scale accordingly.

    Wow, sorry for all the parenthesis (it is a bad habit of mine.)

    Post Edited (Tired2) : 7/30/2009 1:57:25 AM GMT
Sign In or Register to comment.