Not finished yet and there’s still software to cobble together when it is. I’ve had a bit of time today and made some progress with the LCD shield – well, it’s done which counts as “some progress” in my book.
The LCD (16 pins) attaches to the middle row on the upper half of the “shield”. There’s room for a trim pot on the top right (you can see the +5V, GND and the wiper output going to where the contrast pin of the LCD will be). Right next to that there’s a 3K3R for connection to an LM285 voltage reference diode which delivers 1.235V to the AREF pin of the Uno (upper orange wire).
At the bottom right of the board there are a couple of voltage dividers for the load voltage and (even though it’s not needed in this case) for the voltage that is controlling the current.
I’ve done some more tests and I really was getting screwy results on the breadboard. Everything seems to be working as it should and 1mV => 1mA of load. That’s really comforting to know because I was fairly sure my op amps weren’t that crap and that I’d put Dave Jones’ circuit together properly.
I’ve had a few other thoughts so this isn’t done yet – here’s what it looks like though:
So, what’s still to do? Well, sensing the load voltage for one thing and, if it’s a li-ion battery then turning the load off when the voltage gets to 3V0 to prevent any problems. I’m planning to (mostly) use battery protection circuits but they allow the battery to drop to 2V5 and, of course, I might forget.
How do we turn it off? Well, pin 5 of the op amp on the board above is the key. If that pin is pulled to ground then the voltage at the resistor is zero and no current can flow. That’s also where I need to measure the circuit voltage so I can display what current load is set.
I can use an NPN transistor to pull pin 5 to ground, there are plenty of pins left on the Uno to do that and it’s fairly straightforward. The transistor will easily squeeze in at the bottom left on the white proto board.
Measuring the circuit voltage is much more interesting. If I connected pin 5 direct to one of my voltage dividers (or just to an Uno analog pin) then current would flow and the voltage would change causing the current to change. I don’t really want that to happen and the way to avoid that is staring right at us in the picture above!
It needs another op amp, configured as a buffer just like pins 1-3 of the op amp already used. Since no current flows at the input doing this won’t change the voltage I need to measure and therefore won’t change the dummy load current. The same applies to battery voltage so I may as well do the same with that as I only have the TS-358 dual op amp chips.
Slight problem, there’s nowhere to put it! So, it looks like a “dead bug” solution will be needed. I’ve also decided to bypass the voltage divider and just read the circuit voltage directly – it’s always in range for the way this circuit is configured.
So, not much left to do once this is out of the way. Just the software…