Wireless Servo motor control
Introduction:
In some applications we have stop the motor at an exact angle like 40, 72,164 degrees. For this type of applications dc motor is not suitable, because if once we apply the power supply to dc motor, after turning off the supply it continue to rotate some time because of momentum. It can’t be stop at an exact angle. So for such application we have to use servo motor. For example in a big liquid tank it is required to control liquid flow then it can be done with the help of motorized valve whose opening can be varied using servo motor.
The new thing in this project is, controlling exact angle of motorized valve using servo motor of big liquid tanks to control liquid flow. The servo motor is controlled wirelessly through RF remote.
Description:
In this project valve opening levels are assumed as switches. Four switches represent four stages of valve opening to control the liquid flow. And to control servo motor angle microcontroller used. Servo motor angle is controlled by PWM signal. Arduino micro controller has PWM output pins. The arduino micro controller gets input from receiver decoder and controls the angle of servo motor by generating PWM
Required components and equipments:
Sr. no. Name of component Required quantity
1 RF Tx module(434Mhz) 1
2 RF Rx module(434Mhz) 1
3 HT12E 1
4 HT12D 1
5 LED 1
6 Resistor – 1KΩ (Quarter watt) 4
7 Resistor – 1MΩ (Quarter watt) 1
8 Resistor – 50KΩ (Quarter watt) 1
9 Arduino pro mini development board 1
10 Mini servo motor (8 gm) 1
11 Battery – 9V 2
12 Push button switches 3
13 Bread board 4
14 connecting wires
Circuit diagram:
Procedure:
Transmitter section:
Step1: connect the four push buttons to the data input pins (10,11,12,13) of HT12E, with pull down resistors of 1 KΩ.
Step2: connect 1MΩ resistor between 15 and 16 pins of HT12E.
Step3: connect 17 pin to the 2nd pin of RF transmitter, and 14 pin connect to the ground.
Step4: 1-8 pins of HT12E are address pins, all are connected to ground. Pin 18 is connected to Vcc and pin 9 is connected to ground.
Step5: Connect RF Tx module’s pin 1 to the ground, pin 3 to the Vcc and pin 4 to the antenna.
Receiver section:
Step1: connect the decoder 10,11,12,13 pins to Arduino microcontroller digital pins 6,7,8,9 as inputs.
Step2: Servo motor has three wires, 1) Vcc (Red), 2) Ground (Black or Brown) , 3) control (Orange or yellow). Connect Vcc to 5V, and Ground to GND, control wire to the any PWM pin of Arduino pro mini.
Step2: Connect 50KΩ resistor between 15 and 16 pins of HT12D.
Step3: Connect pin 14 to the 2nd pin of RF Rx module, and connect pin 17 to the LED indicator (it will glow when signal is received)
Step4: 1-8 pins of HT12D are address pins, all are connected to ground Connect pin 18 to Vcc and pin 9 to ground.
Step5: Connect RF Rx module’s 1, 6, 7 pins to the ground, pins 4 & 5 to the Vcc and pin 8 to the antenna.
Now you are ready to run and test the circuit. Let us see how it works.
Working:
1. The HT12E encoder inputs are controlled by switches, this parallel data converted by encoder in to the serial data and fed to RF Tx module input pin 2 from the encoder 17th pin.
2. Transmitted data is ASK modulated signal means the data present in variations of the amplitude. The receiver within the range can receive the ASK signal and generates serial data same as at transmitter and fed to 14th pin of decoder (HT12D).
3. This serial data is converted in to parallel data by the decoder and the parallel data output is available at 10,11,12,13 pins of decoder.
4. These pins are connected to Arduino digital pins as input. Arduino gets this digital input and based on received data it sets particular angle of servo motor by generating PWM
5. With each switch there is particular set angle. In demo angles assigned like:
Switch 1 — 0o .
Switch 2 — 45 o .
Switch 3 — 80 o .
Switch 4 — 160 o .
6. When switch 1 at transmitter side is pressed, the respective pin at receiver changes its state and servo motor rotates to 0 o.
7. When switch 2 at transmitter side is pressed, the respective pin at receiver changes its state and servo motor rotates to 45 o.
8. When switch 3 at transmitter side is pressed, the respective pin at receiver changes its state and servo motor rotates to 80 o.
9. When switch 4 at transmitter side is pressed, the respective pin at receiver changes its state and servo motor rotates to 160 o.
This complete working is due to the program embedded into arduino micro controller. Here is the complete program.
Pictures:
While running the circuit it is required to take following precautions
Precautions:
1. Address lines status (high/low) should be same at both transmitter and receiver.
2. At transmitter 14th pin of HT12E should be connect to ground or connect a switch between ground and the 14th pin to reset the encoder.
3. In the transmitter circuit the resistor connected between 15 and 16 pins of HT12E should be between 750MΩ to 1MΩ. And at receiver side the resistor connected between 15 and 16 pins of HT12D should be between 30KΩ to 50KΩ.
4. Incase if you want to use any other battery, checkout the data sheet of HT12E/HT12D first.
5. When dealing with servo motors take care about source current , there should be sufficient current when servo is running. If enough current is not there use bug booster convertor.
Project Source Code
Project Source Code
###
#include <Servo.h>Servo myservo;int pos = 0;//decoder 10,11,12,13 output pins connected to arduino 10,11,12,13 digital pins as input.int tx1 = 10;int tx2 = 11;int tx3 = 12;int tx4 = 13;//decoder 10,11,12,13 output pins connected to arduino 6,7,8,9 digital pins as input.int led1 = 6;int led2 = 7;int led3 = 8;int led4 = 9;void setup(){pinMode(tx1,INPUT);pinMode(tx2,INPUT);pinMode(tx3,INPUT); // decoder output microcontroller reading as input.pinMode(tx4,INPUT);pinMode(led1,OUTPUT);pinMode(led2,OUTPUT);pinMode(led3,OUTPUT); // led's as output.pinMode(led4,OUTPUT);Serial.begin(9600);myservo.attach(9);}void loop(){// reading data and storing in avariable for further use.int Tx1 = digitalRead(tx1);int Tx2 = digitalRead(tx2);int Tx3 = digitalRead(tx3);int Tx4 = digitalRead(tx4);if (Tx1 == HIGH){myservo.write(0);delay(1500);} else if (Tx2 == HIGH){myservo.write(45);delay(1500);} else if (Tx3 == HIGH){myservo.write(80);delay(1500);} else if (Tx4 == HIGH){myservo.write(160);delay(1500);}}//Program to
###
Circuit Diagrams
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.