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

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.

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.

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

Now you can install the Cayenne Arduino library, and upload the code from your Arduino IDE.