Energy Final – 3/3

Things left to do today:

  1. program board with Timer
  2. buy Rockite, Epoxy
  3. epoxy solar panel and other electronics to interior of acrylic enclosure
  4. 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
  5. make several test concrete boxes before doing it for real
  6. 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.


  • 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.

The LED will start it’s journey toward brightness after Dusk Astronomical Twilight and begin it’s journey toward darkness after Dawn Astronomical Twilight.

However, AT occurs at different times at different months, and also depending on Daylight Savings.

Dusk AT:

  • Jan: 5:44pm – 6:17pm
  • July: 9:45pm – 10:37pm

Dawn AT:

  • Jan: 4:11pm – 4:50pm
  • July: 3:19am – 4:10am

Since I plan to have everything encased in concrete so as to be unable to access the components, I can only set the timing once, and it has to work with the day/night cycles of all seasons.

I will start the light at 8 pm and end it at 5am – that’s 9 hours. The lighting plan for the single Neopixel shall be as follows:

8pm-9pm: 0,0,0 – 10,10,10
9pm-10pm: 11,11,11 – 20,20,20
10pm-11pm: 21,21,21 – 30,30,30
11pm-12am: 31,31,31 – 40,40,40
12am-1am: 41,41,41 – 50,50,50
1am-2am: 50,50,50 – 41,41,41
2am-3am: 40,40,40 – 25,25,25
3am-4am: 24,24,24 – 10,10,10
4am-5am: 10,10,10 – 0,0,0

Referencing my earlier calculation of: 450 increments of 8S LowPower MCU shut-down per hour, the code shall be:









Energy / Final – Day 1


The battery and Solar Li-Po Charger

With three days to the Energy final my project has hit a major snag: the Li-Po is not supplying power to the arduino. The assumption was that when not recieving solar, the load would be powered by battery… assumption wrong.

After thinking that the Adafruit Solar Li-Po charger was not meant to be used from battery to load without the presence of solar, Roland helped me out by showing me that when connected to this massive 6000 mAh battery, current does indeed flow into the load even when a solar input is not included. He offered to let me use his battery for the final, but I declined since it was too big for my purposes. I would continue the original plan and go small. However, I did learn that a 1200 mAh Li-Po was too small to be used with the Adafruit charging board.

I went to Tinkersphere to buy a new 2400 mAh Li-Po, hoping that doubling the capacity would allow the charger to be used properly. This was a hypothesis that I hope would work. The 2400 mAh Li-Po was also too big for my design (it was very thin but too large in terms of surface area) so I had the idea of buying another 1200 mAh Li-Po and wiring it in parallel with my current Li-Po. I had no idea if it would work but it did… thank God!

Reducing the current draw to a bare minimum

Because I am designing this thing with the purpose of lasting forever, and because the board needed to be ON forever, I wanted the board and LED to draw the bare minimum amount of current.

The batteries (now 2400 mAh, instead of 1200 mAh) would start fully charged and be drained most at night and hopefully be recharged during the day.

Evolving Concept & Structure

My design was heavily influenced by Amitabh’s workshop on concrete, in which he showed how to encase acrylic and LEDs in a small concrete object. The combination of light and concrete: the juxtaposition of something soft and ephemeral with something very gritty and hard was a very esthetically pleasing mix.

My design originally was for a buddha, type statue, but I designed to scale down my ambition given the complexity of the project and time constrains. The complexity of the project is from the need to encase all those electronics: a solar panel, a Li-Po charging board, 2 Li-Po batteries, a Arduino Pro Mini, a Neopixel LED and a piece of acrylic for light form — that’s a lot of stuff.

I decided upon a simple concrete cube that collect solar during the day on one end and emits light at night on the other. The cube size would only be slightly bigger than the small Adafruit solar panel, which is just over 2 inches in length. The cube would then be 3″x3″x3″.

Safety of Encasing Batteries in Concrete

I was warned by Amitahb that it was potentially dangerous to enclose batteries in concrete, since the heating of the concrete while it was hardening could cause the batteries to explode. He also warned me there is also danger that the microscopic crystal needles poking out of concrete could puncture the battery itself and cause an explosion.

Further, I am told concrete expands

I no nothing of these matters so decided to take precautions by ensuring the concrete itself does not come into contact

Solar Project: One week of stats!

On Tuesday March 13, we met up to assemble and install our solar project on the east facing windows on the ITP floor.

There was some concern that the circuit wouldn’t work, because when we connected the circuit (the Adafruit solar panels, the power converter, and the MRK1000), it never really worked even with the direct indirect sunlight (i.e. sunlight reflected from windows of the nearby building). However, we assembled the circuit at the north-facing windows. See the spotty reception below:

We tried using some capacitors to mediate the charge build-up but to no avail. Finally, it was decided that since it had worked when we had shown the project during the class, that it would work again with direct (not indirect) sunlight. Thus, we found a suitable cardboard enclosure to put it all in, and secured it to the window.

To our satisfaction, the device started sending data to the server on MyDevices which Dan had made an account for. It has been tracking the data since we put it in.

On the data, it means:

Channel 0 means time
Channel 1 stats the battery level (which we am not sure we measured properly , because we are not using those pins to connect our solar panel.)
Channel 2 is sending 1 everything he can

Solar Energy Project (so far)

For our solar energy project, Marcha, Daniel & I are creating a solar-powered “status of Roland” program. What is that, you may ask?

Well quite simply, when we were gathering for our meeting last Saturday on the floor, Roland happened to be sitting with us and he basically offered unsolicited feedback on our ideas, to the point of discouraging hilarity. In other words, he shat on all our ideas (pardon my French).

In honour of this hilarious event, decided our program to operate like this:

  • when the solar panels reach the required power levels, it powers the MKR1000
  • Over wifi, the MKR1000 program communicates with a serve that displays an image of Roland with his thumbs up
  • when the solar panels do not reach the required power levels, the program will have Roland with his thumbs down

We will be using the shop’s Adafruit Medium 6V 2W solar panel, with its Li-Po charger.

What has been done:

  • We decided to not use a battery. Instead, we are relying on the power on/off of the board to run the program. This simplifies the circuit.
  • MKR1000 power measurements by multimeter:
    • without wifi: 20mA
    • with wifi: 120mA
    • (above calculations to be verified)
  • Solar panel when directly measured with multimeter (i.e. not through the Li-Po charger) is 5V but is unable to light an LED.

A Tangent that I Spent A Long Time On

  • I spent a lot of time on the question “how long can a 9V 200 mAh battery power a 3.3V 200mA board?” I couldn’t compute this.

Problem to be overcome:

  • Due to a combination of scheduling problems (most of us are available at times where we don’t have much light) as well as weather patterns (cloudy days, snowy days) we have not been able to experiment with the solar panel during times of ample daylight and thus our experimentation with the solar panel has been limited.
  • As a result we have not been able to get the MKR1000 running using just the sun.
  • We have not even been able to get an accurate reading of the solar panels Voltage or Current with direct sunlight
  • Daniel has set up the server through his knowledge of servers through his Networked Interactions class (thanks Daniel)

Next Steps

  • Next steps is:
    • come to ITP bright and early and take reading of solar panel with direct sunlight
    • build circuit to supply necessary voltage to MKR1000 without frying it (may have to use voltage regulator, given it’s operating capacity is 3.3V)
    • come in bright and early again and test the circuit in real time with real sunlight.