Remote pet feeder

Remote pet feeder

How it works

Do you wanna feed your pets from outdoor?
This is a feeder that can be controlled from the Web.

Materials

  1. obniz – 1
  2. battery or usb adaptor & cable – 1
  3. Screw and pipes
  4. Servo motor (unlimited rotation) – 1
  5. Pet food – as many as possible

Steps

Step 1

Cut pipes and prepare the screw.
This is a sample stl file. you can download and print this by 3D Printer. [DOWNLOAD]
Then, Build these things and connect screw to a motor.
And put them into a box.

Step 2

Connect Servo motor to an obniz.
like
io0: GND,
io1: VCC,
io2: signal

Then power up your obniz.

Step 3

Write code below.
Put foods to it and Try onece.
foods will be outcome.

Code

This is a html/script for this.

<div id="online-status"></div>
<button id="meal">Feeding</button>
<div id="dispMeal"></div>
<br>
  
<script>
    function getTime(){
    var dateTime=new Date();
    var hour = dateTime.getHours();
    var minute = dateTime.getMinutes();
    return hour + ":" + minute;
  }
  var obniz = new Obniz("3267-6051");
  obniz.onconnect = async function () {
    var numberOfMeal = 0;
    var lastTimeMeal;
    $("#dispMeal").text("Number of feeding : "+numberOfMeal)
    var servo = obniz.wired("ServoMotor", 0, 1, 2);
    
    $("#meal").click(async function(){
      numberOfMeal++
      lastTimeMeal = getTime();
      $("#dispMeal").text("Number of feeding : "+numberOfMeal+", The last time : "+lastTimeMeal)
      servo.angle(0.0);
      await obniz.wait(10000);
      servo.angle(6.9);
    })
    
  }
</script>

See the Pen Cookbook: Pet Feeder by obniz (@obniz) on CodePen.

Working video

Now you can control it from outdoor.
Leave obniz powered on.
And open html page at any time you want to feed.
Just put “Feeding” button. It will work!

Leave a Comment

%d bloggers like this: