Raspberry Pi Robots – Obstacle Avoidance – Episode 2

Robots… Robots… Robots… Everyone loves robots. Not a single person doesn’t. Fact. They are awesome. And here’s how to make your own one!

Welcome to Episode 2 of my latest Robots series! In this video I will show you how to make a robot autonomously avoid obstacles. By the end of this video you will understand a Python program and be able to let loose a never-colliding Pi2Go-lite into the wild. Watch the above for all the details.

INFORMATION (Chronological order):

Previous episode (Episode 1 – Basic Motor Control): https://www.youtube.com/watch?v=rESbe0dGbls

Pi2Go-lite: http://4tronix.co.uk/store/index.php?rt=product/product&product_id=400

Panasonic Eneloops: http://www.amazon.co.uk/Panasonic-eneloop-BK-3MCCE-8BE-Batteries/dp/B00JZBX8DQ/ref=sr_1_1?ie=UTF8&qid=1419755694&sr=8-1&keywords=panasonic+eneloop

Recently price cut Model B+: https://www.raspberrypi.org/price-cut-raspberry-pi-model-b-now-only-25/

My WiFi dongle: http://thepihut.com/products/usb-wifi-adapter-for-the-raspberry-pi


1) Navigate into the correct directoy (from the default one) with the command: cd robot/pi2go
2) Update the robot software in order to grab the latest program, avoider.py. Use the command: git pull
3) Look at the program with the command: avoider.py
4) RUN the program with the command: sudo python avoider.py

Thank you for watching! Make sure you stay tuned by subscribing! Don’t forget to like, share and comment!

The Raspberry Pi Guy


4 comments on “Raspberry Pi Robots – Obstacle Avoidance – Episode 2
  1. Zahra says:

    I am a new beginner with raspberry pi , opencv , and python .. I have to use those all in my senior project .. Can u help me ? Can I communicate with u via email ?

  2. Arick says:


    Can you guide me about SCRATCH controlling the PI2GoLite.
    So far I suceeded in cotroling its motors and leds, but have difficulties with the ultrasonic sensors which I do no see how to use for obstacle avoidance, the distance measureing program of pin 8 does not seem to work


    Arick Elshtein

  3. Arick says:

    Thanks for your reply
    Unfortunately there is nothing there on how to use Scratch/GPIO for using the Ultrasonic sensor for distance measuring.

    Maybe there is another place to find such advice


Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.