Smart Outlet

Overview

The Smart Outlet is a simple to build and highly useful project that allows one to power on or off any connected device from their smart phone or computer. Smart outlets allow for the transformation of any dumb wired device into a smart - IoT powered - tool. Our smart outlet can be used to turn on your Christmas lights remotely, or to turn off your coffee maker when you leave for work.

This project is dangerous to build as it deals with high voltage, and this tutorial is presented purely for educational purposes. Any damage caused to self or property is not the responsibility of Quantum Integration.

ADVANCED

1 HOUR

1 CLIENT

 


Hardware components

Picture

Name

Quantity

Link

Picture

Name

Quantity

Link

 

Relay

1

Included in Component Kit

Or you can purchase it here

 

Jumper Wires

(MF)

3

Included in Component Kit

Or you can purchase it here

 

Miniature Extension Cord

1

you can purchase it here

Q-Client Builder Base

1

Q-Client

Tools Used

Picture

Name

Quantity

Link

Picture

Name

Quantity

Link

 

Small flat-head screwdriver

1

Included in Component Kit

Or you can pick from one on our Recommended Tools List

 

Wire Stripper

1

You can pick from one on our Recommended Tools List


Assemble the Circuit

Before you use this smart outlet, we suggest that you fabricate some sort of housing for the relay and client. You do not want to short out the high current coming from your walls as doing so could easily start a fire. We 3D printed a housing for ours and you can find the .stl file of our model below.

Gather all parts listed above in the parts list and assemble them according to the following schematic:

From the Relay, connect the signal pin to GP0, the vcc or + pin to 5V, and the GND or - pin to the GND ports on the builder base.

To connect the extension cord to the relay, remove the outer sheath to expose the Black, Green, and White wires like so:

Next, cut the black wire, and strip the two ends. We chose to add terminal ends to the wire to avoid any possible short circuits, and we suggest that you do the same.

Now, connect the two ends of the black wire to the NO and Common terminals on the relay.


Pair the Builder Base

Now we want to pair the Builder Base with our Q-Server. In order to do so, go to the Homescreen of your Q-Server.

Next click on the lift side symbol labeled “Clients”. Switch to the “Unpaired” tab at the top middle of the screen.

You should see your unpaired Builder Base. If not, check if you have plugged in the power supply for the Builder Base. Now move to the three dots below “Actions” and click “Pair”.

Once your Client is paired, click the “Setup” button.

Now you can edit your Client. Give him a Name you want and also a location where you are going to use it. Hit “Save” when you finished.


Build the Firmware

Navigate to the Firmware Builder and select the “+ Create New” button on the upper left hand side of the screen.

Name your firmware “Outlet” and hit create.

Now, select the “+ Add Hardware” button, add a Digital Out device to the firmware. Name the device “Outlet”, and hit the “Add Hardware” button.

 

Select the “Outlet” device in your firmware to expand the configuration options.

 

For the driver select GPIO and configure it as shown.

 

Now, save your firmware file and upload it to your client!

 

Be sure to select the client that the relay circuit is attached to!


Build the Application

To build the application you will need to navigate to your application page and select the “+ Create New” button.

Now, name your application and press the “Create” button. We named ours Outlet.

You should now be on the app builder canvas. Using the search bar in the upper left hand corner of the canvas, find the Digital Out hardware object and drag it onto the canvas.

 

Select the Digital Out object, and navigate over to the properties panel on the right side of the screen. Change the name of the object from “Untitled” to “Outlet”, and then click the “Save Properties” button below.

 

Again, using the search bar find the “Switch” interface object and drag it onto the screen.

 

Now, select the Switch object, navigate to the properties panel, rename the object to switch, and save the properties.

 

Next, connect the State output port from the Switch object to the State input port on the Outlet Object.

Lastly, save your application!


Mapping the Hardware

Navigate back to your applications page and hit the start button next to your Outlet application.

A list of the devices contained in your application will expand.

Now, select the Outlet object and map the Outlet firmware driver to it.


Run the App!

Hit “Save + Run” and your application will start!

To turn the Outlet on and off you can do so through the Application interface on the dashboard. To navigate to the dashboard select the Dashboard button on the upper right hand side of the screen.

A list of the interfaces for your running apps will be presented.

Select the Outlet App.

Now you can turn the outlet on and off by toggling the switch!!

Congrats, your outlet is complete!


Resources

Application

 

Firmware

 

Schematic

 

Diagram

3D Files