Electronic Clinic
Published © Apache-2.0

Servo Motor Control with Remote

With this simple Arduino project, you can servo motor using a remote control.

BeginnerShowcase (no instructions)1 hour37
Servo Motor Control with Remote

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
IR receiver (generic)
×1
JustBoom IR Remote
JustBoom IR Remote
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit

Code

Code

Arduino
#include <IRremote.h>
#include <Servo.h>
int IRpin = 11;  // pin for the IR sensor
IRrecv irrecv(IRpin);
decode_results results;
Servo myservo;
void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
 myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
void loop() 
{
 if (irrecv.decode(&results)) 
   {
     irrecv.resume();   // Receive the next value
   }
  if (results.value == 33441975)  // change according to your IR remote button number
    {
      myservo.write(0);
      delay(15);
    }
    if (results.value == 33446055)  // change according  to your IR remote button number
    {
      myservo.write(30);
    delay(15);
    }
    
}     

Credits

Electronic Clinic

Electronic Clinic

16 projects • 3 followers

Comments