Thought I'd ask for some suggestions on circuits that amplify the tiny voltage drop across a current shunt - enough to make it readable in a data logger. I've been fussing about with op-amps to amplify the signal but if there's a better way I'd appreciate a few hints! Anyone who's already tackled the problem may not need the explanation below, but I thought I'd just tell the whole story and maybe others can learn with me.
Starting at the beginning:
The data logger I'm using now has a problem measuring current. Not a fatal problem, but I want more reliability than it can now provide. The microcontroller in the data logger isn't sensitive enough to read the changes in voltage on a normal shunt - the mV voltage drop across a shunt will throw an ammeter needle to full swing - but barely count a couple of data points on the microcontroller. The solution has been to use a shunt with about ~0.1 Ohm resistance - basically a home-made resistor. Shunts typically have resistance of milliOhms. Using a much higher resistance gives my datalogger the amplification it needs to be able to read the voltge drop. This "resistor" is also sensitive to ambient temperature and being home-made, it probably suffers from variable resistance in the screw terminals. Basically I can pretend I'm logging good data but I don't fool myself for long. The other problem with the datalogger is that it needs a "low-side shunt". I prefer a properly grounded system.
I was working on a re-design of my datalogger, adding a few features, and then I came around to the problem of reading a shunt. I need to pick up those few mV across the shunt, and amplifying them somehow so that the PIC microcontroller can read the difference in a meaningful way.
The PIC can convert an analog signal between 0-5V into a digital number between 0 and 1024. From what I've seen it's a linear relationship so 2.5V = #512 and so on. The input voltage has to go up by about 5 mV to make the number tick up from #512 to #513. But as I just pointed out, a shunt doesn't need to drop voltage much to make an ammeter needle swing, only a few mV, so the entire range of current (say 0A - 50A) will only take up a handful of data points from the PIC's point of view.
To use all those data points in the PIC, I need to amplify the signal. By a factor of 100 or so. My idea so far has led me to op-amps, but I'm not finding circuit designs that do what I want. I've also tried to develop my own op-amp circuits, capable of reading the voltage across the shunt and amplifying it, but the all come out VERY twitchy. Breathe wrong on a trim potentiometer and the gain shoots up or down.
I'd share a circuit diagram but I'm afraid to display the depth of my ignorance! Instead I'll try to summarize the numbers I'm trying to work with:
Battery voltage = 24-28V (normal range to expect)
Absolute maximum Volt = 32 V (to not fry the electronics)
Practical minimum Volt = 24 V (doesn't have to be accurate below this)
Range of current to read = 0-40A (accurately +/- 0.1 or 0.2 Amperes)
Maximum current to read = 50A (safe limit)
Shunt 0-50A @ 0-50mV (some typical part that can be found easily)
Datalogger Inputs:
1 Battery voltage (eg 28V)
2 Shunt high-side voltage (eg 28.05V to detect 50 Amps)
3,4,5 wind speed, RPM, etc., etc.
The PIC microcontroller can only work up to its Vcc (5V or so) so this defines the range that must be targeted by the amplifier. Ideally, the amplifier would send out a 0v signal when there is not current, and the PIC will read it as #0. Then as current increases (say 20A) then the amplifier spits out a voltge of 2.0V and the PIC will get about #256 or so, on up to 50A through the shunt and the amplifier's output has risen to a maximum of 5V and the PIC input reads #1024.
The circuit I've designed runs the battery voltage through a 1:5 voltage divider for reference (about 4.5V) and the shunt high-side voltage through a similar divider that I can calibrate with a potentiometer. Because of the stepped-down voltages even the voltage drop across the shunt is reduced. This is where I seem to be having problems with the op amp because the input differential is too small to calibrate. Amplified 100X the shunt can sweep from, say 2.5V to 4.5V but only if I get the components JUST PERFECT. No 2% tolerance allowed. More like 0.1%...
Is there a better way?