Simple Raspberry Pi web-controlled robot with video live streaming.
Story
gatoBot
gato is the spanish translation for cat.
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.
Main features
- Controlled via web browser (which gives you the SUPER POWER of scaring your cats when not at home)
- Live video streaming.
Bill of materials
- 1 x Raspberry Pi Zero W board: ~ 10.00 USD.
- 1 x Raspberry Pi compatible camera: ~15.00 USD.
- 1 x 4xAA battery holder: ~1.00 USD.
- 1 x 4.000 mAh USB battery: ~10.00 USD.
- 1 x Robot car chassis with 2 DC motors: ~15.00 USD.
- 1 x L298N dual H bridge DC motor driver: ~4.00 USD.
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
/