Energy Final – 3/3

epoxy solar panel and other electronics to interior of acrylic enclosure

make wooden 3.5″x3.5″x3.5″ box, and smaller box inside from cardboard to prototype how the pouring around the acrylic enclosure will be like

make several test concrete boxes before doing it for real

Do it for real

Programming Board w/ Timer

The key thing for me to find out today is how using the Low Power library messes with the timing of the MCU. I know that the low power works by shutting the MCU off for several seconds. From this site, I learned about Rocketscream Electronic’s LowPower library.

I started by using the blink sketch, but using:

LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

instead of the “delay(1000);” of the traditional blink sketch. Using my phone timer, I see that it does indeed cause a delay of approx 8-8.5 seconds. (Probably in imperfect reflexes for timing it o my phone).

I also confirmed that:

LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

leads to a delay of approx 16.5-17 seconds.

This means I will need to build in this 8 second delay into my sketch.

Calculations:

60 seconds / 8 seconds = 7.5 increments of 8S per minute

7.5 x 60 minutes = 450 increments of 8S per hour

450 x 12 hours = 5400 increments of 8S per 12 hours

which means a delay of 12 hours can be written as:

for (int x=0; x<5400; x++) {

LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

}

To test this I will delay for one minute, which by my calculations, should be a loop of 7.5 so that:

for (int x=0; x<7; x++) {

LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

}

is about 59 seconds. (I couldn’t put 7.5 on a loop).

Using the Low Power library also means I cannot rely on the WDT (Watchdog Timer) for tracking time. Which means, I’ll have to do this purely using the 8S delay.

LED Light Plan for Dark Hours

Using the following graphic from TimeandDate, there are three phases of “getting dark” before it’s considered night: civil twilight, nautical twilight and astronomical twilight. Astronomical Twilight (AT) occurs when the Sun is between 12 degrees and 18 degrees below the horizon, when the sky is still dark but a faint change in light colour can be seen.