Project tutorial

Remote Controlled Pet Feeder © GPL3+

With this simple Arduino project you can feed your pet using a remote control.

  • 2,405 views
  • 1 comment
  • 16 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
You can use any similar kind of boards
×1
Servo Motor (SG90)
You can use any Servo motor ,doesn't have to be very powerful
×1
IR receiver (generic)
IR receiver(TSOP1738)
×1
Justboom air mouse remote
JustBoom IR Remote
You can use any Remote control (IR)
×1
11026 02
Jumper wires (generic)
×1
12002 04
Breadboard (generic)
×1

Necessary tools and machines

Scissors
Hy gluegun
Hot glue gun (generic)

Apps and online services

About this project

With this simple Arduino project you can feed your pet using a remote control. All you need is an Arduino Uno board (or similar), a plastic bottle, a servo motor (doesn't have to be very powerful), a TV remote, IR receiver (TS0P1738) and a small piece of cardboard.

Let's get started!

Installing the IR Library:

The very first thing that we need to do associating with arduino is to download the IR library.

Download IR library from below link and install it: https://github.com/z3t0/Arduino-IRremote

If you don't know how to install a library follow below link: https://www.arduino.cc/en/guide/libraries

Decoding IR Signals:

First you need to connect the parts as per the given circuit diagram:

You can checkout Pin out of TSOP1738 below:

Use following code to decode IR remote:

/*
The IR sensor's pins are attached to Arduino as so:
Pin 1 to Vout (pin 11 on Arduino)
Pin 2 to GND
Pin 3 to Vcc (+5v from Arduino)
*/
#include <IRremote.h>
int IRpin = 11;
IRrecv irrecv(IRpin);
decode_results results;
void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
}
void loop() 
{
 if (irrecv.decode(&results)) 
   {
     Serial.println(results.value, DEC); // Print the Serial 'results.value'
     irrecv.resume();   // Receive the next value
   }
}
  • Open Arduino IDE and Upload code
  • Open Serial Monitor
  • Aim your remote at the sensor and press each button
  • You can see different numbers for each button

Consider any two buttons, and note down decoded values.In my case I have chosen Power button and Mode button.

I got the following values:

  • Power button=33441975
  • Mode button =33446055

We will be using this two values to control rotation of servo motor.you need to add this two values in the program which is given on next step:

Let's set-up the final hardware!

The Final Circuit!

  • Connect the servo's signal pin to pin#9 on the arduino
  • connect the servo's VCC and GND pins to 5V VCC and GND on the arduino
  • The servo will be glued to one end of the plastic bottle, and rotate a piece of cardboard small enough to close the opening of the bottle so that the food is blocked.
  • If all the hardware set-up is connected properly, you can simply compile and upload the following sketch to the board.
#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);
    }
}     

Now you can control your opening of pet feeder dispenser with remote control by this simple project. :-)

Happy making!

Code

Decode_IRArduino
Use this code to decode IR remote
/*
 
 The IR sensor's pins are attached to Arduino as so:
 Pin 1 to Vout (pin 11 on Arduino)
 Pin 2 to GND
 Pin 3 to Vcc (+5v from Arduino)

*/

#include <IRremote.h>

int IRpin = 11;
IRrecv irrecv(IRpin);
decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() 
{
  if (irrecv.decode(&results)) 
    {
      Serial.println(results.value, DEC); // Print the Serial 'results.value'
      irrecv.resume();   // Receive the next value
    }
  
  
}
IRremote_Servo_ControlArduino
Add decoded value from your remote in this code
#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);
     }
     
}     

Schematics

IRremote_Servo_Control
Irremote servo control jxmemndrb4
Decode_IR
Decode ir sgwnuwjubq

Comments

Similar projects you might like

Arduino Bluetooth Basic Tutorial

by Mayoogh Girish

  • 455,941 views
  • 44 comments
  • 242 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 285,651 views
  • 95 comments
  • 672 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 231,226 views
  • 40 comments
  • 241 respects

OpenCat

Project in progress by Team Petoi

  • 196,914 views
  • 154 comments
  • 1,369 respects
Add projectSign up / Login