In this project, we will learn how to control a servo motor with a remote control. This will give you a general concept on how to control remotely. You should know that the remote control sends Infrared (IR) signals, so we will learn how to receive and read these signals using Arduino.
We use Arduino UNO to control the servo motor and give us the functionality we want. We use the IR receiver to read IR signals from the remote control. The wiring for the IR receiver and servo motor are shown in pictures. Follow the steps for wiring in the pictures.
First, download the IR remote library for Arduino from here: https://github.com/z3t0/Arduino-IRremote/archive/master.zip
Open IRremote demo example from Arduino IDE, then upload it to the Arduino board.
Then open the serial monitor and try to click on any button on the remote control to send a signal to the IR receiver; the HEX code of each button must appear in the serial monitor as shown in the picture.
Then detect the HEX code of the buttons used to control the servo motor; assume you will use two buttons of your choice, one for clockwise rotation and another for counter clockwise rotation.
For example, use (+) for clockwise and (-) for counterclockwise, so you have to get their HEX codes.
- (+) ---> A3C8EDDB
- (-) ---> F076C13B
In the final code, the functionality allows you to click any two buttons for the motor to toggle between adjusting rotation directions and stopping. When you first click one button, the motor will rotate the button's direction, and when you secondly click the same button the motor will stop.
Comments