Project tutorial

Voice Activated Arduino Blinds © GPL3+

I think adding Bluetooth to everything in my life has become a problem, I'm working on it.

  • 4,344 views
  • 1 comment
  • 30 respects

Components and supplies

Apps and online services

About this project

Introduction: Voice Activated Arduino Blinds

A while ago I made a project where I added a servo and Bluetooth device to my door lock letting me control it with my phone like an addict I just can't stop adding Bluetooth to stuff and so in this project I'm going to show you how to make Bluetooth controlled blinds with some voice activation features. Let's get started!

Step 1: Parts List

This project is pretty cheap and really doesn't need that many parts, the parts we will need are:

  • Arduino Nano (here)
  • Hc-06 Bluetooth module (here)
  • Motor Controller (here)
  • 2x geared motors (here)
  • 2x 220-ohm resistors (here)
  • 2x push buttons (here)

And for tools and materials we will need:

  • Cardboard
  • Wire
  • soldering iron and solder
  • hot glue gun and hot glue
  • Box cutter

Step 2: Features

So the main feature that these blinds are going have is the ability to open and close them from an app. I have two blinds that I want to control with this device so I'm going to be using two motors, one for each blind. When the command U is sent through the Bluetooth device it will spin both motors to the open position and if the command D is sent both motors will spin to the closed position. Now one of the issues I had with my Bluetooth door lock project was that my phone would die before I got home meaning I wouldn't be able to get into my room and so for this project we are going to be adding buttons to the device that let us open the blinds when the button is pressed. Now, of course, this will also feature voice control and the ability to control individual motors allowing us to open one blind at a time but ill talk more about that later,

Step 3: The Circuit

Don't be fooled by the messy wiring diagram this circuit is actually pretty simple and straight forward if you follow the wiring diagram piece by piece so let's start by connecting the motor controller to the Arduino:

  • Pin 8 connects to M1 on the motor controller
  • Pin 9 connects to E1 on the motor controller
  • Pin 10 connects to M2 on the motor controller
  • Pin 11 connects to E2 on the motor controller

Now we are going to want to connect the Bluetooth module to the Arduino we do this as follows:

  • 5 Volt Pin connects to VCC on the Bluetooth module
  • Ground Pin connects to Ground on the Bluetooth module

Rx and Tx will also be connected to the Arduino but we cant do this yet as once these connections are made we cant upload code so don't connect them until we upload the code.

  • Rx connects to Tx on the Bluetooth module
  • Tx connects to Rx on the Bluetooth module

We are also going to want to connect our buttons that let us control the motors without a smartphone we connect them as follows

  • Connect a resistor from Pin 7 on the Arduino to 5 volts on the Arduino
  • Connect a resistor from Pin 4 on the Arduino to 5 Volts on the Arduino
  • Connect one leg of the button to Pin 7 and the other leg to ground
  • Connect one leg of the next button to Pin 4 and the other leg to ground

Now we are going to connect an LED to pin 4 which will show that the device has power:

  • Pin 4 goes to the cathode (long leg of LED)
  • Ground goes to anode (Short leg of LED)

And lastly, we are going to connect the motors to the motor controller by screwing them into the screw terminal

Step 4: The Code!

Download the sketch, open it in the Arduino IDE and upload it to the Arduino Nano.

Step 5: Power Supply

To gives these motors enough power to turn the somewhat stiff blind mechanism we are going to need at least a 9 Volt 1 Amp wall plug power supply. Once you've found a power supply we are going to want to connect it to our Arduino and the Motor Controller.

It connects to the Arduino as follows:

  • Positive (+) connect to the VIN Pin on the Arduino
  • Ground (-) connects to the Ground Pin on the Arduino

It connects to the Motor controller as follows:

  • Positive (+) connects to VS on the motor controller
  • Ground (-) connects to GND on the motor controller

Now we can plug the motor controller in and give it a test, if everything lights up we can move onto the next step!

Step 6: Making the Case

This step can be completely up to you as pretty much any case design will work, however, lets take a look at how I designed mine. I made mine out of some strong cardboard, we are going to print out a template, stick it to the cardboard and cut it out. We are going to need to cut our 2 of the main oval shapes, 1 long stip which will be the sides of the case and two curved pieces that we will mount or button on.

We are going to want to score the long piece so we can make it bend around our oval shape which must then be glued down, once we have both sides scored and glued down we can glue down our circuit in the middle of the oval.

Now we are going to want to glue our buttons to two different pieces of cardboard and stick these to the top and bottom of the case, we are going to want to glue them in a way that makes the top of the button peak out of the case, this is so we can glue another piece of cardboard to the top of the button which hides it but still allows us to use it.

Once this is done we can take our second oval and cut it into 3 pieces, a top piece, a bottom piece and a long strip from the middle. the middle piece will be glued in the middle with that LED mounted in the middle of it. The top piece is then glued to the top button and the button piece is then glued to the bottom button. When gluing the pieces to the buttons be very careful to not add too much super glue as if the glue gets into the button mechanism it will break the button.

Step 7: Connecting the Motors to the Blinds

To connect the motors to our blinds we are going to need to take the stick and hook that is normally used to open the blinds and break the hook off, we will then glue that to the shaft of the motor and hook it onto the blinds movement mechanism.

Now we cant just leave the motor dangling there so we are going to have to glue it to the wall, I used hot glue but the motors are pretty light so most mounting options will work. Same for the case, I glued mine to my wall but its so light that most options will work just fine.

Step 8: Setting Up the App

The app we are going to be using is called "Arduino Bluetooth Control" by Broxcode, the reason I chose this App is because it has not only a terminal feature but also a feature allowing us to send commands to the Arduino when a chosen phrase is said.

To set it up we are going to pair our Bluetooth device with our smartphone, open the app and click the pair button and search for HC-06 and pair with it, if it asks for a password its either 1234 or 0000 once its paired, click on the terminal option and send U and then D through which should make the motors spin clockwise and then counter-clockwise.

To set up the voice commands open the options menu and scroll down to voice command settings, in there we have the option to send a command when a phrase is said, put the command you want to send in the command box which will be U and then in the phrase box put Let there be light, or whatever you want. Then we will go to the next voice command option and put D in the command send box and Let there not be light in the phrase box meaning our blinds will open when we say let there be light and close when we say let there not be light.

Step 9: An Overview

Okay, lets just take some time to get a full understanding of how everything works. If you want both blinds open we can either push the top button or we can say let there be light in the app if we want both blinds closed we can push the bottom button or say let there not be light in the app.

If we only want one of the two blinds open at a time we can go into the terminal section of the app and send the command K to open the left blind and I to close the left blind or W to open the right blind and L to close the right blind. That's pretty much all the features of the blinds.

If you have questions please let me know in the comments and ill be happy to answer them.

Code

Bluetooth codeArduino
upen using the arduino IDE
int brightness = 0; 
int fadeAmount = 5; 
int led = 3;
int inPin = 4;
int inPin2 = 7;
int val2 = 0;
int val = 0; 
const int motorPin1  = 11;  
const int motorPin2  = 10; 
const int motorPin3  = 8;  
const int motorPin4  = 9; 
int state; int flag=0;
void setup()
{
 pinMode(motorPin1, OUTPUT);
  pinMode(motorPin2, OUTPUT);
    pinMode(motorPin3, OUTPUT);
    pinMode(motorPin4, OUTPUT);
  pinMode(inPin, INPUT); 
    pinMode(inPin2, INPUT); 
   pinMode(led, OUTPUT);
Serial.begin(9600);
delay(1000); }

void loop(){
  
  analogWrite(led, brightness);
   brightness = brightness + fadeAmount;
   
   if (brightness <= 0 || brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  delay(30);

val = digitalRead(inPin);
val2 = digitalRead(inPin2);


if(Serial.available() > 0)

{

state = Serial.read();

flag=0;

} 

if (state == 'U' || val == LOW)

{

digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, HIGH);
delay(2000);
digitalWrite(motorPin1, 0);
digitalWrite(motorPin2, 0);
digitalWrite(motorPin3, 0);
digitalWrite(motorPin4, 0);
Serial.println("Both Up");
state = 0;
}

else if (state == 'D' || val2 == LOW)
{

digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, 0);
digitalWrite(motorPin3, 0);
digitalWrite(motorPin4, HIGH);
delay(2000);
digitalWrite(motorPin1, 0);
digitalWrite(motorPin2, 0);
digitalWrite(motorPin3, 0);
digitalWrite(motorPin4, 0);

Serial.println("Both Down");
state = 0;
}
if (state == 'W')

{

digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, HIGH);
delay(2000);
digitalWrite(motorPin1, 0);
digitalWrite(motorPin2, 0);
Serial.println("Right Up");
state = 0;
}

else if (state == 'L')
{

digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, 0);
delay(2000);
digitalWrite(motorPin1, 0);
digitalWrite(motorPin2, 0);

Serial.println("Right Down");
state = 0;
}
if (state == 'K')

{

digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, HIGH);
delay(2000);
digitalWrite(motorPin3, 0);
digitalWrite(motorPin4, 0);
Serial.println("Left Up");
state = 0;
}

else if (state == 'I')
{

digitalWrite(motorPin3, 0);
digitalWrite(motorPin4, HIGH);
delay(2000);
digitalWrite(motorPin3, 0);
digitalWrite(motorPin4, 0);

Serial.println("Left Down");
state = 0;
}
}

Comments

Similar projects you might like

Magic Lamp

by Nekhil ravi

  • 1,087 views
  • 3 comments
  • 12 respects

PuzzleBox

Project tutorial by Arduino

  • 311 views
  • 0 comments
  • 1 respect

Arduino MKR GSM 1400 and DTMF

by Arduino_Genuino

  • 4,087 views
  • 0 comments
  • 9 respects

Love You Pillow

Project tutorial by Arduino

  • 2,645 views
  • 0 comments
  • 5 respects

Arduino Yun Controller

Project showcase by TATCO Inc

  • 201 views
  • 0 comments
  • 3 respects
Add projectSign up / Login