Main Content

This project is a follow up of the Illuminated Presents project that I posted earlier. My wife really liked the Illuminated Presents but kept them as Cubes and did not put a bow around it to turn them into presents. Because of this success I created a second one – called Illuminate Cubes since that is what they are – but now using different Cube sizes.

This version has the same functions as the previous project:

Control 2 Cubes at the same time using one PIC12F617 microcontroller. The microcontroller software was written in the JAL programming language
Switch the Cubes on and off using a push button
Randomly change the color of the Cubes by fade-in and fade-out of the colors red and green
Switch off the Cubes when the battery voltage drops below 3.0 Volt. This will prevent the rechargeable batteries from being discharged too much
After fading-in one color, the LED stays on for a time somewhere between 15 seconds and 30 seconds. Since I still had the unused blue LED I added the feature that both Cubes will turn blue when the on-time is exactly 20 seconds. This does not happen very often since the random time is generated in timer ticks of 40 milliseconds as described later.

The fading-in and fading-out uses Pulse Width Modulation (PWM) as explained in my previous project. Since the Cubes are of different sizes, I used 3 LEDs for the big Cube and 1 LED for the smaller Cube. In order to make both Cubes shine with the same brightness, I limited the maximum on-time of the PWM of both Cubes. Since the Cubes where a bit brighter than required, this brightness limitation also extends the operation of the – rechargeable – batteries.”

Link to article