• 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.

2,806 enrolled on this course

Robotics With Raspberry Pi: Build and Program Your First Robot Buggy
The CPD Certification Service

This course has been certified by the CPD Certification Service as conforming to continuing professional development principles. Find out more.

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

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?

Who is this accredited by?

The CPD Certification Service
The CPD Certification Service:

The CPD Certification Service was established in 1996 and is the leading independent CPD accreditation institution operating across industry sectors to complement the CPD policies of professional and academic bodies.

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

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 at 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
  • 2 x 3V - 6V DC motors
  • 2 x wheels
  • Ball caster (unless using more than 2 wheels)
  • Ultrasonic distance sensor (between 1 and 2)
  • 2 x line following sensors
  • Jumper leads (female-to-female and male-to-female) or wire
  • AA battery holder (for 4 AA batteries)
  • 4 x AA batteries
  • A USB battery pack (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.)

You can view most of the required components on this AliExpress wish list, but they can be ordered / bought anywhere, and 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

National Centre for Computing Education courses


supported by

Google logo

Learner reviews

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

Unlimited (New!)
$279.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.