Wednesday, June 10, 2015

Voltage on a Dying Car Battery

The battery on one of our cars is dying.  It has been since this past winter when my wife found herself unable to start the car, slightly upsetting her plans for the day. Being the data-nerd that I am, I wanted to see if I could capture the last gasps of this battery as the cold of the winter drove it to its end. I had a little flash memory chip I had never used and this seemed like a great opportunity to put it to use.  It was only 16 Mbit but recording binary value at a low data rate could stretch that out for at least a month.

Here were my design objectives:
  • Use the Atmel AT45DB161D 16 MBit flash memory I've had laying around unused.  This would involve writing my own serial interface code for hardware, something I had never done before.
  • Use a real-time clock (DS1307) to generate the timestamps for the data logging.
  • Log the temperature as well as the battery voltage to see what affects that may be having on the former.
  • If possible, figure out a way to log at high speeds while the car is starting to see how far the voltage depresses.

Below is the circuit I ended up implementing.

The blue PCB at the bottom is the DS1307 real-time clock module I purchased off of eBay.  The DS1307 is not the king of accurate time-keeping and over the month or so of data-logging the clock drifted ten or fifteen minutes.  This was completely acceptable for my work. There is some Arduino code out there designed to help compensate for this drift and maybe one day I'll try incorporating it.

On the left is the TMP36 temperature sensor, the workhorse of my previously implemented home temperature logging system.  Again, not super accurate and, again, close enough for my purposes.

Down in the right corner is the new flash memory chip I learned to use.  It took me too long and I made many, many mistakes trying to interface with it correctly. A logic analyzer would have saved me from hours of my mistakes and I may get something like the Bus Pirate before I undertake such a project again.

Part of my problem ended up being due to the Arduino clone I was using: the Ruggeduino. I don't know if there is something wrong with mine or if there is a design flaw but the SPI bus was not working with 100% accuracy.  Bits were getting flipped and as soon as I tested the circuit on a standard Arduino, it started working. I haven't dug into the problem so I have no definitely answers as to what exactly is wrong.  This is how superstitions get started.

The LED below the flash chip was used as a simple status light.  The switch next to that was used to trigger a high-speed-logging mode during engine starts.  I wanted to trigger this off the start relay but putting a lead on the relay prevented it from seating properly in its socket.  I messed with it for an hour with no luck so had to settle on the manual switch.  To trigger it, I would pop the hood, press the button, quickly close the hood and start the car.  Needless to say, there were only a few engine-start events that got logged.

Lastly, the voltage divider on the right was used to measure the battery voltage.


And now the results.

As you look at these graphs, note the time scale.  Each major division is one day and this is the car that my wife used for running errands.  The drive time hardly shows up at all; just a series of spikes in temperature and voltage (due to the alternator charging) followed by long decays in both.



There are a few points of interest to me.

  • The top graph shows a period when the car was unused for about three days.  You can see the temperature rise and fall a little each day following the ambient temperature in the garage.  The battery voltage on the car fell a few tenths of a volt over that time.  Since the car is unused, this is the open-circuit voltage of the battery which I think we would expect to be much closer to 13V, even in the cold.
  • The bottom two graphs do capture car start events (yeah!).  Both show battery voltage falling below 9V.  I don't have any idea how acceptable this is but it seems kind of low.  
My plan is to maybe do a little more testing, at least next winter and perhaps now in the hot summer to collect a bit more data.  Sometime this upcoming winter we'll replace the battery and I'll do more testing then to see how a fresh battery performs.

Friday, June 05, 2015

Mt.Rainer Camping Trip

Memorial Day weekend was our first camping trip since moving to Washington.  It was a west-side, wet-side trip, though the rain was mild and mostly overnight.  Compared to our friends who were camping with smaller children, our set-up was quaint and manageable.  One tent, cooking over the fire, dogs sleeping with us at night. Even with that, it filled our little SUV all the way up. If we do this again, we'll almost certainly have to use the car-top carrier.


A tree in our campground that looked like it had been felled very recently.




 Basil guarding the tent.



Volcanic-formed craziness seen near Mt. Rainer.



The best look at Mt. Rainer, as seen on the drive home.

Wednesday, June 03, 2015

Dragonfly

Hanging out on our fence, not too concerned about me getting VERY close for these pictures.