Are you still turning on your own lights like a peasant? Learn how to build your own Raspberry Pi-based home automation system and tell your Posh Butler to handle such tasks!

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

 

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.

 

Downloadable Code

You can download the code portion of the Posh Butler Project below:

 

  Posh Butler Code  


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:

 

Comments

2 Comments


  • Dbell 2019-03-01

    Very cool, Robin!
    I’m being a bit facetious here, but would this permit an observant Jewish person to legally turn on the lights on the Sabbath?

  • tdborbas 2019-03-05

    Hi Robin,
    Is this the only way to give you a big thumbs up for your work done here?
    Very nicely put together and simple enough to understand.
    I want a butler-maid device that will recognize people in my home using a db.
    You load the device with your speech saying “I have a son by the name of Lewis..”
    Then when Lewis is over to the house I say “This is my son Lewis” and the db will have a lot of info to have a nice conversation with him.
    As ye ol’ saying goes “this is food for thought”.
    I am done here Robin.  Take care.  Tim