Introduction: Bluetooth Controlled Fan Regulator With Arduino
Hello friends,
In this instructable, i have shown how to make a diy system to control fan regulator the help of Arduino servo motor & a Bluetooth module.
We can switch on & off a fan easily with a relay but controlling speed is a difficult part but with a servomotor it is easy to control its speed, & we can do it wirelessly too.
Things we will need
Arduino Nano
Servo motor
Bluetooth module ( i used HC-05)
Breadboard
Rubber band or some thing like rubber band. ( i used small pieces of Tyre tube)
Jumper cables
Double sided tape
Glue
Step 1: Gluing, Sticking, Attaching & Placing..
Gluing : Take the rubber band and stick it with metal/plastic piece of servo motor with the help of glue.
Use enough glue so rubber & give it some time to set so it don't slip from its position.
Sticking : take the servo motor and stick it to your switch board with double sided tape just like the image.
like the rubber band, use enough tape to stick it at least two side of servo motor. other wise it rip off from its position because of rubber band's stretching.
When you finish sticking & gluing,
Attaching : Attach the plastic piece to the servo motor.
Placing : place the rubber band to fan regulator like the image above.
Step 2: Coding
// Created by Gautam ( https://www.instructables.com/member/Gautam1807/ )// On February 22, 2016.#include<Servo.h>intpos=0;intinput=0;Servomyservo;voidsetup(){Serial.begin(9600);myservo.attach(11);}voidloop(){if(Serial.available()>0);{input=Serial.read();{if(input=='1'){pos=pos+5;pos<=180;myservo.write(pos);}if(input=='0'){pos=pos-5;pos>=0;myservo.write(pos);}}}}
Attachments
Step 3: Wiring
Stick a small breadboard nearby switch board,
and place Nano and Bluetooth module on it.
take some jumper cable attach all the things like the image above.
Servo :
Yellow wire > D9
Red wire > 5V
Black > GND
Bluetooth module :
Rx > Tx
Tx > Rx
GND > GND
VCC > 3.3V
Step 4: Power Up
When you finish all the steps. power up your nano.
The led of Bluetooth module should blink.
Connect to Bluetooth module via PC & select the right port in IDE.
Now open serial monitor.
type 1 & enter, the servo will move 5 degrees clock wise.
type 0 & enter the servo will rotate 5 degree anti clock wise.
If you have any suggestion related to this instructable or need help,
you can write to me in the comment section below. ^_^
6 Comments
Question 5 years ago on Step 2
What does pos in the code stand for and why pos + 5 and why pos
7 years ago
ummm what does this code has to do with BT ? this is all serial BT is not needed for this what am i missing ?>
Reply 7 years ago
you can do this tutorial with data cable too...
7 years ago
Is pos<=180 the same as if(pos>=180) pos = 180: ? I have never seen that short cut before. Can you provide any reference for that? Seems like a pretty nice trick.
Thanks for sharing nice instructable.
Reply 7 years ago
in not a trick thats the conventional way
7 years ago
pretty cool - high tech, meets low tech to get the job done