Raspberry Pi Robots – Basic Motor Control – Episode 1

Robots… Robots… Robots… Everyone loves robots. Not a single person doesn’t. Fact. They are awesome. And I’m going to teach you how to make your first one! That makes me awesome too!

Welcome to Episode 1 of my latest Raspberry Pi Robots series! In this video I will show you how to control a robot wirelessly from a different computer. By the end of this video you will understand a Python program and be able to make your Pi2Go-lite move! Watch the above for all of the details.

INFORMATION (Chronologically of course):

Previous episode (Introductory one!): http://youtu.be/_hDy9WY5UM0

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

My USB WiFi dongle from The Pi Hut: http://thepihut.com/products/usb-wifi-adapter-for-the-raspberry-pi

List of compatible USB WiFi dongles: http://elinux.org/RPi_USB_Wi-Fi_Adapters

PuTTY download from here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html


1) Boot to the desktop with the command: startx
2) Download the code with the command: git clone https://github.com/the-raspberry-pi-guy/robot
3) Download Python package to ensure the libraries all work!: sudo apt-get install python-smbus
4) Navigate into the correct directory with the command: cd robot/pi2go
5) Look at the program with the command: nano motor.py
6) RUN the program with the command: sudo python motor.py

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

The Raspberry Pi Guy


17 comments on “Raspberry Pi Robots – Basic Motor Control – Episode 1
  1. dhruv goel says:

    Good video…but I have a question. Can you please tell me if by running the sudo python motor.py command will automatically write the python commands for us or will we have to write it on our own? Beginner in robotics raspberry pi

  2. Pranav Garg says:

    Nice Video . Please make a video on how to connect pi to board and motor. The whole video was easy. Thanks

  3. manoj kumar sahoo says:

    can I use c/c++ instead of python @raspberrypiguy

  4. nasir gaayte says:

    i code a raspberry and i want my range go infinity
    it is a gpio as gpio
    for x in range(0,10) so i want it
    for x in range(infinity)


  5. Antony says:

    I cant find the wifi config utility you mention. Where can I find it and how do I access it? Assuming of course it is already installed.


    • Antony says:

      I think I may have solved my above problem but I now have a new one. When I open putty and put in my ip address – the box is appearing but the connection times out. I believe mine is opening a different port – number 24. So I am replacing the 22 with 24 in the box. Is that right? Any idea why the connection is timing out?

  6. M3nt0san says:

    Hello, nothing happens with the motors when I run the code. Everything looks good on the terminal but the pi2bot won’t move an inch. Any suggestion?

  7. Dan says:

    JUst followed your very clear video, thank you. Unfortunately when motor.py. Refused to run I realised you had written this for pi2Go lite and I have a pi2Go. Is that why I get the following error? Do you have a pi2go version?

    Trace back (most Recent call last):
    file “motor.py”, line 8, in
    Import pi2go, time
    FIle”/home/pi/robot/pi2go/pi2go.py”, line 96, in
    GPIO?setwarnings(False) # Pah, who needs runtime errors nowadays.! MTB edit
    ATtributeError: ‘module’ object has no attribute ‘setwarnings’

  8. Shon says:

    Hey nice video buddy. I want to control my robot with PS2 remote, i want that code in python. Will you please help me out with it?

Leave a Reply

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