Home automation projects are becoming more common thanks to the Internet of Things. Features like automatic lights, heating systems, and even window control are increasingly familiar to tech-friendly homeowners.
In this Gentleman Maker episode, we will take home automation a step further by integrating a Raspberry Pi with relay control, voice activation, and spoken commands.
Posh Butler BOM
- Raspberry Pi Model B 3
- Particle Photon
- Particle Photon relay board
- 2 x USB B micro leads
- USB sound card
- Compatible microphone for the sound card
- Devices around the home to control
Home Automation System Diagram
You can find the schematic for our system below:
Or check it out in Scheme-It, yourself.
How Does It Work?
This home automation “butler” system consists of several main parts: a Raspberry Pi, a Photon, a relay shield for the photon, and some mains wiring for powering devices. The Raspberry Pi is used with an external sound card for connecting to an external microphone and listening to voice commands.
Depending on the voice command, the Raspberry Pi updates specific Adafruit IO feeds, which then correspond to the selected hardware. The Particle Photon is connected to a relay shield providing relay control to four relays. These relays are controlled by the same feeds that the Raspberry Pi updates.
Typical voice-activated systems will require the user to say a specific sentence or instruction, such as “lights on”. The Posh Butler system, however, does this processing in a more intelligent way. When the user says a sentence, the speech is first parsed into individual words and then matched against a list of keywords. Depending on the order of the keywords, the system will match controls to actions.
For example, the users could say “butler please turn on the lights and turn off the curtains” and the system will pair “turn on” with “lights” and “turn off” with “curtains”. This allows users to speak in a more natural way, as opposed to giving robotic commands.
The system also has a list of predetermined phrases to give the perception of artificial intelligence. These audio files—which are chosen at random—are played through the speaker, providing a form of audio feedback.
While the Raspberry Pi could have been used to control the relays in this project using its GPIO, a Particle Photon was chosen for two reasons. The first reason is the Particle Photon has a relay shield used to control devices drawing up to 10A at 125V. The second reason is the Particle Photon allows remote installation from the Pi.
You can download the code portion of the Posh Butler Project below:
Use of Mains Devices
This project is ideal for controlling small gadgets and devices, but it can also control mains-powered devices. However, this is incredibly dangerous and must only be done by those who are competent in electrical work and also have an expert understanding of electrical safety.
When controlling mains devices there are a number of key points that you need to follow:
- Fuse the live, not neutral wire.
- Use adequate-sized cables.
- Ensure that proper earthing is used.
- Determine the current consumption of your device and ensure the relay can handle it.
- Ensure the polarity wiring is correct.
If you're unfamiliar with these concepts, do not use the Posh Butler with mains devices.
Now you’re ready to build your own Posh Butler! Customize your home with a voice-activated home automation device for digitalized personalization.
Now that you're living large in your high-tech house, check out other shenanigans you can get into with home electronics projects. For some ideas, check out the rest of the full Gentleman Maker series below:
- How to Make Your Umbrella into a Weather Station with a Particle Photon
- Make Your Own Home Brewing Sensor Kit with the Gentleman Maker’s Adafruit IO SmartBrewer
- Protect Your Personal Castle With the Gentleman Maker’s Photon Trebuchet
- Protect Your Summer Harvest with the Gentleman Maker’s Raspberry Pi and Arduino Dog Corrector
- Feeling Flashy? Tone It Down with the Gentleman Maker’s Raspberry Pi Colorboringizer
- Take a Gander at Wildlife with Your Raspberry Pi: The Gentleman Maker’s Life-Cam!
- Save for Your Own Royal Wedding (of Sorts) with the Gentleman Maker’s Savings Incentivizer
- The Gentleman Maker’s Sun Informer Lets Homebodies Safely Enjoy Intermittent Sunshine
- The Gentleman Maker’s Auto-Apologizer: A Clever, Polite Device for the Everyday Brit
- How to Make an IoT Teapot so You Can Put the Kettle on from Your Smartphone
- Put an End to Stockings Full of Coal with the Raspberry Pi Santa Detector
- Never Run Out of Tea Again! How to Build the Gentleman Maker’s Intelli-T Raspberry Pi Sensor Alarm