Jasper's car battery monitor using an Electric Imp

Updated 29-Jan-2014

Last week my 12 year old Saab 93 didn't start. Empty battery. Few days later again! I went to the garage, we checked the battery, we checked the alternator and if the car has some circuits staying awake at night draining the car's battery. We found nothing. But I didn't want to be surprised again. I wanted to be warned when the voltage falls below a threshold, so that I can start the engine and let the battery charge. That's when an Imp comes in very handy!

Hardware

I powered the Imp from 4xAA batteries because I didn't want to to drain the car's battery with the Imp. Some batteries have a large output impedance and cannot deliver the peak current when the Imp connects to WiFi. Therefore I added a 220uF electrolytic capacitor to Vin to create a low output impedance buffer of the battery voltage. I used two resistors (47k and 10k) as a voltage divider (1:5.7) to reduce the cars battery voltage below the 3V3 that the imp tolerates. I added a 1uF electrolytic capacitor to the analog pin (pin 9) to stabilize the voltage. Every 15 mins the Imp wakes from deep sleep, makes a Wi-Fi connection, sends the internal 3V3 voltage and the analog reading to the agent and goes back to deep sleep. This way the Imp can run from batteries for weeks. The agent calculates the battery voltage and sends it to Xively. In the Xively feed I created a trigger that calls an URL when the battery voltage falls below 12V. On Zapier.com I created a webhook (URL) that e-mails me when this URL is called. So when the voltage goes below 12V Xively calls an URL from Zapier that sends me an email.

Guess what? My car decided not to drain the battery anymore... Well, at least I learned about making the Imp low power and how to interact between Imp and Xively.

Device code

Agent code