Skip to content

Mobile Robot

Implement controller and image-processing driven mobile robot control using a TT motor and a universal caster.

This page is the guide for the 'Mobile Robot' node on the roadmap below.

This guide assumes you have completed the smabo-esp32 setup.

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

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 -

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


    3D-printed mobile robot part dc_motor_caster


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


    3D-printed mobile robot part tt_motor_bottom


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


      3D-printed TT motor stopper tt_motor_stopper1


  • 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.


      3D-printed TT motor stopper tt_motor_stopper2_LR

Assemble the required parts as shown in the video below.

※ The video also includes parts printed in earlier guides.

Wire according to the tables below.

In the tables below, "Point A" and "Point B" are directly connected in the circuit.

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 -
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
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).

Wiring diagram for TT motors with the TB6612FNG driver and ESP32

The finished robot from this guide looks like this:
Completed mobile smabo driven by TT motors

Follow the steps in this startup procedure.

Then open the "Config" tab in smabo-web.

In the smabo-web "Config" tab, enable:

  • "Modes/dc_drive"

Enabling Modes/dc_drive in the smabo-web Config tab

This section explains controller-based control.

You can control smabo's mobile robot using the controller on the "Drive" tab.

Drive controller in the smabo-web Drive tab

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)

Setting smabo-web to detect an object of a chosen color


Next, under "Behaviors",

  • enable "Drive follow".

Enabling Drive follow in Behaviors


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).

Checking the target size with the blue frame in preview


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: