Im building a battery charger to form home built Plante style lead acid batteries.
these type batteries can last a very long time but the active material needs to be formed on the plates, not just pasted on them like your common lead acid battery.
I have a good working model with good capacity but it takes a long time to form the plates.
one of the issues is having to manually charge and discharge and then reverse charge the batteries.
So I want to make a controller that will automate this for me.
I have attached a diagram that I created for the processes I would like the controller to perform.
I have been learning how to program the Arduino and I'm getting the basics but it would be a huge help if anyone here might know of any other similar sketches I can use to look at (and learn off) to help me build a sketch?
Also any other help or ideas would be appreciated.
Although I haven't checked the logic of your diagram it certainly seems that it is logical and that you have all the steps thought out.
I would now say, can you identify certain steps in that diagram that are self-contained, so that you can develop these in isolation, test them and forget them? This stops the huge monolithic program we sometimes see here that would be almost impossible to test, maintain and develop further.
So your loop() would then call any number of logical functions (not individual steps, functional steps made up of further [individual] steps). So, 'readReverseBatteryPolarity()' might be a logical function (just suggesting, don't take this as gospel) that does whatever it needs to in order to return the reverse battery polarity - your loop() doesn't care how that is achieved, merely that a reply comes back that you can use.
One small caveat; as you are dealing with reverse voltages here, just be sure you don't connect a negative voltage to any of the Arduino pins, that would be an expensive mistake :o
Also, connecting to a 20 x 4 (or even a 16 x 2) LCD (via I2C - two wires plus power) whilst you are doing all this would enable you to debug more quickly rather than constantly relying on the debug window (Serial Monitor) with umpteen messages coming up - OK to start with but it will get pretty busy going forwards.
I have a good working model with good capacity but it takes a long time to form the plates.
one of the issues is having to manually charge and discharge and then reverse charge the batteries.
Can you provide a link to info on how to charge these batteries?
Hi Ralph,
Yes i think i can possibly break up the program into 3 or 4 basic functions to run and test them . I think i will use my diagram with the // as a base to attach the code to each operation to help me keep track of it because i will likely forget what each section is. being new to programing Arduino it doesn't feel like a native language so i have to keep cross referencing it with the basic steps in my flow chart so that don't lose track of the c+ gibberish lol.
Keeping things in separate functions and then calling upon them when required suits me because i like the kiss theory.
(now just to learn how to call on individual functions) I have read how to do this but will have to go over it again, only so much can sink in in one go
As per the reverse Voltages, wont it just show 0 out of 1024 if the voltage is negative and under 5v ?
I had tried this with a single AA Battery and it showed 0 at reverse polarity and from memory about 320 which was about 1.55 V. Probably a newb thing to do lol, but haven't killed it yet.
I would like to use a LCD to debug the sketch but unfortunately getting a relay to switch on and off when required is hard enough for me with out trying to display whats going on is probably above me capability. (ATM)
, unless i just have to load a library and wire it up? though i haven't learned how to to that yet.
Hey Tom,
I don have a link on how to charge these cells because most of what i know is what i have worked out form trial and error, there isn't much available on-line. i think there is a book you can buy with some of this information but i haven't read it. once formed they can charge like a regular lead acid battery.
They are not as fussy as your standard battery they can charge at twice the voltage for the majority of the charge and have no adverse effects or gassing,due to the low resistance of the lead/lead plates they just soak up them extra electrons with out gassing (depending on current of course).
My cells are single 2v so thats what I'm basing the charger on, tho the sketch should be easy to change if i connect more cells to form a battery and add a voltage divider.
I'll post an update of some of my basic code soon to get a hand to fill the blanks.
Hi,
Can you post a picture of your battery please?
Also any part/model/manufacturer markings you can find.
Googling just brings up standard lead acid batteries.
The reverse charge cycle has me asking questions. Do you mean discharge or forcing a charge into the battery the wrong way?
There is only a couple of companies that i know of that are producing Plante batteries.
Thats not my battery as i am making my own style of this, mine is similar concept.
yes it sounds weird but i am actually are putting current into the battery in the reverse direction.
Each time i do this it increases the capacity by converting led into led peroxide and then back to solid led again. only the led doesn't deposit the same but forms a kind of sponge lead with a higher surface area.
thats the reason why they last so long because the lead is transfered back and forth from the positive to the negative and vice versa. they also have a very good efficiency of over 90% and dosent let the sulfation build up.
though the ones that Exide make generally aren't charged in reverse buy the customer, only in the forming (manufacturing) process.
Though mine will eventually be set up so they automatically switch over to another bank while the other bank is discharging . so i can use 100% DOD of each bank. but this will come later
So I have had a go at a few different ways of trying to write this sketch but being a total noob its a lot to take in.
I have decided I will make it simple as possible and then add to it later.
so this far I have some very basic lines of code but how do i make it wait until each line is complete before going on to the next part?
Ive attached the sketch or should i cut and paste the code here?
To detect the battery polarity, rather than seeing if a0 was > .2, would it work better to check both A0 and A1? If they are both < .2v, then the sketch can't determine which way to charge.
Perhaps a 3-position switch might be the go: left/right/auto.
Does this thing just sit there going charge/discharge forever? When do you take the battery out of the thing? After one cycle? when the operator presses a button? Or do you just turn the whole thing off?
Or perhaps it doesn't matter. The operator just watches the voltage indicator and pulls out the battery when it's correct. But doesn't this mean you need a "test" button to tempoarily disconnect the charger so that the current voltage can be read?
At present, there's no provision in the sketch for removing one battery and putting another one in - you'd have to turn it off.
You are aware that input on analog pins works with a reference voltage of +5v, and that some boards are 3.3v? You say "when voltage is >2.2v". Does this mean "when the input on A0 (or A1) is > 450" ?
Ok, dude. First cut of the sketch is available at github
I HAVE NOT TESTED THIS AT ALL YET. I'm going to need a couple of potentiometers to simulate the voltage readers. At present, without anything plugged into the arduino it goes immediately into the "error" state - which is actually rather promising .
I have been playing around with designing simple 2v cells. easy to make too.
So far my latest design is producing 3 Ah with 2 4'' x4'' plates
not bad as its hasn't been cycled properly yet. My initial design was only at a measly .2 ah for the same size plates after cycling hundreds of times, so making good progress I think.
Hi Paul thanks heaps for your help. Ill try to clarify some thing for you
PaulMurrayCbr:
To detect the battery polarity, rather than seeing if a0 was > .2, would it work better to check both A0 and A1? If they are both < .2v,
as far as detecting the voltage goes your idea would work great. I think i just went with my original way because i beleaved it would be easier for me to work out the sketch that way.
Perhaps a 3-position switch might be the go: left/right/auto.
Its probably not necessary because if its on auto it would always do what it is meant to do
Does this thing just sit there going charge/discharge forever?
Well actually it does lol.
Because the charger is designed to form the surface on the plates by charging and discharging and reverse charging so more it happens the bigger the capacity of the battery will be. not like a normal lead acid the more cycles actually decrease the capacity of the battery and life. though once the battery has reached the desired amp hour rating it can be taken out of the system or set to only reverse charge the battery once the energy has been used so cycling maybe only once per day. though I might look at changing it to do this later.
Or perhaps it doesn't matter. The operator just watches the voltage indicator and pulls out the battery when it's correct. But doesn't this mean you need a "test" button to temporarily disconnect the charger so that the current voltage can be read?
Oh i see what you mean here, well we could actually incorporate a switch or button that will stop the process at the next full charge state. (ready to be used) then it can be automatically started again once it hits the low voltage threshold. or just ad it latter. I don want to over complicate things to early.
You are aware that input on analog pins works with a reference voltage of +5v, and that some boards are 3.3v? You say "when voltage is >2.2v". Does this mean "when the input on A0 (or A1) is > 450" ?
Yeah i worked this out. so the 5v signal is divided up into 1024 bits, is that right?
I HAVE NOT TESTED THIS AT ALL YET. I'm going to need a couple of potentiometers to simulate the voltage readers. At present, without anything plugged into the arduino it goes immediately into the "error" state - which is actually rather promising .
Nice, Ill Check it out. I already have a couple of pots already set up on a bread board. I was using it to play around with my first try at writing a sketch. i was able to get the led to turn on a and off at an intermediate voltages but then it started to get a bit too technical for my limited understanding trying to get it to perform the different steps.
Righto, Had a chance to stick some pins in a chunk of bread board to test this crazy contraption out
and I must say Paul your a gun! sure enough worked perfectly first go, not that i doubted you for one second lol.
I installed a few leds on the relay pins to see what it was doing and when I adjust the voltage with the potentiometers it changes states from charge> test> discharge> reverse charge> charge again. (Perfect, although it sounds crazy charging flat battery backwards)
So glad you could help me out with this Paul, id have been there for weeks and still not have finished. PS check your paypal account