Course Module • Jillur Quddus

3. Build a Robot Car

Python Taster Course

Build a Robot Car

Python Taster Course

Jillur Quddus • Founder & Chief Data Scientist • 1st November 2022

  Back to Course Overview

Introduction

In this module we shall build a robot car in preparation for it to be programmed using Python so that it may follow simple and advanced instructions.

1. Hardware Requirements

You will require the following hardware components and tools to build our robot car.

1.1. Components

1.2. Other Tools

2. Components Overview

The following table provides a brief overview of each of the major hardware components listed above.

Hardware ComponentDescription
Micro:bit V2
VendorBuy
The BBC Micro:bit is a pocket-sized computer that enables budding engineers and developers to learn how software and hardware work together. It has an LED light display, buttons, sensors and numerous input/output (I/O) features that, when programmed (using either Python, JavaScript or via a visual code builder), let it interact with the world around it. It can also be easily extended and used to control other devices such as the Elecfreaks Ring:bit Car.
Ring:bit Car V2
VendorBuy
The Elecfreaks Ring:bit Car is a small DIY smart car that is controlled and driven by the BBC Micro:bit. The Ring:bit car extends the Micro:bit's three GPIO ports (3 pins), allowing different sensors and components to be easily attached to the Micro:bit.
Ring:bit Car V2 Accessories Kit
VendorBuy
The accessories kit includes dedicated modules designed for the Ring:bit car. The tracking module enables the detection of edges and black lines. The light bar module delivers full-colour LEDs. And the Sonar:bit module enables obstacle detection and avoidance.

3. Assembly Instructions

Please follow the steps outlined in the following ordered subsections to assemble the Ring:bit car and to attach the tracking and Sonar:bit extension modules respectively.

3.1. Components List

Ring:bit Car V2 base components
Ring:bit Car V2 base components - click to enlarge

Check that you have the following components, in the correct quantity, by laying them out on a table.

ComponentQuantity
Micro:bit V21
Ring:bit Car V2 Board1
Front Board1
Back Board1
Base Board1
Side Board2
Expansion Board1
Wheel2
Binding Post1
360° Servo2
Castor Wheel1
Screw (Flat)5
Tapping Screw5
Rivet2
Screwdriver1
AAA 1.5V Alkaline battery3
USB micro-B compatible data transfer USB cable1

3.2. Servos and Wheels

Fix servos and wheels to the side boards
Fix the servos and wheels to the side boards (image credits: Elecfreaks)
  1. Place one of the servos into the pre-cut hole of one of the side boards, ensuring that the jump wires face the smaller end of the side board (as opposed to the larger end).
  2. Secure the servo to the side board using 2 x tapping screws.
  3. Gently slide a wheel onto the servo and use 1 x tapping screw to secure it into place.
  4. Repeat steps 1 - 4 for the other servo and side board.

3.3. Base Board

Fix the castor wheel to the base board
Fix the castor wheel to the base board (image credits: Elecfreaks)
  1. Locate the castor wheel and base board.
  2. Secure the castor wheel to the base board using the 2 x rivets.

3.4. Car Chassis

Connect all the boards together
Connect all the boards together (image credits: Elecfreaks)
  1. Connect the back board, the base board (that is attached to the castor wheel), the front board and the special expansion board to the left side board (that is attached to the servo and wheel) using the pre-cut holes.
  2. Connect the same boards to the right side board in order to form the chassis (or body) of our robot car.

3.5. Binding Post

Attach the binding post
Attach the binding post (image credits: Elecfreaks)
  1. Unscrew the screw from the end of the binding post.
  2. Push the binding post through the pre-cut round hole of one of the side boards and into the opposite side board.
  3. Re-screw the screw into the end of the binding post in order to secure it into position.

3.6. Micro:bit Controller

Attach the Micro:bit to the Ring:bit
Attach the Micro:bit to the Ring:bit (image credits: Elecfreaks)
  1. Place the Micro:bit V2 board on top of the Ring:bit V2 board.
  2. Use the 5 x screws (flat) to secure the Micro:bit V2 board to the Ring:bit V2 board.

3.7. Jump Wires

Connect the jump wires
Connect the jump wires (image credits: Elecfreaks)
  1. Connect the right servo to the Ring:bit V2 board via the pins labelled 2VG, making sure that the ground wire (brown) is connected to the G pin (otherwise the servo and hence wheel will not work).
  2. Connect the left servo to the Ring:bit V2 board via the pins labelled 1VG, making sure that the ground wire (brown) is connected to the G pin (otherwise the servo and hence wheel will not work).
  3. Connect the special expansion board to the Ring:bit V2 board via the pins labelled 0VG, making sure that the ground wire (brown or black) is connected to the G pin (otherwise add-on modules such as the infrared tracking module connected to the special expansion board will not work).
  4. Place the Ring:bit V2 board onto the front board of the car body.
  5. Tidy the wires so that they are contained within the body of the Ring:bit car.

For further information regarding the Ring:bit's GVS pins, please refer to the next module of this taster course.

3.8. Base Ring:bit Car

The assembly of the base Ring:bit Car V2 is now complete!

Base Ring:bit Car V2
Base Ring:bit Car V2 (image credits: Elecfreaks)

3.9. Tracking Module

The optional tracking module is equipped with two infrared sensors that enables the Ring:bit Car to perform edge detection and thus follow a black-lined route.

Tracking module components
Tracking module components

To install the optional tracking module, please follow the ordered steps below.

  1. Place the tracking module on the special expansion board.
  2. Use the 2 x screws to secure the tracking module to the special expansion board.
Attach the tracking module to the special expansion board
Attach the tracking module to the special expansion board (image credits: Elecfreaks)

3.10. Sonar:bit Module

The optional Sonar:bit module is an ultrasonic sensor that enables the Ring:bit Car to detect, and thus avoid, obstacles.

Sonar:bit module components
Sonar:bit module components

To install the optional Sonar:bit module, please follow the ordered steps below.

  1. Attach one end of the Sonar:bit board to the back board of the Ring:bit car using 2 x rivets.
  2. Attach the Sonar:bit ultrasonic sensor to the other end of the Sonar:bit board using the further 2 x rivets.
  3. Connect the Sonar:bit module to the Ring:bit V2 board via the pins labelled 0VG, making sure that the ground wire (brown or black) is connected to the G pin (otherwise the ultrasonic Sonar:bit module will not work).
Attach the Sonar:bit module to the Ring:bit board
Attach the Sonar:bit module to the Ring:bit board (image credits: Elecfreaks)

3.11. Extended Ring:bit Car

The assembly of the Ring:bit Car V2, extended with the tracking module and the Sonar:bit module, is now complete!

Extended Ring:bit Car V2
Extended Ring:bit Car V2

Summary

In this module we have built a robot car in preparation for it to be programmed using Python so that it may follow simple and advanced instructions.

What's Next

In the next module we shall program our robot car to follow simple and advanced instructions including moving forwards and reversing, following black lines, moving towards bright light sources, and automatically detecting and avoiding obstacles.