Sensor suggestions for measuring DC amps, from +100A to -10A

I have been successfully reading current on an electric scooter using a 1 milli-ohm current shunt and cheap multimeter. The current through the two 12V batteries (i.e. 24V system) gets as high as 70A when engine is powering up a steep slope (that's almost 1.7kW!) and up to -10A when braking downhill or -5A when charging.

I want to measure and record these currents using one of my arduinos and am looking for ideas on sensors / interface to do this. I have only two concepts so far:

  1. continue to use the current shunt, but use some kind of wheatstone bridge diode arrangemntg to detect current direction. Also need to be careful not to put reverse or over-volts into arduino circuit, which will be powered from the scooter batteries.

  2. use some kind of current loop / magnetic field sensor like in a commercial "clampmeter". this would have advantage of being isolated from the 24 circuit, but I have yet to find a sensor like this?

TIA

Clearly a hall effect sensor suitable for DC current is what's required. The ideal unit will output 2.5 volts at 0amps rising to say 4 volts at +100amps and falling to 1 volt at -100amps.

An example of which is shown here http://www.hallsensors.de/CYHCS-C2S.pdf

These have total galvanic isolation between supply and output voltage so there are no problems with selecting a suitable reference point like you have with a shunt and they always produce a +ve output voltage so no problems of reverse polarity signals.

One of my current sensors might be a fit for what you're looking for.

Some users I've talked to are using them on electric scooters similar to yours.

Thanks

Roy

wow, that looks ideal !

mucho gratias :slight_smile:

so panucatt is your gig Roy? Really like the design of those current sensors ... and your web site intro where you crossed out "mission critical applications" and change it to "mad scientist projects" (from memory). ... funny :slight_smile:

There's a nice current shunt sensor module at Sparkfun and others: http://www.sparkfun.com/products/9028 - also measures voltage for complete power monitoring.

ninja2:
so panucatt is your gig Roy? Really like the design of those current sensors ... and your web site intro where you crossed out "mission critical applications" and change it to "mad scientist projects" (from memory). ... funny :slight_smile:

There's this guy who mentioned that he used the sensor in an experimental rocket so I was thinking JPL type stuff, but when he sent me a video of a test launch and its super awesome and qualifies as Mad scientist's stuff. I have a lot of ebay buyers from Australia, mostly for Wind/Solar and other power generating systems.

Thanks

Roy

The punacatt looks very good (see PDF, mounting tips for such a current are not trivial)

roypogi:
One of my current sensors might be a fit for what you're looking for.
100Amp Hall-Effect Current Sensor
Some users I've talked to are using them on electric scooters similar to yours.
Thanks
Roy

Roy,

I've started testing the Panucatt CS-100 unit and have a few questions if I may:

With the sensitivity of 20mV/A if I theoretically put +100A through, Vout would be (2+2.5) = 4.5V and if I put -100A it would be (-2+2.5) = 0.5V. Given analogRead on the arduino can read 0 - 5V range then in theory the current reading range is -125 to +125 amps. So ...

  1. Is the 100A limit simply a heat management issue, with suitable heat could it read up to 125A sink and still produce a valid Vout voltage?

In my project I want to read scooter amps in range from +70A to -10A with reasonable accuracy even at low currents. I put the CS100 in a circuit with 12V battery and 2 x 1 ohm 50W accurate resistors and the CS100 reported values jumped around a little, with values in a range like this (actual current was 5.8A):

analogRead Amps
533 5.13
535 5.62
537 6.10
539 6.59

It's in right range, but 1.4 amps uncertainty is a bit too much for my purposes. So now I'm interested in two issues: sensitivity and stability.

  1. If the CS100 can actually handle 125A, then could the CS50 possibly handle 62.5A, with heat sink ? (this would give me its higher sensitivity of 40mV/A)

  2. is the instability for reporting a constant current that I'm seeing above normal, or do I have a noise problem ? (my prototype is pretty rough)

if it's normal then I'll have to resort to averaging readings over a time window

Lastly I'm going to make a bold suggestion regarding the formula in your application sheet:

Current = ((analogRead(1)*(5.00/1024))-2.5)/0.02

I believe the 1024 should be 1023. I have a spreadsheet which maps the range of analogRead values 0 - 1023 against voltages. Assuming the reading for 0 volts = 0 and for 5 volts = 1023. This shows that using 1024 increments gives max range of 4.9951 Volts, not 5 volts. Whereas using (1024-1) increments gives full range of 0 - 5.00 volts. (how do I attach my spreadsheet file to this thread?). So I believe the formula should be

Current = ((analogRead(1)*(5/1023))-2.5)/0.02

An easy way to see the issue is consider it resolution of analogRead was just 2 bits instead of 10 bits, then only four voltages can be resolved:

Volts analogRead Amps
5.00 3 125
3.33 2 42
1.67 1 -42
0.00 0 -125

so the correct voltage increment for each bit is 5/3 = 1.67 V/bit and if I use 5/4 = 1.25 V/bit the range drops to just 0 - 3.75 volts.

For your consideration ...

(BTW I believe the Arduino analogRead reference is the source of this mistake http://arduino.cc/en/Reference/AnalogRead and it should e corrected to 1023 as well.)

ninja2:
In my project I want to read scooter amps in range from +70A to -10A with reasonable accuracy even at low currents. I put the CS100 in a circuit with 12V battery and 2 x 1 ohm 50W accurate resistors and the CS100 reported values jumped around a little, with values in a range like this (actual current was 5.8A):

analogRead Amps
533 5.13
535 5.62
537 6.10
539 6.59

It's in right range, but 1.4 amps uncertainty is a bit too much for my purposes.

The output from the Hall current sensor may well be jumping around a bit, in which case I suggest you average several readings. However, there are some other possibilities:

  1. The +5v supply feeding the Hall sensor and also used as the Arduino reference voltage needs to be stable. Ideally you should filter the 5v supply using an R-C or L-C network, and apply that filtered supply to the Aref pin and use it to power the Hall sensor. Then call analogReference() to select the external reference.

  2. You need to prevent ground noise reaching the analog input. Dedicate one of the ground pins on our Arduino to be analog ground. Use that ground pin only to connect the ground side of the Hall current sensor (and the ground side of any other analog sensors you are using), and the ground side of the filter capacitor if you are filtering the 5v supply as described above.

  3. The cable connecting the Hall sensor to the mcu could be picking up noise. Use shielded cable to connect the Hall current sensor to the Arduino, unless the distance is very short. The shield should be connected to analog ground.

ninja2:
Lastly I'm going to make a bold suggestion regarding the formula in your application sheet:

Current = ((analogRead(1)*(5.00/1024))-2.5)/0.02

I believe the 1024 should be 1023.

No, 1024 is correct. However, the reading you get from analogRead tells you the input voltage rounded down to the next step. For example, assuming the default analog reference of 5v, a reading of 0 means between 0v and 4.88mV on the input pin, a reading of 512 means between 2.5V and 2.50488V, and 1023 means between 4.99512V and 5V. This means there is a case for adding 0.5 to the reading you get before doing the maths on it.

One possibility for measuring wide dynamic ranges of current that I've looked at before is to use a low-forward-voltage (schottky) diode. If you calibrate for current (and temperature) you can use the voltage as a roughly logarithmic function of current. There is quite a lot of power wasted though (even large schottky diodes take upto 1V on very large currents it seems - ie 4% of a 24V circuit)

Where this can be useful is when you want a good real time estimate of battery charge when currents can vary over several orders of magnitude and you don't have a highly accurate ADC set up.

Ninja,

I would like to chime in on the current capacity since most of your questions were answered by MarkT and dc42.

The 100A physically can handle 125 amps (more in brief moments). Ive tested it constantly at 110Amps. The only issue I see is that linearity seems to suffer after 100amps also heat build up will change the devices' sensitivity. So make sure your connection to the sensor can handle the current(no stainless steel hardware please) otherwise heat would be an issue.

Roy

dc42:
... the reading you get from analogRead tells you the input voltage rounded down to the next step. ... This means there is a case for adding 0.5 to the reading you get before doing the maths on it.

thanks dc42, great info. That makes better sense, I stand corrected.
So the ideal formula becomes:

Current = ((Vcc/1024*(analogRead**+0.5**))-2.5)/0.02

I will work on my shielding and grounding too, thanks for the clues

Roy, OK thanks. Given my scooter will rarely be over 50A, and even then peaking around 60-65 A for perhaps 15 or 30seconds max, I think I'll try out the CS50 for it's greater sensitivity

Can you explain why stainless steel is bad for heat at the connection points?

Stainless steel has higher resistance than Copper or Aluminum so at higher currents it starts to heat up. Its only a problem if high current passes through stainless steel, like washers or nuts in between the wire lug and the sensor pads(Ive seen this too often), but if its just used to fasten the lugs directly to the sensor pads then thats aok.

If you need to place washers and nuts in between the sensor pads and wire lug(to prevent squishing the PCB) then use nickel plated copper. Dont forget lock washers or loctite, you dont want loose nuts at those currents.

Thanks

Roy

On the other hand if you use a donut style sensor like I suggested there is NO heating effect and you don't even have to break the main current feed circuit.
If the specified model is too large for your available, you could use a CSLA2CF which is much smaller, has a +/- 125A range, and a 0 - 5 volt output. However it is not split core so you'll have to feed the power lead through the core hole. I have used this model very successfully on our electric loco project.

I did look at the datasheet for the CYHCS-C2S sensor when you first mentioned it jackrae but I thought its physical characteristics (60x61x16) were a bit large for my confined circumstances, plus my current conductor is under 6mm dia. which would not go near filling the the "window" / hole in the unit, leading to inaccuracy per the datasheet.

Maybe I can get around these issues ... but what's the accuracy like. if the 100A unit has 1% accuracy that's 1 amp. At face value it's not much different to the accuracy I'm getting from the panucatt unit, even before I fix the grounding problem and get the formula right

But what the heck, if it's not expensive I could at least give one a test run . How much and where to buy though, from S. Australia?

royco:
Stainless steel has higher resistance than Copper or Aluminum so at higher currents it starts to heat up.

thanks Roy, most informative ... I was a dinghy sailor in my younger days and still have a slightly obsessive addiction to stainless steel fixtures and there's heaps of them in my garage storage boxes ... to be ignored now!