IoT Smart Socket Arduino And Cayenne

A really smart IoT socket. Switch ON/OFF your device by the smartphone using Cayenne Dashboard and Arduino MKR1000.

Things used in this project

Hardware components

Arduino MKR1000
Arduino MKR1000
× 1
RobotGeek Relay
RobotGeek Relay
× 1
9V 1A Switching Wall Power Supply
9V 1A Switching Wall Power Supply
× 1

Software apps and online services

Cayenne
myDevices Cayenne
Arduino IDE
Arduino IDE
Arduino Web Editor
Arduino Web Editor
Arduino Cloud
Arduino Cloud

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

I saw Chinese socket that you can command by your phone, but I’m a maker, and I just want make one of this by myself!

This is possible by using CAYENNE Dashboard!

Do you know Cayenne? See the Cayenne site!

Total amount of project is about $ 60,00

I use a normal socket components, and an Arduino MKR1000. Now I can switch on and off two sockets in my home whenever I want, and everywhere in the world by using my smartphone or others PC in the world, like an Internet Point PCs in Bangkok.

Step 1: Materials

IoT Smart Socket Arduino And Cayenne

The total amount of project is about 60,00 $. The materials are available on Amazon, or on your local store.

You can buy Arduino MKR1000 by Amazon, and others electronics components, and buy the socket components by your local store. In Italy, there is 220V AC current for the home appliance. For this reason, the sockets have this kind of shape. You can use your local socket and your local AC components.

 

The Arduino and relay socket components are:

After you can buy on your local electronics store the 220 or 110 volts components.

You can assemble all the components, and open a hole for Arduino MKR1000 USB cable. With this procedure, you can program your Arduino without open the case of the socket. You can upgrade or modify the sketch whenever you want.

Step 2: The Theory and the Practice

In the video I can to explain the project. You can use Arduino MKR1000 or many others shield like ESP8266 and others. Pay attention to the power limits of relays. The power in Watts on my socket is 10A on 220Volts about 2200W of power. Yes, I can use my hairdryer…

Put together, and try the relay shield by using the blink code.

Pay ATTENTION!!

This Project Use HIGH TENSION

Find the blink code in Arduino IDE. Click on File –> Examples –> Basics –> Blink. Use the pins that have relays shield, and see the led and the relay blinking. In my case, the pins are 7 and 8. Do not use the pin number 6. This pin is connected to one resistor, and to the onboard led. If the blink code work, you can go to the next step.

You can program your Arduino by using create.arduino.cc

Step 3: Create the Cayenne Dashboard

You can Sign Up on Cayenne by Cayenne My Device, and create a new device on your Dashboard. After the creation of the device, you should type the token code on your Arduino IDE. Take note of Token, in the Cayenne page, and in the next step put the code in your Arduino Sketch.

The token is different because you can connect many devices to Cayenne Dashboard. You can also use for example an input from an Arduino UNO device, and another widget from Arduino MKR1000, and put together in a Cayenne Project page. The possibility are many!

Charge the code on your board using the next step. You wait the connection of Arduino MKR1000 to the Cayenne cloud, and after putting the digital widget to your Dashboard. I’ve used Arduino pin 7 and 8.

Now Cayenne is in beta for MQTT protocol. Stay tuned!

Step 4: Install the Library and Upload the Code

 

Source : IoT Smart Socket Arduino And Cayenne


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

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

Scroll to Top