Raspberry Pi Zero 2W Robot Controller Board for L0Cost Robots Built on Matrix or Strip Board

by tekyinblack in Circuits > Raspberry Pi

39 Views, 0 Favorites, 0 Comments

Raspberry Pi Zero 2W Robot Controller Board for L0Cost Robots Built on Matrix or Strip Board

IMG_0914.JPEG
IMG_0910.JPEG
IMG_0915.JPEG
IMG_0916.JPEG
IMG_0917.JPEG

As a follow-on to the Arduino Robot Controller and Pico (and Pico W) Robot Controller cards, this is a similar card supporting the much more powerful Raspberry Pi Zero 2 W.

The purpose of this design is to help the robot builder on a budget construct a very effective robot controller card to be used on L0Cost robots typically aimed at $20 builds using SG90 servos and TT motors.

Unfortunately using this controller card blows that budget, but if you're able to still buy one of the original $5 pi zeros or a cheap second-hand one then this will fit. Much of the design of this board is to encourage building similar budget controllers instead of buying a less optimal controller card off the shelf.

The card supports two DRV8833 H-Bridge motor controllers to run four DC motors or two stepper motors, a connector point for an SR-04 Ultrasonic detector is available, as are four connector points for I2C devices, made up of two four pin sockets and two eight pin sockets intended to facilitate the MPU-6050 accelerometer and gyroscope to be plugged directly onto the board.

A piezo sounder is fitted to the board as well as a power LED, a power on switch, a 5v regulator and a simple switch which can be re-plugged to proved the required input.

The board is also intended to be used with the L0Cost Robot Controller and Robot Controller Console described elsewhere.

There are lots of commercially available circuit boards which accommodate a Raspberry Pi Pico development board and provide interfaces for building robots, but for the L0Cost Robot project the cost of these automatically put them out of reach.

The design was born out of competing in the PiWars 2024 competition and recognising the need for a custom design which did just what was needed. Separately described is a an add-on I2C control and display card.

This is a simple design which an enthusiast can build easily and cheaply using readily available matrix or stripboard.

Features are:

Power Switch

Very useful but I'm always amazed when commercial boards don't include one.

On board power regulator

The board can accept up to 10.8 volts, a limitation of the DRV8833 motor controllers but ok for six nicads or a pair of serial lithium batteries. If the board is being powered by a 5V supply then the regulator can be replaced by a linking blank.. Provision has been made on the board to allow a pin jumper to be used to supply either 5V or 3.3V to the lower power rail which supplies one of the I2C interfaces and the sensor connectors.

Power LED

It's big and in the middle of the board to make it obvious without being intrusive.

Start/Stop button

This makes operating the robot a lot easier than having to plug a USB in to run a program or switch on and hope! Alternatively, this button can be rewired as a reset switch. I may produce a version omitting one of the I2C interfaces and adding a selection switch but there is also a design for a display and control add-on for these boards.

Piezo sounder

While this could be used for giving the robot some musical accompaniment, it's primarily included to give audible feedback for a robot operator who has difficulty seeing a visual indicator, and that could be anyone in bright sunlight, but do consider putting an audible signal in a design to make it fun for everyone.

2 x DRV8833 dual H-bridges to control 4 DC motors individually

For many robots, two DC motors will be sufficient, but with more complex designs, such as using mecanum wheels, four are required. This is also the case if the robot uses a pair of stepper motors for propulsion. If only two DC motors are needed, then the second DRV8833 module isn't required, saving costs. This also frees up 4 GPIO ports which can be accessed via the sockets.

I2C interface for MPU-6050 accelerometer/gyroscope

The board has been laid out to accommodate an MPU-6050 module but also any I2C connection could be afforded. The MPU-6050 is included as an advanced robot function such that the attitude of the robot can be determined, aiding autonomous operation. Two eight pin sockets and two 4 pin sockets have been included but these can be adapted or omitted as required.

Interface for HR-SR04 ultrasonic sensors

A specific socket interface has been included for the very useful HR-SR04 ultrasonic sensors which provide robust, if basic, distance and object sensing. The socket has dropper resistors wired to it to enable the module to be run at 5V but not exceed the 3.3V pin limit on the Pi. This has been setup for single pin operation.

Pin breakouts with power rail for servos

The pinouts on the board have been arranged to allow easy direct connection of low powered servos to the board (such as the SG90). Higher powered servos will need independent power supplies.

Pin breakout with power rail for serial comms and all spare GPIOs

The UART pins on the Pico have not been dedicated to any onboard feature to allow simple serial communications from the board with the L0Cost robot controller or any other processing module so that the board can be used either as a main robot controller or as an offload processor, running the basic robot control features.

For use with Raspberry Pi Zero, Zero W or Zero 2W

The board can be used with either the Zero or Zero W so the robot can have Wi-Fi communications features added easily with a change of board. This is a Raspberry Pi board so program it with the language you prefer.


Supplies

IMG_0910c.JPEG
IMG_9939.JPEG

Dupont pcb sockets, bought in job lots of either long strips or packets of multiple sizes.

Dupont pcb pins, bought in strips in various colours

Screw power connectors

Screw motor power connectors

Switches, one latching, one non-latching

LED power indicator with 330R resistor

1k and 2 x 2k resistors for ultrasonic connector

PCB mounted piezo sounder with 2S8055 driver transistor and 1k resistor

DRV8833 motor drivers, one or two as necessary, optional

MPU-6050 gyroscope, optional

Buck voltage regulator

Hookup wire

Matrix or stripboard - the type used is shown in the picture above

Raspberry Pi connector - this is constructed as described in another instructable here.

Board Layout

Pi Controller 10c.png
Pinout 1.png
Pinout 2.png

This is the layout of the board, initially created on Excel and then with wires drawn in Paint.

Initial Assembly

IMG_0228c.JPG
IMG_0226.JPEG

As a starting point, to get the initial layout correct, the sockets and connector pins are put in place, checked for fit and soldered into place. To ensure that the pins are easy to locate upright and keep in place, they have been inserted into lengths of socket strips in the correct order, as seen in the second picture.

Adding Wires

IMG_0903.JPEG
IMG_0907.JPEG

There really aren't that many wires for the complexity of the board. They are all added according to the diagram in step 2. The second picture shows the amount of solder connections underneath.

Adding Modules

IMG_0904.JPEG
IMG_0905.JPEG

Two pictures showing the board being populated with modules. This includes the 5V PSU, the two DRV8833 modules and the MPU6050 gyroscope.

Adding the PI Zero

IMG_0906.JPEG

The Pi Zero is mounted with the HDMI socket facing upwards and the bottom of the pcb facing outwards. It's not an easy place to see the connector pins so care needs to be taken to get the socket and pins correctly aligned.

On a Robot

IMG_0910.JPEG

Here is the Pi controller board mounted on L0Cost Robot Chassis. It's not connected here and is to show how it's mounted. I haven't got far with writing the version of the code for this implementation but will put it on github here when available.

As I develop code for this board I'll be posting it on github.