Maybe this might help? http://www.picbasic.co.uk/forum/showthread.php?t=16387 Best, Ed
Maybe this might help? http://www.picbasic.co.uk/forum/showthread.php?t=16387 Best, Ed
Yes interesting chip, that'll do nicely for the large current version.
Finally success with the 'current' routine.
I've been completely puzzled by the readings and results so I rewrote the code just to get the adc counts.
The adc count for the current input mirrored the current output of the unit. Great, now just alter the code again and run.
Hmm no joy, it was out again by a long way. So I isolated the code to study the routine, no it was correct. Then I wondered why the routine should be so far out from the count. Logic said it wasn't the count but something else. So I checked the defines. Argh, the ADC osc had been commented out and I had another oscon0 that set it at 8Mhz.
Changed the adc back to internal rc osc and the routine now worked.
Regarding the 0.47 ohm resistor.
As it's in the ground leg am I not correct in thinking the power rating is different, as it's current is say, 1amp, but it's the voltage drop across the resistor that counts which is in mV.
Put it this way with real world on the board. On the positive output it ran quite warm at 1amp. In the ground leg it is still cold at 1amp.
It doesn't matter whether the resistor is 'in line' with the 12V supply wire ....or inline with return to ground wire....the same current will be present (the current leaves the charger, goes through the battery & returns to the charger's negative reference .....one current path if you like)
If it was hot before & it isn't now, then that can only mean one of three things...
1. You had more than 1A running through the resistor in its original position.
2. You've not got 1A running through the resistor in it present/new position (what does a DVM say the voltage drop is) ....at 1A through a 0.47R resistor, should see a voltage drop across the resistor of 470mV. You've got 470mW being disppated across the resistor...which I reckon should be warm to touch.
3. You somehow connected the resistor in situ wrong....it should sit between the negative return wire from the battery & the circuit's 0V reference.
Thanks for your parience Hank. Sometimes I wonder where my head is. I know all this, but I've been in a blank place since having the head cold, amazing how I can't think straight.
As for the heat, I realised later that the .1 was in series with regulator which runs quite hot, there was heat transfer. The .47 is in the ground leg which is nowhere near the reg.
The unit is running fine now and the basic (sic) software works, now I need to add the frills such as logging to eeprom, temperature compensation etc.
For the larger unit I have in mind making it multi battery, nicad, nimh etc. with menu choices.
OK I've given up on this board and I'm going to design my own and start again. There's something peculiar happening with it. I had it working just fine and left it to one side running but not connected to the test battery for a while. I was busy on the bench making up a temperature and memory board.
Later I connected the test battery and nothing happened to the current but the output was suddenly 7.9v ?? So I disconnected it, switched off and then tried again a minute or so later. It powered up fine gave the correct output but now the current routine was way off. I checked against a multimeter.
I suspect the LM317 is playing up.
On another tack, this months (June) QST has an interesting article on carrying batteries in a cooler box. What interested me was the authors use of a steel 3/16th (4mm) setscrew to make a high current shunt.
He used nuts and wire tags to make the shunt and calibrated against a multimeter by adjusting the nuts along the thread length till he got it correct. At the head end he used two nuts to clamp two tags tight, then at about 1 inch (25mm) he used two nuts again to clamp two tags. This end he screwed along the thread length to get the right reading. Quite novel.
Pic added with acknowledgemen to QST.
Last edited by tasmod; - 30th June 2012 at 09:07. Reason: Pic added
Hi Rob,
The link I gave you accurately measures the current from .02 amp upto 70 amps and using the ACS758 takes care of the shunt resistor as it is part of the device. The program gives you the actual current as a digital number you can use for anything you wish as well as the voltage. http://www.picbasic.co.uk/forum/showthread.php?t=16387 Best, Ed
Bookmarks