jorgerance / gatoBot

Web controlled Raspberry Pi based robot which I use to entertain my cats and see how they are doing when not at home.
https://www.hackster.io/jrance/raspberry-pi-web-controlled-robot-with-video-c1b723
MIT License
23 stars 8 forks source link

gatoBot

A web controlled Raspberry Pi Zero W robot with live video streaming.

This is something I built in order to bother my cats.

About Raspberry Pi

Wikipedia:

The Raspberry Pi is a series of small single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and in developing countries. The original model became far more popular than anticipated, selling outside of its target market for uses such as robotics. Peripherals (including keyboards, mice and cases) are not included with the Raspberry Pi. Some accessories however have been included in several official and unofficial bundles.

Click here to access the full article

Main features

Bill of materials

Total cost: ~55.00 USD.

Schematics

Once you've put everything together, your "robot" will look more or less like this:

DC motors direction issues

You may find that the motors are not moving in the direction you expected. If this happens, review the following line in motors.py and play with the LOW and HIGH parameters ;)

def backward():
        GPIO.output(Motor1A,GPIO.HIGH)
        GPIO.output(Motor1B,GPIO.LOW)
        GPIO.output(Motor2A,GPIO.HIGH)
        GPIO.output(Motor2B,GPIO.LOW)

def forward():
        GPIO.output(Motor1A,GPIO.LOW)
        GPIO.output(Motor1B,GPIO.HIGH)
        GPIO.output(Motor2A,GPIO.LOW)
        GPIO.output(Motor2B,GPIO.HIGH)

def turnLeft():
        print("Going Left")
        GPIO.output(Motor1A,GPIO.HIGH)
        GPIO.output(Motor1B,GPIO.LOW)
        GPIO.output(Motor2A,GPIO.LOW)
        GPIO.output(Motor2B,GPIO.HIGH)

def turnRight():
        print("Going Right")
        GPIO.output(Motor1A,GPIO.LOW)
        GPIO.output(Motor1B,GPIO.HIGH)
        GPIO.output(Motor2A,GPIO.HIGH)
        GPIO.output(Motor2B,GPIO.LOW)

Web interface

Once the Raspberry Pi is up and running, connected to a wifi network and the L298N driver is powered by 4AA batteries, you should be able to control your robot by accessing http://raspberry_ip:8000/