• raspberry pi
  • National Centre for Computing Education logo

Robotics With Raspberry Pi: Build and Program Your First Robot Buggy

Build and program your first robot buggy using a Raspberry Pi, learning how to connect motors, add sensors and write algorithms.

5,241 enrolled on this course

Educators are currently active on this course

Robotics With Raspberry Pi: Build and Program Your First Robot Buggy

Learn robotics by building a robot buggy and controlling it with a Raspberry Pi

On this course from the Raspberry Pi Foundation, you’ll build a robot buggy controlled by a Raspberry Pi.

You’ll start by learning how to connect motors to your Raspberry Pi, and how to write a Python program to control them to move your buggy. You’ll move on to adding sensors to your robot and writing algorithms that use the inputs from these sensors, giving your robot the ability to follow lines and avoid obstacles.

You’ll examine the wider context of modern robotics, and think about how robotics affects society.

Download video: standard or HD

Skip to 0 minutes and 3 seconds How can you build your own robot using a Raspberry Pi computer? How can you program the motors of a buggy in Python? How can you design an algorithm so your robots avoid obstacles and follows lines? This free course will teach you how to make your own robot buggy. You will learn about physical computing and programming input and output components, such as motors and sensors. And you will consider the effects of robots on society. You’ll also take part in practical activities to design and customise your buggy. This three week course contains peer led discussions, trainer interaction, and feedback on your knowledge as you progress. You can learn whenever and wherever you want.

Skip to 0 minutes and 43 seconds So whether you’re a teacher with students of your own or simply curious about physical computing with a Raspberry Pi, this course will help you build and program your first robot buggy. Sign up now at rpf.io/robotics.


  • Week 1

    Building a mobile robot

    • Introduction to robotics

      Why is robotics important in the modern world?

    • Connecting and programming motors

      Learn how to connect motors and program them using a Raspberry Pi.

    • Building the buggy

      Build the chassis of your buggy and attach components to it.

    • End of week one

      Congratulations on completing week one of the course!

  • Week 2

    Automating actions using distance sensors

    • Welcome to week two

      Welcome to week two of the course!

    • Sensing the physical world

      Learn about how robots use sensors to understand the world around them.

    • Adding a distance sensor to the buggy

      Learn about how ultrasonic distance sensors work and attach one to your buggy.

    • Navigating obstacles autonomously

      Program your robot buggy so that it can avoid obstacles.

    • End of week two

      Congratulations on completing week two of the course!

  • Week 3

    Allowing robots to follow lines

    • Welcome to week three

      Welcome to week three of the course!

    • Line sensing robots

      Learn about how line sensors work and how they are used in robotics.

    • Adding a line sensor to the buggy

      Attach two line sensors to your robot buggy and test that they work.

    • Developing line following algorithms

      Program your robot to follow a line.

    • Future of robotics

      How might robots affect different sectors in the future?

When would you like to start?

Start straight away and learn at your own pace. If the course hasn’t started yet you’ll see the future date listed below.

  • Available now

Learning on this course

If you'd like to take part while our educators are leading the course, they'll be joining the discussions, in the comments, between these dates:

  • 4 Oct 2021 - 25 Oct 2021

On every step of the course you can meet other learners, share your ideas and join in with active discussions in the comments.

What will you achieve?

By the end of the course, you‘ll be able to...

  • Describe the advantages of using robotics to teach computer science
  • Produce a robot buggy that can move in particular patterns, avoid obstacles, and follow a line
  • Develop suitable algorithms for your robot depending on the task
  • Demonstrate how to control a variety of components using the GPIO Zero Python library
  • Discuss different uses of robotics and the components that they may use

Who is the course for?

This course is for people with little or no experience with physical computing, who want to create their first robot.

Ideally you should have some basic familiarity with Python, for example from our Programming 101 course.

It is particularly well-suited for teachers delivering lessons up to GCSE level or equivalent, who are looking for engaging programming activities for their classrooms.

What software or tools do you need?

This course requires you to have the following:


  • Raspberry Pi 3B, 3B+, or 4
  • Motor controller board
  • Two 3V–6V DC motors
  • Two wheels
  • Ball caster (unless using more than two wheels)
  • An Ultrasonic Distance Sensor (UDS)
  • Two resistors for splitting the voltage if the UDS is 5V (e.g. a 1200 and a 2200 Ohm resistor)
  • Two line-following sensors
  • Jumper leads (female-to-female and male-to-female) or wire
  • AA battery holder (for four AA batteries)
  • Four AA batteries
  • A USB powerbank (to power the Raspberry Pi)
  • Soldering iron and solder
  • Wire strippers
  • Scissors
  • Screwdriver
  • A small cardboard box for the chassis (can be plastic, wood, metal, etc.)
  • Black tape and white paper or card (to make a track with a black line for the line-following robot)

The hardware components and tools are listed in this document. This list includes suggested models, types and pictures of each component, although alternatives are also available.


  • The latest version of the Raspbian operating system
  • An IDE of your choice

Additional extras

  • Adhesives (duct tape / electrical tape, putty, glue, etc.)
  • Cable ties or velcro straps
  • GPIO reference card

Who will you learn with?

Alex is a Learning Manager at the Raspberry Pi Foundation and Computer Science teacher. When not coding, he enjoys table tennis, gaming and going for walks in the woods.

Nina manages Raspberry Pi's translation community to make our learning resources accessible to anyone, regardless of the language they speak.

Who developed the course?

Raspberry Pi Foundation

The Raspberry Pi Foundation works to put the power of digital making into the hands of people all over the world, so they are capable of understanding and shaping our increasingly digital world.

National Centre for Computing Education

This course is part of our professional development teacher programme for the National Centre for Computing Education (NCCE). Our nationally-recognised certificates cater for all levels of teaching.

Funded by the Department for Education and supporting partners, we aim to transform the way computing is taught in schools across England, and enable more young people to benefit from studying this important subject.


supported by

Google logo

Join this course

Start this course for free, upgrade for extra benefits, or buy Unlimited to access this course and hundreds of other short courses for a year.



Join free and you will get:

  • Access to this course for 5 weeks



Upgrade this course and you will get:

  • Access to this course for as long as it’s on FutureLearn
  • A print and digital Certificate of Achievement once you’re eligible


$189.99 for one year

Buy Unlimited and you will get:

  • Access to this course, and hundreds of other FutureLearn short courses and tests for a year
  • A printable digital Certificate of Achievement on all short courses once you’re eligible
  • The freedom to keep access to any course you've achieved a digital Certificate of Achievement on, for as long as the course exists on FutureLearn
  • The flexibility to complete your choice of short courses in your own time within the year

Find out more about upgrades or Unlimited.

Available until 22 November 2021 at 23:59 (UTC). T&Cs apply.

Learning on FutureLearn

Your learning, your rules

  • Courses are split into weeks, activities, and steps, but you can complete them as quickly or slowly as you like
  • Learn through a mix of bite-sized videos, long- and short-form articles, audio, and practical activities
  • Stay motivated by using the Progress page to keep track of your step completion and assessment scores

Join a global classroom

  • Experience the power of social learning, and get inspired by an international network of learners
  • Share ideas with your peers and course educators on every step of the course
  • Join the conversation by reading, @ing, liking, bookmarking, and replying to comments from others

Map your progress

  • As you work through the course, use notifications and the Progress page to guide your learning
  • Whenever you’re ready, mark each step as complete, you’re in control
  • Complete 90% of course steps and all of the assessments to earn your certificate

Want to know more about learning on FutureLearn? Using FutureLearn

Learner reviews

Learner reviews cannot be loaded due to your cookie settings. Please and refresh the page to view this content.

Do you know someone who'd love this course? Tell them about it...