It can even connect to a PC and give you a full "Data-sheet" graph of the discharge and total capacity.
Note that this is my first Arduino project (I am not counting my "blink LED").
Remove these ads by
Signing UpStep 1This is what you can get at the end...(just to get you interested)
| « Previous Step | Download PDFView All Steps | Next Step » |



















































But I would gain hours to get these curves for four batteries at the same time. Do you think it is possible to modify it this way?
fixed the code after a long night. i can get the setup to start up and the lcd turns on. it will then pick up what type of battery is connected and will measure the voltage and current of the battery, but the led wont illuminate which leads me to believe the mosfet is not switching on. im using a irf540a with a rds on of .052 ohms. any ideas?
Ive been using a 1.3v 1200mah AA rechargeable battery nimh.
any ideas?
thanks
i copied the code above directly into ardunio 0022 program. i have the duemilanove clone.
it comes up with the following errors:
dunkbat.cpp:3:10: error: #include expects "FILENAME" or
dunkbat:3: error: 'LiquidCrystal' does not name a type
dunkbat.cpp: In function 'void CL2()':
dunkbat:23: error: 'lcd' was not declared in this scope
dunkbat.cpp: In function 'void setup()':
dunkbat:31: error: 'lcd' was not declared in this scope
dunkbat.cpp: In function 'void loop()':
dunkbat:76: error: 'lcd' was not declared in this scope
dunkbat:99: error: 'lcd' was not declared in this scope
any ideas im a complete noob
thanks
paul
This is because the include file is not mentioned at the start. if you do: Sketch> Import Library>liquidcrystal , it will add the necessary header file to the sketch and compile correctly.
The FET voltage terminal is seems don't have connection to the drain circuit, how it's can give analog input (FET voltage) to arduino?
its a fantastic circuit and ive started to build it. have you by any chance got a higher resolution of the diagram above i cant zoom in enough? thanks
Isn't that the power of Instructables?
Pin "fetVoltage[plus]" on discharge circuit is left floating around. Could you confirm this? Thanks for great work anyway.
i will then alter it to work with 36v 14ah lithium polymer batteries somehow :-) if you have any ideas that would be great
$ diff my.cpp orig.cpp
7,8c8,9
< int ledPin = 8; // select the pin for the LED
< int SPKPin = 9;
---
> int ledPin = 13; // select the pin for the LED
> int SPKPin = 6;
18c19
< int FetVoltage = 0;
---
> int FetVoltage = 5000;
66,67d66
< Serial.print("\t");
< Serial.print("Capacity[mAH]");
75c74
< if ( (BatVoltage-FetVoltage) > SelectedMinThreshold && !done) {
---
> if (BatVoltage > SelectedMinThreshold && !done) {
86c85
< TotalCurrent=TotalCurrent+MillisPassed/1000*(BatVoltage-FetVoltage)/10/3.6;
---
> TotalCurrent=TotalCurrent+MillisPassed/1000*(BatVoltage-FetVoltage)/2.2/3.6;
98,99d96
< Serial.print("\t"); // prints a tab
< Serial.print(TotalCurrent/1000);
Should this statement:
"if (BatVoltage > SelectedMinThreshold && !done) {"
be replaced with this:
"if ( (BatVoltage-FetVoltage) > SelectedMinThreshold && !done) {"
Thanks for the great instructable. I just finished building your design!
It has been a while a go and I dont remember exactly but as far as I do I connected two points on the battery as the voltage on the Bat is the difference between them (or was that over the resistor) .
Pls check if the voltage is not clearly just over the battery - If I got it wrong then there may have been a mistake yet the voltage drop over a good FET (< 40mohm) could be neglected- o that may be the reason .
TotalCurrent=TotalCurrent+MillisPassed/1000*(BatVoltage-FetVoltage)/2.2/3.6;
Copy paste into excel and make a graph for it .
I would like very much to build this, but can you please clarify some aspects.
Do you use one or two connections to the arduino, because in the schematic you only draw one (on pin 19), and in the code you mention pin 23
"int sensorPin = 0; // select the input pin for the potentiometer (pin 23)
int sensor2Pin = 2; // select the input pin for the potentiometer (pin 23)"
and what is the potentiometer ?
In short i don't understand what pin of the arduino i connect where.
Thank you.
Sorry for the late response ,
I don't really remember so much but I tried to review the code .
I used the ledpin as the output pin (all ground must be connected) . The ledpin activates the FET and thus the load .
There might be some mixup between the pins in the code and in the comments because I decided to make my own arduino (ot use the purchased board) and thus indicated the physical (chip) pin in the comments (and I did a copy paste mistake in the two lines of the sensors).
In any case I used two pins for sensing the voltage across the resistor . the difference if the voltage drop on the load resistor and when you divide this by the resistance you get the current flow .
I hope this helped .
But because you did it in a haste there are things uncleat.
So preety please :) can you post some answers from time to time.
Don't let us hang.
when I have old electronics I take a torch and burn the back side very well - then when all solder is solf I hit it many times on the other sides and the components just fall off . I colect and sotrt them (Just did it with an old TV set) .
The when I need a FET or any other components I just search the net for the PNs on the components and take whatever is best suited .
So back to your question - you can use almost any FET that can withstand the current (most will do the job .. you need low impedance .. check out their DS from the net)
good luck .
I would love to see your instructable - pls post it when you are done.
I was thinking of adding charging capability to it but after finding a micro controller multi charger for 35$ I decided to just buy it ....
I don't think it tests for the actual capacity .. I should get it soon from Ebay
The schematics is real simple and is based on the original Arduino Delicima and then just a fet with a load .. tx rx from arduino to pc (you actualy only need tx) and you get a clear table for excel.
post you project when you are done!
good luck.
1. The 4-8 mili Ohm is approximately the "on" resistance of the FET - use an N channel FET any kind you find (try Wikipedia for info on FETs if you don't know what they are .... basically it is an electronic switch with low resistance).
2. all Arduinos have a reset Switch used to restart the device / program it . if you are not familiar with Arduino - pls go to the web page I placed in the article . I can't pass 2 weeks of learning in a sentence - you must o the web page and read about it - what it does and how .
3. I just used a led to indicate when the FET is "ON" with a resistor in series so not to over load it (1K ohm will do the trick).
4. to connect an LCD you need to use the library in the Arduino (see SW include file) . you can find all the info and an example on the Arduino web page .
I hope I helped - I know not completely but I can't copy all Arduino site here .
I hope you understand.
just a simple question. :-)
What for is division with 3.6 in this formula ?
TotalCurrent=TotalCurrent+MillisPassed/1000*(BatVoltage-FetVoltage)/2.2/3.6;
3.6 is 3600 seconds (an hour) 60x 60 - I put 3.6 due to removing 1000 from the (what do you call the upper part divisor divider .. whatever)
:-)
Anyway, here is one very instructive site releted to battery charging/recharging.
I learned a lot especially from schematic part of the project. :-)
www.avr-asm-tutorial.net/akkuload/en/index.html