House battery frame and venting, Post 7
After completing the venting lid with it's exhaust hose and enclosed fans there was the question about how to control the fans. I didn't want the fans running all the time since they would just drain the battery. If my only charging system was the alternator then I could power them from the running van but I'm going to have solar so that wasn't the answer. How about having the fans run when the batteries were above a certain voltage that would show they were being charged. That wouldn't work either since the resting voltage of the batteries will probably change as they age and anyway I'm not sure of the voltage level put out by the solar charger and how it will fluctuate with the sun.
I'm no expert on electronics but I have dabbled in them before so I went to
Digikey and started searching around for something that might be used with a charging battery. I found the
Maxim MAX4376. If I was reading it's datasheet correctly it might work. So ordered a couple.
Ran into the first problem. Here is a MAX4376 sitting on a penny. It's a really small surface component chip. Never messed with these before. Don't think I'll be able to solder on something that small.
So started searching online. Found a way to solder something this small. It involves solder paste and a electric skillet. So order some solder paste. The paste comes shipped with a ice pack to keep it cold so you store it in the fridge.
Also ordered a small circuit board that is made for this style chip. Put the paste on the circuit board pads then place the chip legs on top of the paste.
I used a dental pick to clean off the excess paste after taking the picture.
Next get an old electric skillet.
The paste has a specific temperature versus time profile you're supposed to follow. Took me two tries to get it right.
It works. Here's the chip soldered into place.
The circuit board is big enough for me to solder pins through the eight holes and use on a breadboard.
Here is my test rig. I have both a load on the battery and a charger connected.
I've got the chip mounted on a breadboard and connected to the battery via a sensing resistor as recommended in the datasheet.
When the battery is under load but not charging the MAX4376 outputs a signal of .008 volts.
When charging the signal jumps to .021 volts. This value changes as the current into the battery changes. The signal voltage range can be changed with a different sensing resistor.
OK now that I have these value what do I do with them. Well I always wanted to learn about microcontrollers so these seems as good a time as any.
Here's the microcontroller I decided to learn on. It's an Atmel
ATMEGA168P-20PU. A microcontroller is like a limited function computer. So a computer for $4.85 is a pretty good deal.
The low price is the good news. What's the bad news? The fact that I knew next to nothing on the subject of microcontrollers. At the beginning of the battery venting project I talked about hitting a slow patch. Well this is it. I had to learn a new whole subject. Here is a picture of all the manuals/info/tutorials I downloaded off the internet and printed.
I won't say I've read everything in this stack but I've read most of it. And some of it more than once. This took weeks and weeks. I won't go into much detail about how microcontrollers work since this post is already pretty boring by now. Basically you write a computer program and load it into the microcontroller which tells it what to do then test it. If it doesn't work like expected you change the program and load it into the microcontroller again and see if it works. It can be very tedious so patience is required.
I'm writing the program in assembler language which is a type of computer code. I had a class in it once a long long time ago, back when dinosaurs ruled the earth, so that helped a little. By the way if you've seen the first "Terminator" movie you've seen assembler code. It's what scrolling up the screen when you see the world through the Terminator's eyes. "Hey, buddy. You got a dead cat in there, or what?"
So I built a circuit on the breadboard that includes the microcontroller.
Add it to the rig and start testing it. After much work I got it to do what I want.
Here's a simplified version of what the microcontroller does in this setup.
Every 30 seconds check the output from the MAX4376 chip. Decide if the battery is charging. If it is then make sure the fans are on and functioning OK. Sound an alarm if there is a fan problem. When the battery stops charging run the fans for 5 more minutes so to be sure to purge any gas from the vent lid.
There's more to it than that but if anyone is interested in the gritty details they can PM me. If this one application was the only use I had for microcontrollers then this would have been overkill for just the vent fans but there a several different projects I have in mind. This just gave me a good excuse to finally buckle down and tackle the subject.
Haven't built the final version of the circuit board that incorporates everything yet but I'm far enough along to be sure I can get it done. It won't be needed until I can get the house batteries charging system in place. So I'll stop posting on the battery venting project until then. Next posting I start on something else.