MATRIX ALEXA HOME AUTOMATION – MATRIX VOICE/CREATOR & RASPBERRY PI

So what all things we have now? A A Raspberry Pi, A MATRIX Voice, Alexa configured to work with MATRIX Voice and IFTTT. What to do next? How about some home automation? In this post, I will show you how to set up a Matrix Alexa Home Automation system, that can turn on and off lights, fans or any electrical device in your home. Lets get started.

Components Needed

About Relay

Relays are switching circuits that can close and break circuits mechanically. That means it can control an electrical circuit by closing and breaking connections in that circuit.

MATRIX ALEXA HOME AUTOMATION – MATRIX VOICE CREATOR RASPBERRY PI

Relay 2

As you can see, there are mainly 5 terminals in a relay. Two for energizing the coil, one Common terminal, a Normally Closed terminal which will be connected to the Common terminal when the coil is not energized and a Normally Open terminal which will be in contact with the Common terminal when the coil is energized.

Relay 4

This is how the relay works. In our case, we will be connecting

  • GPIO pins to One End of Coil
  • Ground to other End of Coil
  • Phase of Main Power Supply to The Common terminal or Pole
  • One Terminal of bulb (Or other electrical Appliance) to Normally Open Terminal
  • And the Other Terminal of Bulb to Neutral Point of Main Power Supply

Since the Output of Raspberry Pi GPIO pins are 3.3V, you will have to buy a 3.3V Relay. You can purchase the relay board of 4 relays that is compatible with Raspberry Pi from here or click on the image.

Matrix Alexa Home Automation

Matrix Alexa Home Automation

Steps

Step 1 – Setting Up Alexa

Below link will redirect you to an easy to understand simple tutorial which will help you to set up Alexa on your Raspberry Pi using MATRIX Voice.

MATRIX Voice Alexa Raspberry Pi Easy Setup In this tutorial, I show you how to set up MATRIX Voice Alexa in your MATRIX Voice/Creator Device. Before going into this, it would be good if you know what a MATRIX Voice is and what it can do. Click Here to know more about MATRIX Voice and what it can do. MATRIX Voice Alexa … Continue reading MATRIX Voice Alexa Raspberry Pi Easy Setup More

Now, you should be able to tell the Wakeword “Alexa” and communicate with it. You can proceed to next step.

Step 2 – Setting Up Ngrok

Next thing you have to do is set up ngrok. ngrok is an awesome service that enable us to connect to any device (inside LAN or internet facing) through any network with out port forwarding. The below tutorial explain everything you need to know about ngrok and set up one yourself.

Access Local Device without Port Forwarding – Ngrok Working & Setup

Access Local device without Port Forwarding ngrok is an service that enables us to connect to any device (inside LAN or internet facing) through any network with out port forwarding. One key advantage of using ngrok is that, you dont have to be local network as your device to access them. You can SSH, use … Continue reading Access Local Device without Port Forwarding – Ngrok Working & SetupMore

Repeat Step 1, 2, 3 and 4 of the above tutorial.

Up Ngrok

Now you will have a ngrok URL which can be accessed from anywhere around the world.

Step 3 – Setting Up IFTTT

IFTTT or If This Then That is simply a platform, that interlinks various devices, apps and services that allows us to do what we want to do. It helps us to automate and arrange various tasks and services in an efficient and a user friendly manner. The below tutorial explain everything you need to know about IFTTT and set up one yourself.

IFTTT communicates with Amazon Alexa by linking it with the developer account. When we say a specific phrase  to Alexa, it will be sent to IFTTT an action will be trigggered.

IFTTT

MATRIX Alexa IFTTT Integration in Raspberry Pi Tutorial

In the previous post, we showed you how to setup Amazon Alexa using MATRIX Voice / Creator on Raspberry Pi. All it can do is talk to us and do some some basic stuffs. What if we could control the lights in our home using Alexa? Or control the room temperature? Or open the gate? … Continue reading MATRIX Alexa IFTTT Integration in Raspberry Pi TutorialMore

Follow this step and create an account in IFTTT.

Create an applet with Trigger ‘Alexa’ as shown in the above tutorial. Click on ‘Say a specific phrase’ and enter “Light one on”.

Setting Up IFTTT

This Trigger fires every time you say “Alexa trigger lights one on”. Now click on Create.

Now its time to create an Action. For that click ‘that’. Now select ‘Web hooks’

Setting Up IFTTT

Select ‘Make a web request.’

Setting Up IFTTT

and enter the details as below

Setting Up IFTTT

URL : http://259325d1.ngrok.io/light_one_on (http://<ngrok_URL>/light_one_on)

Method : Get

Content Type : Text / Plain

Click on ‘Create Action’ and then click Finish.

Setting Up IFTTT

Similarly create another applet to turn off the light and enter the below contents in webhook

URL : http://259325d1.ngrok.io/light_one_off (http://<ngrok_URL>/light_one_off)

Method : Get

Content Type : Text / Plain

For now, our work here is done.

Step 4 – The Code

Matrix Alexa Home Automation code is available on github. You can download using the below link.

[Download]

Make sure you have installed flask. If not, you can install it by

pip install flask

Step 5 – Connections

Shown below is the pinout diagram of MATRIX Voice to connect the relays in your Matrix Alexa Home Automation.

MATRIX Voice

Use any of these GPIO pins and connect it to relay. That relay should be connected to light.

Start Home Automation

Once all the connections are complete, run the python code you downloaded from github.

Now your Matrix Alexa Home Automation is all set up and ready for action. You have Alexa running in your Pi with MATRIX Voice, ngrok running, and a flask server up and running. Now try saying.

Alexa, Trigger Light one ON

This should turn on your light that is connected to the relay.

Now try saying.

Alexa, Trigger Light one OFF

This should turn OFF the light.

Source: MATRIX ALEXA HOME AUTOMATION – MATRIX VOICE/CREATOR & RASPBERRY PI

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top