-
1Step 1
Create a bulb by wrapping an LED strip around a plastic bottle. You could skip this, but the Sense HAT is not bright enough to make a lamp. Cut the top off an empty plastic bottle, cover it in sticky pads and wrap the LED strip around it in a spiral. You can secure the ends further with tape. Have the connection end at the wider opening so that you can route the power cable to the Pi and then out through the centre. We’ll mount the Pi on top of the upside-down bottle end, so ensure it’s flat.
-
2Step 2
Remove the Earth from its mount by pulling the pegs of the holder out of the holes in the Arctic and Antarctic. Next, split it in half along the equator by pulling the two hemispheres apart. It should disassemble fairly easily with a little force applied in the correct places. You’ll want to fashion a new mount to stop the globe rolling around, whilst still allowing the power cable to exit from the bottom hole – you could use the inside of a roll of tape. You can cut a small slot with a knife to allow the wire to enter.
-
3Step 3
Attach your new LED bulb to the inside of the globe. Mount the neck of the bottle over the lower hole with Blu-Tack or putty; it should be sturdy enough to support the weight of the Pi resting on top of it. Mount the Sense HAT on the Pi, and then place both on top of the upturned bottle. Attach a USB WiFi dongle to the Pi (unless you’re using wired Ethernet - see step 8 - or a Raspberry Pi 3), otherwise it will wake you at the wrong time. This is because the Pi requires internet access to set its clock.
-
4Step 4
You’ll probably need to cut and reconnect the power cable to fit it through the hole. The official Pi power supply uses bell wire, which makes it easy to reconnect with a screw terminal (choc block). Unfortunately, it doesn’t supply enough power to use the LEDs at full brightness via the Pi (see step 7). Cut the cable and insert the supply end through the hole. Tie a knot in the cable to stop it from being pulled back through. Separate the two power cores from both ends and strip the insulation. Reconnect with a choc block, matching the polarity.
-
5Step 5
Clone the code from the GitHub repository into your home folder:
git clone https://github.com/jpsingleton/pi-glowbe
If you’re only using part of the hardware or a different LED strip, you can adapt the code to your needs. You may also need to install the Sense HAT software if you’re running an older version of Raspbian – follow the instructions at pythonhosted.org/sense-hat. You may also want to disable the LEDs on the Pi so they don’t disturb your sleep. Newer models can do this in software, otherwise you could tape over them, or even de-solder them if you’re brave enough. -
6Step 6
We’ll run the code with cron. It should start about half an hour before you get up and probably only on weekdays. Launch the cron configuration by typing the following into a terminal:
crontab -e
Next, set it up by adding the following line to the end:
15 6 * * 1-5 python /home/pi/pi-glowbe/wakeup.py
This will run the code every weekday at 06:15, so change it to meet your needs. Save the file and exit the editor (ctrl+x, y, then enter in the default nano). Once happy, reassemble everything and wait for morning!
-
7Step 7
If you can't run the LED strip at full power because the Pi can't supply enough current at five volts. Fix this by soldering some wires to the other end of the strip and connecting them directly to the 5V supply, forming a sort of ring main.
-
8Step 8
If the WiFi keeps dropping without recovering. Cut a cat 5 patch cable, thread it in and crimp on a new plug. You don't need to keep it connected constantly, only when the Pi boots (to set the clock with NTP) and when remote access is required. If there isn't an Ethernet socket where you want the light to be plugged in then you can use some HomePlugs.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.