Maker Pro
Maker Pro

Measuring high current with PIC

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
So me and my quadcopter project continues.
Now I would like to measure up to 40A using the ADC on a PIC.

So far:
1. I have some resistive wire, 4.2R per meter. (28SWG) I also looked at making a PCB trace, but that would have to be huge to cope with the heat dissipation/current.
2. I would like the shunt to be about 0.000625R, which would mean 1watt of heat dissipation at 40A and very little voltage drop(about 25mV).
3. Back to the resistive wire.
a) 4.2R per meter gives 0.0042R(I think R0042 is also correct) per mm.
b) Put 20 strands in parallel and it should be 0.00021 per mm, meaning I would need 3mm length to give 0.00063R. Double the length to make it mechanically more workable and that should give a voltage drop of about 50mV and wattage=2watt at 40A giving 1.25mV per amp.
c) To use the full range of the PIC ADC the 50mV must be amplified to 4V, so gain = 4 / 0.05 = 80 which should easily be achieved with a 741 opamp using 56K/680R resistors giving gain of 82.
d) Accuracy. This does not need to be 100% as it is high current, but 1024 steps for 40A should be around 40mA steps, which is pretty much good enough(exceeds requirements actually).

I looked at buying a high wattage low resistance resistor to use as a shunt, but the best I could find readily available here in the UK is R005 (0.005R) 5watt, which is not a high enough rating for 40A as that would need 8watt.
This is the resistor I looked at HERE and they are quite expensive to fry. I also looked at the 7watt version but they are all rated for maximum 22A.

Any advice appreciated.
 

OLIVE2222

Oct 2, 2011
690
Joined
Oct 2, 2011
Messages
690

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
@KrisBlueNZ:
Thanks for that - didn't know anything like that existed. I had a look and Farnell even stocks them at a reasonable price, but the only ones I found were rated for 25A although Allegro shows one for 75A, but in the detail it still says max 25A (unless I misunderstand the data sheet).

@OLIVE2222:
Thanks for that.
As far as non-intrusive is concerned, I already switch the supply.
They look like an easy solution, but are quite bulky (35x35mm).
Extrapolation does not quite work as there are many other parts that draw current: LEDs, GPS, Transmiiters/receivers, flight controller board, camera etc etc.
 

OLIVE2222

Oct 2, 2011
690
Joined
Oct 2, 2011
Messages
690
Current drawn by other parts are almost predictable, constant and should represent only few % of your total consumption. So up to 10 amp sensor on one motor to be multiplied by 4 in place of 40amp + the avionic current can make your life easier !
 

PAUL PRICE

Jun 25, 2014
1
Joined
Jun 25, 2014
Messages
1
upload_2014-6-25_1-41-9.png
You would do well to amplify this shunt voltage output with a LM358 op-amp setup for a gain of 20(if you are working with Vdd PIC=5V) to feed into the a2d of your PIC. By amplifying the current shunt voltage you greatly increase the resolution and therefore accuracy.
 
Last edited:

shumifan50

Jan 16, 2014
579
Joined
Jan 16, 2014
Messages
579
@Paul:
Thanks for that link, it really solves my problem quite nicely. At 40A that will be 0.8watt, well within the specs and the 40A is well below the rated current of 90A.

The amplification should be quite high as 40A will give a voltage drop of 20mV. I will use the internal 4V reference voltage of the PIC, so ideally I would like a gain of 200. This should be possible with a 741 opamp (I have lots of those) using 68K/330R resistors non-inverting giving a gain of 208 = max voltage of 20 * 208mV = 4.16V giving a resolution of 4mA or it might be better to leave some headroom and use 68k/680R dropping the resolution to 8mA but allowing up to 80A - this will not be workable for long periods as it will be 3.2watt and even at 0.8watt the graphs seem to show 'hotspots' of over 100C (I'm not sure exactly what this means but it seems hot for a PCB). As recommended I will use the PCB traces and the wires as a heatsink.

Note:I am no opamp expert, so the amplification will be trial and error - luckily I have several 741s too fry.
 
Top