Auto Shutoff

One thing that’s been bothering me for the last couple of months is the cost of the batteries.  They’re not cheap and they can be easily damaged if you let their voltage drop too low.  That’s the main reason that I added the voltage monitoring to the member heartbeat message was so that I could watch it on the iPhone.  I added some code to shut the lights down if the voltage drops too low.  What I didn’t realize is that even with the lights off, the Arduino’s voltage regulator is eating up a fair amount of current.  We accidentally left a couple of batteries connected for a couple of days. Killed the batteries and I ended up with two expensive, explosive bricks.

So the idea was to find away of shutting power to the whole system in some way.  Randy helped me work through some ideas of how to do this with MOSFETs that would use an output pin from the Arduino to control the battery’s access to the circuit.  There would be a power up momentary button that you would hold down until the Arduino had a chance to boot up and set the power up pin connected to the MOSFET.  Once the Arduino detected an under voltage, it would set the pin low, thereby cutting off power to itself (suicide).

We tried to do it ourselves but were having trouble with current being drawn from the pin and causing the MOSFET to power up.  He found this.  We were missing a second MOSFET that helps isolate the Arduino.  Quick trip to Fry’s to get a p-channel MOSFET and we were in business.  In the video, you’ll see that the button press starts up the Arduino.  The power pin status is shown by the yellow on board LED.  Once that LED lights up I can let go of the switch and the system stays on.  After 5 seconds the program sets that pin low and the system shuts down.  Now to test it with the larger system.

 

Leave a Reply

Your email address will not be published. Required fields are marked *