Picture of Building robots with Raspberry Pi and Python
The goal of this tutorial is to help you begin programming with Python to control your Arduino robots with a Raspberry PI. We will go over the basics like installation and some simple examples to control your robot from a Python GUI from Raspberry PI.

Remove these adsRemove these ads by Signing Up

Step 1: Parts list

Picture of Parts list
In this tutorial we are going to use the following items :

1.   Raspberry PI ( with monitor, USB hub, keyboard, mouse,and WIFI Dongle)

2.   Arduino UNO or compatiable (USB cable)

3.   Wifi Router

Now when it comes to robot bases there are many kits available in size and complexity. In this tutorial I have decided on using this setup with a 12v battery that will give us long run times and high load capacity. And a power distribution board with regulated 12v and 5v power outputs that makes it easy to deliver power to our robot.

4.   Robot Base

5. Motor Driver

6. Power Distribution Board

7. 12volt  7amp hr Battery

Step 2: Introduction to Python

Picture of Introduction to Python
Python is a general purpose interpreted, interactive, object-oriented, high-level programming language that was created by Guido van Rossum in the late eighties. Python allows users to write code with clear, readable syntax with a growing number of support libraries for various tasks that is open source and has a community based around its development. Here are some helpful links that might come in handy when starting out.

Cheat Sheet

Python Howto 
caffewmilk6 days ago

Thank you for sharing. I did a search for raspberry pi robot tutorial and your instructable was at the top 3 links. I have a more genera unrelated question and I apologize for it: how do you guys come up with the funds for all these fun projects?

I'm looking forward to building a raspberry pi robot. Thanks.

Epic1214 months ago

Do u have the circuit diagram of this robot? If you have please share.

jamesthequack6 months ago

Very very nice! I like your style!

ecommgeek9 months ago

What kind of wire do I need to hook this all up?

ZRob314 (author)  ecommgeek8 months ago

We normally just use jumper wires similar to these:

You will probalby want some male-male and male-female

MoserLabs10 months ago

Nice work! I'm trying to wrap my mind around how the R-Pi communicates to the Arduino though. From the one image it's got a 5V connection to the Arduino, but there aren't any data connections from Pi to Arduino?

dhill291 year ago

Hi Fells, there was a problem with the sketch provided. To make it work you will need to change

int r_motor_pwm = 10;


int r_motor_pwm = 3;

ZRob314 (author)  dhill291 year ago

This depends on the version of the motor driver listed above or if a different motor drive is used. Always double check the data sheets or specs on your components/devices against your code to avoid any confusion during setup/operation.

Thanks ZRob, That is very good advice. I had bought the exact parts linked to from you and it just is a little thing that tripped me up as a beginner. I wanted to make sure any other inexperienced people would be able to find the problem easily.
epierce1 year ago
This works sweet! Have you tried to run it with NetIO on an Android or Iphone device?
epierce1 year ago
Zrob thanks for helping a 50 year old realize his bot dreams!! I have been hitting a brickwall with this project for 6 months!! Unfortunatley my wife is screaming at me for yelling ITS ALIVE!!! at 1:00 am!!LOL II now realize why the villagers actually destroyed Dr. Frankenstein's lab. Any way to program the button control to an android tablet or phone?
purpulhaze1 year ago
Great instructable! I think I'm gonna try this as I have all the parts on hand. Do you know how one would go about adding live video streaming to something like this? I have a camera module on the way and also a compatible webcam. Though I wasn't impressed with the usb webcam performance.
nerd74731 year ago
Selenae1 year ago
Thank you for your post, I was blocked with the python part of my project and you give me some robust base to begin my learn :-)
uavguy1 year ago
Wow this is so awesome! I just got a Raspberry Pi and I have been wanting to use it for robotics. Thank you for taking the time to put this together I know it will be a big help to me!