IoT Magical Wand

Introduction

     During our childhood days, we would have fantasized to perform magic using the wand in the hand of a magician. When the magician rotates the wand and says 'Abracadabra', magic happens! This IoT Magical Wand project is inspired by this and it is actually that dream come true. Using this IoT Magical Wand you can control your home appliances. You can turn them ON or OFF by rotating this magical wand or tilting it towards a particular direction. Then say 'Abracadabra' for the magic to happen!? Not really, you have to spell it. IFTTT, Arduino MKR1000, Node MCU, Arduino UNO, thinger.io, and relay module are all the magical elements required to perform this magic. What's more! You can use the same setup (the smart relay system particularly) and control your home Appliances using Amazon's Alexa. Should you say  'Abracadabra' to Alexa then? No, you have to say the magical words as follows: Alexa, trigger turn ON the light to turn ON the light bulb connected to the relay.

The Magic!

     Below is the video describing from the materials required to the final outcome of the IoT Magical Wand project. 

How did the magic happen?

     IoT Magical Wand - The Arduino MKR1000 monitors the position of the magical wand. This is achieved through the accelerometer connected. The wand is activated by inverting it upside down and placing it in that position for a count of 5. To turn it OFF do the same again or continue for 5 more counts. Only if it passes this condition, the system will start to monitor the change in the position of the wand, other than the upside down position. I have configured three positions and this will make a respective IFTTT web request. For instance, if I tilt the wand towards left that will turn ON a particular relay. You can now tilt the wand to another side and turn ON another relay. If you again comeback and tilt towards left, the system will remember that it has sent a turn ON request and will now turn it OFF. So based on the position of the wand, Arduino MKR1000 will make a corresponding IFTTT web request which will, in turn, make a web request to thinger.io connected Node MCU. The Node MCU will then serially communicate this with Arduino UNO to turn ON/ OFF the respective relay. When there is a request made, the LEDs mounted inside the top head of the wand will blink in a rotating pattern to show that the magic has happened!

     You can find instructions for connecting Node MCUs to thinger.io IoT Platform here - Steps for connecting Arduino MKR1000 with thinger.io for reading temperature data. These instructions are intended for Arduino MKR1000 but it is the similar process for Node MCUs as well. If you have any difficulties let me know in the comments section below.

     Alexa - You can also replace the magical wand and use Alexa to make a web request to IFTTT. This will then trigger the Node MCU and turn ON/ OFF the respective relay.

List of Hardware and Software Required

     Below is the list of hardware and software required to make your own IoT Magical Wand. Click on the names in order to be directed to the site where you can buy or access the resource.

     Hardware

     Software

Circuit Connection

     Below is the circuit connection diagram between the Arduino MKR1000, accelerometer and LEDs placed inside the IoT Magical Wand.

     Below...

Read more »