DesignSpark Electrical Logo

Innovation for Every Engineer

  • Brought to you by
  • RS Components
  • Allied Electronics
Fannie Wong

December 20, 2016 10:04

How to control a Window Blind using IOT enabled hardware (Part 1)

This is part one of a series of articles where I will be showing you how to create a home automation system using Components and hardware which can be purchased from the RS Components website. Also, we will show how you can build your own casing and gears on DesignSpark Mechanical. In this application, we will be controlling window blinds.

Home Automation Project Details: We will use a Cayenne application to send a signal to an Arduino UNO WIFI which will control the motor rotation, this will pull the blinds up or down. It’s not necessary to use an Arduino UNO WIFI as we have but also an Arduino Uno will do just fine for this project too.

In this case, we must connect the Arduino UNO WIFI to our laptop for the whole time of the project, as cayenne uses a computer as the main communication point. Which means, whenever we press a button to activate the motor, the signal will go to the computer first, then into the Arduino UNO WIFI.

So, what is Cayenne? It is an IoT platform which allows users to create their own widgets and user interface to suit their needs. For our case, we use it for the switching operation to operate the motor bi-directionally. For more on using and installing Cayenne please see the link below.

https://www.cayenne-mydevices.com/

Hardware & Components needed:

  • Arduino UNO WIFI or Arduino UNO
  • USB cable for connection between computers & Arduino UNO WIFI or Arduino UNO
  • Download Arduino Software
  • Download Cayenne app onto your smartphone & signup an account
  • Adafruit motor /Stepper/Servo shield for Arduino
  • Reversible High torque Turbo Worm Gear Motor JGY370 DC 12V 23RPM(this motor is used to comply with the blind we using.)
  • Power Supply 12V and one set of supply cables (crocodile clips)

 
Below is our step by step tutorial.

Hardware Setup

First, visit the link below and, sign up for a Cayenne account.

http://www.cayenne-mydevices.com/arduino/

Follow the instructions and complete the setup.

After you complete, you will be able to see your dashboard as below.

 We will need two virtual buttons, so go “Add new” > ‘device/widget’. Find “custom widget” and choose ‘button’.

 

Name it however you want, but under ‘device’ must be the device that you are using and make sure that later when you define the Virtual pin, the Virtual Pin numbers are the same. Make sure that your Arduino board is connected with cayenne by locating ‘documents’> ‘Arduino’> ‘libraries’> ‘cayenne file’>” extras”>” Scripts”, press shift Key and right click “Scripts file”, open command window and type in (‘cayenne-ser.bat -c COM1...’) and ENTER, if your USB port is 3 then put COM3. After that the label “Arduino Uno” at the dashboard should light up showing it is now connected. Then click “Add widget”.

 If you do not know which com port it is, simply open Arduino and go to “tools”>” Port”.

*Make sure your Arduino Board is connecting with a USB cable and connect with your computer.

Go on and create another button for the backward button. Now we are all set for the buttons.

Let’s go on with the next part, which is the setting up of the hardware. Follow the instructions given by the link below and setup your hardware configuration.

https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino?view=all

After setting up, set your power supply to 12 V, then turn it off and set aside on standby. (Do not connect it to anything first) 

Part Two - Programming

Fannie Wong

Bio coming soon