Maker Pi RP2040 a low cost robot controller board

In this article we look at a RP2040 microcontroller board, this one is the Cytron Maker Pi RP2040.

The Maker Pi RP2040 board comes with a 2-channel DC motor driver, 4 servo motor ports and 7 Grove I/O connectors for your next robot project, it also has a few other features on the board such as LEDs on all the GPIO pins, buttons and RGB leds.

When you connect the board to your computer, a new CIRCUITPY drive appears. Explore and edit the demo code (code.py & lib folder). You can either use CircuitPython , MicroPython and C/C++ . There is also support in the Arduino IDE.

The board can be powered via USB, a LiPo battery or via external power using the Vin terminal – if you had motors connected I would recommend the latter option

The DC motor driver on board is able to control either  two brushed DC motors or a single bipolar/unipolar stepper motor from 3.6V to 6V, providing up to 1A current per channel continuously. The built-in test buttons and motor output LEDs allow a  test of the motor driver quickly without the need of writing any code.

Here is a picture of the board showing the features

Features

  • Powered by the Raspberry Pi RP2040
    • Dual-core Arm Cortex-M0+ processor
    • 264KB internal RAM
    • 2MB of Flash memory
    • The exact same specifications with Raspberry Pi Pico
  • Robot controller board
    • 4x Servo motors
    • 2x DC motors with quick test buttons
  • Versatile power circuit
    • 7 Automatic power selection: USB 5V, LiPo (1-cell) or Vin (3.6-6V)
    • Built-in 1-cell LiPo/Li-Ion charger (over-charged & over-discharged protection)
    • Power on/off switch
  • 13x Status indicator LEDs for GPIO pins
  • 1x Piezo buzzer with mute switch
  • 2x Pushbutton
  • 2x RGB LED (Neopixel)
  • 7x Grove ports (flexible I/O options: digital, analog, I2C, SPI, UART…)
  • Preloaded with CircuitPython out-of-the-box

Links

Purchase

Buy MAKER PI RP2040

Examples

Analog read micropython example

[codesyntax lang=”python”]

import machine
import utime

analog = machine.ADC(26)

while True:
    print(analog.read_u16())
    utime.sleep(0.2)

[/codesyntax]

By default there is an example loaded on the RP2040 which does the following

  • On startup:
    • play a melody tune
    • perform a sequential LED lighting (blue LEDs)
  • Forever loop:
    • RGB (Neopixel) LEDs perform color fading
  • Press GP20 push button:
    • light up all blue LEDs
    • run DC Motor 1 forward and DC Motor 2 backward, both at 50% speed
    • move all Servo motors to 0 degree
  • Press GP21 push button:
    • turn off all blue LEDs
    • stop both DC Motor 1 & 2
    • move all Servo motors to 180 degree

Summary

A low priced board which contains the Rp2040 microcontroller, very useful for robotic projects and a couple of features that are useful for beginners to get started. You can use either the popular Circuitpython, Micropython or Arduino IDEs and being a Raspberry Pi microcontroller there are an abundance of resources online

Related posts

Another Raspberry Pi inspired SBC – the Walnut Pi

Raspberry Pi and HMC5883 example in C

Raspberry Pi and SHT31 sensor example in C