Solar Power / Raspberry Pi / Arduino – Glitches in the Sun

Solar Power RasPiConnect
RasPiConnect Control Panel on Project Curacao Battery Subsystem - Annotated

Solar Power and The Raspberry Pi – Update on Project Curacao and the Latest Glitch

A major glitch in the Project Curacao Solar Power control system happened last week, detected by my trusty friend the RasPiConnect Control Panel.  The Solar Power system is working excellently providing full charges to both the Raspberry Pi but the Monitoring and debugging the system from 3,500 miles away is not getting any easier.    When I designed Project Curacao, I spent a lot of time thinking about what might happen and how I could work around issues. So far, I seem to have made pretty good decisions, but a bad one I did make is coming back to haunt me. The issue is with the Battery WatchDog Arduino. It is supposed to run all the time and never need to be rebooted.  The issue

Solar Power RasPiConnect
RasPiConnect Control Panel on Project Curacao Battery Subsystem – Annotated

revolves around the DS1307 Real Time Clock connected via the I2C bus to the Arduino.  The DS1307 is flaky.  Because I sleep the Arduino about 70% of the time to save power, the Arduino Battery Watchdog is completely dependent on reading the DS1307 when it wakes up to set the time.  Here is more on the DS1307 Problem on Project Curacao.

These screen shots are taken from the RasPiConnect based Project Curacao Control Panel.

Solar Power RasPiConnect
Project Curacao Arduino Power RasPiConnect Control Panel

If the Arduino does not know what time it is, all heck breaks loose in the system and it starts behaving very strangely.  It sometimes just sets the time wrong when the DS1307 glitches, but it can set itself to an illegal date which can kill the Arduino.  In this case, the Arduino came up, but at the wrong time.  I received an email saying that the Raspberry Pi was rebooting and so I quickly logged in and set the current time on the DS1307 via a serial link to the Arduino from the Raspberry Pi.  Whew!

If it comes up with an illegal date, I’m screwed.  I can’t do anything about it.  Aside from begging friends to come to the isolated location on the island and hitting the reset switch.

I know that the DS1307 was losing it because of the log from the Arduino, shown here

Solar Power DS1307
Arudino DS1307 RTC Starts to Lose It

from the main summary screen from the Project Curacao RasPiConnect Control Panel.

Deadman Switch

I’m heading down on a maintenence trip at the end of September, and I’m going to fix this problem by replacing the DS1307 with a DS3132 RTC and putting in a Deadman Switch on the Arduino Battery Watchdog (consisting of two 555 timers to generate a set of pulses to reset the power on the Arduino – more on the Deadman Switch next week).

Solar Power
Arduino and Raspberry Pi Power Subsystem

I wrote about the need for a Deadman Switch in this design so I could reboot the Arduino remotely and by a watchdog circuit.  I ran out of time to build the Deadman Switch before I had to transport and install the system (last March, 2014) and now I am regretting that decision. I can order remote boots of the Pi and the Arduino BatteryWatchdog reboots the Pi on a daily basis (according to a variety of  power and wakeup states).  The block diagram for the over all Project Curacao power subsystem shows where the Battery Watchdog  is located in the system.

I will be watching this Solar Powered system in the next week very closely.