Skip to content

Search the documentation

Kit
Firmware

Mini pins

This page lists the pins of the Mini board. The numbers come from the board’s definition in the firmware. They are GPIO numbers: the numbers the ESP32 chip gives its pins, and the numbers the firmware passes to machine.Pin.

You do not need them to drive the robot. Use robot.left_motor, robot.led1 and the other parts from the Mini page. You need the numbers when you wire something of your own, or when you read the firmware.

The Mini uses the same motor driver as the Smart Car, but the pins are not the same. The board’s definition warns about this: the left and right motors are on each other’s pins, and so are LED 1 and LED 2. These are measured differences, not typing mistakes.

The DRV8833 has two inputs for each motor and no separate enable pin. The firmware sends PWM to the inputs.

Part Signal GPIO
Left motor Input 1 16
Left motor Input 2 17
Right motor Input 1 18
Right motor Input 2 19
Part In code GPIO
LED 1 robot.led1 2
LED 2 robot.led2 15
RGB LED (one WS2812B pixel), data robot.rgb_led 5
Buzzer robot.buzzer 23

The RGB LED is one WS2812B pixel. It has a single data pin, and the firmware drives it with the NeoPixel library, so it does not use one of the chip’s PWM channels. The board’s definition counts 1 pixel.

Part Signal GPIO
Distance sensor Trigger 27
Distance sensor Echo 26
Line sensor, eye 1 (left) robot.line_sensor.read(0) 26
Line sensor, eye 2 (right) robot.line_sensor.read(1) 27

The distance sensor has an echo timeout of 30000 microseconds (30 milliseconds). If no echo comes back in that time, the driver does not report an error. It uses a fixed time of 11640 microseconds, which is how long sound needs to travel 400 centimetres, there and back. The distance is half of that, so distance_cm() gives 200.0 and distance_mm() gives 2000. A clear space in front of the sensor therefore reads 200 centimetres, not -1. A -1 is rare: it only comes if the driver reports an error.

The distance sensor and the line sensor use the same two pins. The chip does not have enough pins for every accessory, so parts that are alternatives share pins, and you choose which one you are using. The board’s definition records this for the Mini as an either-or: the roles are swapped between the two sensors, so they cannot work at the same time.

GPIO Distance sensor Line sensor
26 Echo Left eye
27 Trigger Right eye

Switch one of them on with robot.enable_distance_sensor() or robot.enable_line_sensor().

The board’s definition says the Mini has no battery sensor, no button pin, no I2C bus and no servo pins.

Part PWM frequency
Motors 1000 Hz
LED 1 and LED 2 5000 Hz
Buzzer changes with every note

Timer 0 plays the buzzer’s notes. The board’s definition also sets timer 1 aside for the motor failsafe, a safety stop for the motors.