My Spark Lamp project has been constantly evolving since its creation. It started off by reading two buttons and the room’s light switch and controlling lamps wirelessly. I experienced some problems with the design and updated the hardware. Then I extended the software to also control some back-lighting in my liquor cabinet. Since then, I’ve moved from that apartment into a house, and since the bedroom is wired differently, I knew I would have to update the system.
The biggest difference now is that the light switch controls the ceiling fan and not an outlet on the wall, so the majority of the hardware needed to change. Since I’m still renting, I couldn’t change the wiring, so I took this opportunity to use my Switchmate. I backed this project during its Indiegogo campaign, but when I received it, I realized I didn’t have anywhere in my apartment where I required “smart” lighting, so I threw it into storage. Since I can’t reach the light switch from my bed, wireless control would be essential for this project. I found brianpeiris’ switchmate project which proved that I could read and control the Switchmate from my own application so I knew I could use this as a replacement for my old light switch detection circuit. I cover the software in detail in another post.
The Switchmate operates over Bluetooth Low Energy, so I needed to move away from the Particle Core microcontroller. I have a Cypress PSoC 4 BLE Pioneer Kit, which I evaluated as a possible replacement, but found that a Raspberry Pi 3 would be easier to use because it abstracts away the low-level Bluetooth settings. It also has Wi-Fi and runs Linux so I can modify and debug my program from anywhere. I knew this would be a permanent project so I looked for a case and a prototyping shield that were compatible. I found this Eleduino enclosure and this Gowoops prototype HAT shield on Amazon at very reasonable prices, and if you remove some of the acrylic layers from the enclosure, they stack together perfectly.
The shield was easy enough to create. I only had to add two screw terminals and a header for the 433MHz transmitter. I didn’t even need to add resistors, as I could use the Pi’s internal GPIO pullups. The screw terminals connect to the two buttons that are placed one on each nightstand. The 433Mhz transmitter controls the wireless relays that are on each lamp’s power cord.
I used this setup for a while, but found a good deal on the Philips Hue Lux Starter Kit, and decided to move from the noisy and slow 433Mhz relays to these silent and speedy ZigBee bulbs. These are the first generation bulbs, so they are dimmable, but they cannot change colors — but this is fine for my application. Currently, I only have them toggle between off and full brightness, but want to add the ability to adjust the brightness in a future update. With this addition to the system, I no longer use the 433Mhz transmitter.
As seen in the main photo on this post, I’m using a Tenergy Portable Power Bank as a makeshift UPS. One thing to note is that many of the battery packs on the market cannot supply power and charge at the same time, so make note of that if you’re looking for a suitable battery. This one can handle both simultaneously and is a great choice for this application.
That covers the hardware for this project! As you can tell, the hardware is pretty simple. Most of the complexity of this project lays in the software. The next post on my blog outlines my software and how I got this mishmash of hardware to cooperate to form a useful home automation system. Click follow below to make sure you’re alerted when I post the next update to this project!