Mobile Robot
Implement controller and image-processing driven mobile robot control using a TT motor and a universal caster.
Roadmap
Section titled “Roadmap”This page is the guide for the 'Mobile Robot' node on the roadmap below.
This guide assumes you have completed the smabo-esp32 setup.
Overview
Section titled “Overview”This page explains how to implement the "Mobile Robot" feature.
Specifically, you will implement:
-
Controller control of the mobile robot
-
Image-processing based control of the mobile robot
Required Parts
Section titled “Required Parts”In addition to the parts from smabo-esp32, you need the following.
| Part | Example (Japanese shop) | Notes |
|---|---|---|
| Tires for the toy DC motor | link | Compatible tires are fine too. |
| TT motor | link | The version with connector pins is recommended — easier to plug into a breadboard and less likely to slip out. Many compatible motors exist, but if the dimensions differ significantly from a standard TT motor, it may not mount correctly — please check carefully. |
| Universal caster S | link | - |
3D Printing Parts
Section titled “3D Printing Parts”Print the newly added parts on your 3D printer.
The software used to drive a 3D printer varies by model, so this section only covers the key points rather than exact settings.
Print the following parts in the orientation shown.
-
smabo-hardware/stl/mobile_robot/dc_motor_caster.stl

-
smabo-hardware/stl/mobile_robot/tt_motor/tt_motor_bottom.stl

- smabo-hardware/stl/mobile_robot/tt_motor/tt_motor_stopper1.stl × 2
-
Print two — one for each motor (left/right).

-
- smabo-hardware/stl/mobile_robot/tt_motor/tt_motor_stopper2_LR.stl
-
Print one — the left and right stoppers are joined into a single part.

-
Assembly
Section titled “Assembly”Assemble the required parts as shown in the video below.
※ The video also includes parts printed in earlier guides.
Wiring
Section titled “Wiring”Wire according to the tables below.
In the tables below, "Point A" and "Point B" are directly connected in the circuit.
Battery
Section titled “Battery”| Point A | Point B | Notes |
|---|---|---|
| Battery box (+) | Breadboard + rail (right side) | From here on, the right side is the 6 V rail |
| Battery box (-) | Breadboard - rail | - |
| Point A | Point B | Notes |
|---|---|---|
| ESP32 3.3V | Breadboard + rail (left side) | From here on, the left side is the 3.3 V rail |
| ESP32 GND | Breadboard - rail | - |
TB6612FNG
Section titled “TB6612FNG”| Point A | Point B | Notes |
|---|---|---|
| TB6612FNG PWMA | ESP32 pin set in config.json dc/pins/pwma |
Default pins: - config.esp32-classic.json: GPIO 32 - config.esp32s3-devkitc1.json: GPIO 4 |
| TB6612FNG AIN2 | ESP32 pin set in config.json dc/pins/ain2 |
Default pins: - config.esp32-classic.json: GPIO 33 - config.esp32s3-devkitc1.json: GPIO 5 |
| TB6612FNG AIN1 | ESP32 pin set in config.json dc/pins/ain1 |
Default pins: - config.esp32-classic.json: GPIO 25 - config.esp32s3-devkitc1.json: GPIO 6 |
| TB6612FNG STBY | ESP32 pin set in config.json dc/pins/stby |
Default pins: - config.esp32-classic.json: GPIO 26 - config.esp32s3-devkitc1.json: GPIO 7 |
| TB6612FNG BIN1 | ESP32 pin set in config.json dc/pins/bin1 |
Default pins: - config.esp32-classic.json: GPIO 27 - config.esp32s3-devkitc1.json: GPIO 15 |
| TB6612FNG BIN2 | ESP32 pin set in config.json dc/pins/bin2 |
Default pins: - config.esp32-classic.json: GPIO 14 - config.esp32s3-devkitc1.json: GPIO 16 |
| TB6612FNG PWMB | ESP32 pin set in config.json dc/pins/pwmb |
Default pins: - config.esp32-classic.json: GPIO 12 - config.esp32s3-devkitc1.json: GPIO 17 |
| TB6612FNG VM | Breadboard + rail (right side) | Motor power (6 V) |
| TB6612FNG VCC | Breadboard + rail (left side) | Logic power (3.3 V) |
| TB6612FNG GND | Breadboard - rail | The TB6612FNG has three GND pins; connect all of them to the breadboard's - rail |
TT motor
Section titled “TT motor”| Point A | Point B | Notes |
|---|---|---|
| TT motor (left wheel) terminal 1 | TB6612FNG A01 | - |
| TT motor (left wheel) terminal 2 | TB6612FNG A02 | If the wheel turns the wrong way, swap terminals 1 and 2 |
| TT motor (right wheel) terminal 1 | TB6612FNG B02 | - |
| TT motor (right wheel) terminal 2 | TB6612FNG B01 | If the wheel turns the wrong way, swap terminals 1 and 2 |
The wiring diagram for the ESP32-DevKitC (with the defaults in config.esp32-classic.json) is shown below (the breadboard alone doesn't have enough holes, so the TB6612FNG is wired on a mini breadboard).

Finished Result
Section titled “Finished Result”The finished robot from this guide looks like this:

Operation
Section titled “Operation”Startup Procedure
Section titled “Startup Procedure”Follow the steps in this startup procedure.
Then open the "Config" tab in smabo-web.
Enabling the DC Motor
Section titled “Enabling the DC Motor”In the smabo-web "Config" tab, enable:
- "Modes/dc_drive"

Manual Control
Section titled “Manual Control”This section explains controller-based control.
You can control smabo's mobile robot using the controller on the "Drive" tab.

Image-Processing Control
Section titled “Image-Processing Control”This section explains image-processing based control.
In the "Vision" tab's "Detection" section:
- enable "Enabled", and
- set any recognition mode (here, "color" mode is configured to recognize a blue object)

Next, under "Behaviors",
- enable "Drive follow".

In Drive follow mode, the mobile robot moves forward/backward so that the recognized object's apparent size (as seen by the camera) matches the "Target size" (you can check the exact size via the blue box in the preview screen).

Once configured, bring the recognition target in front of the smartphone camera and smabo's mobile robot will move to follow it.
Next, we'll cover the following node on the roadmap: