Basic Wheeled Robot

Build your first OctoMY™-controlled robot

Basic Wheeled Robot

Build a simple two-wheeled robot controlled by OctoMY™. This tutorial walks through hardware assembly, wiring, and basic control.

Pro Tip

Don't have all the parts? Start with a robot kit! 2WD Smart Car Kits are inexpensive and include chassis, motors, wheels, and often a motor driver - everything you need except the Arduino and phone.


What you'll build

A differential-drive robot that:

  • Responds to Remote control
  • Uses an Android phone as the brain
  • Can be extended with sensors and plans
        ┌───────────────────┐
        │   Android Phone   │
        │   (Agent brain)   │
        └─────────┬─────────┘
                  │ USB
        ┌─────────┴─────────┐
        │  Arduino + ArduMY │
        └────┬─────────┬────┘
             │         │
        ┌────┴───┐ ┌───┴────┐
        │ Motor  │ │ Motor  │
        │  Left  │ │ Right  │
        └────────┘ └────────┘

Parts list

Required components

Component Quantity Notes
Android phone 1 Android 8+
Arduino Mega/Uno 1 Mega recommended
Motor driver (L298N) 1 Dual H-bridge
DC geared motors 2 6V, with encoders optional
Wheels 2 Matched to motors
Caster wheel 1 For stability
USB OTG cable 1 Phone to Arduino
Battery pack 1 6-12V for motors
Power bank 1 For phone (optional)
Chassis 1 Acrylic, 3D printed, or kit

Tools

  • Screwdriver set
  • Soldering iron (optional)
  • Wire strippers
  • Hot glue gun

Did You Know?

The L298N motor driver can handle up to 2A per channel and 12V motors. For larger robots with more powerful motors, consider the BTS7960 driver which handles 43A!


Step 1: Prepare the chassis

Option A: Use a kit

Many robot chassis kits are available:

  • 2WD Smart Car Kit
  • Pololu Romi Chassis
  • Any differential drive platform

Option B: 3D print

Print a simple base plate with motor mounts:

    ┌─────────────────────────────┐
    │  ○                      ○   │  ← Mounting holes
    │                             │
    │  [Motor]          [Motor]   │  ← Motor mounts
    │     ○                ○      │
    │                             │
    │          [Caster]           │  ← Rear caster
    │             ○               │
    └─────────────────────────────┘

Option C: Acrylic/wood

Cut a simple rectangular base (15x20 cm works well).


Step 2: Mount the motors

Attach motors

  1. Secure motors to chassis using brackets or screws
  2. Ensure wheels clear the chassis edge
  3. Motors should face outward on opposite sides

Add the caster

Mount the caster wheel at the rear center:

  • Should touch ground with chassis level
  • Allows robot to pivot smoothly
   [Left Motor]═════════════════[Right Motor]
        │                           │
        ▼                           ▼
    (Wheel)      [Chassis]      (Wheel)
                     │
                  (Caster)

Step 3: Wire the motor driver

L298N connections

                     L298N Motor Driver
    ┌─────────────────────────────────────────────┐
    │                                             │
    │   [12V+] [GND] [5V]     Motor power input   │
    │                                             │
    │   [ENA] [IN1] [IN2] [IN3] [IN4] [ENB]      │
    │                                             │
    │   [OUT1] [OUT2]    [OUT3] [OUT4]           │
    │   └──Motor A──┘    └──Motor B──┘           │
    └─────────────────────────────────────────────┘

Wiring diagram

L298N Pin Connect To
12V+ Battery positive
GND Battery negative + Arduino GND
5V Arduino 5V (or leave as output)
ENA Arduino D9 (PWM)
IN1 Arduino D8
IN2 Arduino D7
IN3 Arduino D6
IN4 Arduino D5
ENB Arduino D10 (PWM)
OUT1/OUT2 Left motor
OUT3/OUT4 Right motor

Security Consideration

Always use a separate power source for motors (not USB power). Motor noise can cause Arduino resets and unpredictable behavior. Keep motor power wires away from signal wires.


Step 4: Flash ArduMY firmware

Install ArduMY

  1. Open Arduino IDE

  2. Open the ArduMY sketch from OctoMY™ source:

    src/libs/libardumy/arduino/ArduMYMain.ino
    
  3. Configure for your motors:

    // Motor A (Left)
    #define MOTOR_A_EN  9
    #define MOTOR_A_IN1 8
    #define MOTOR_A_IN2 7
    
    // Motor B (Right)
    #define MOTOR_B_EN  10
    #define MOTOR_B_IN1 6
    #define MOTOR_B_IN2 5
    
  4. Upload to Arduino

Verify

Open Serial Monitor at 115200 baud. You should see:

ArduMY v1.0 ready
Actuators: 2
Waiting for commands...

Step 5: Install OctoMY™ Agent

On the Android phone

  1. Download OctoMY™ Agent from releases or build from source
  2. Install the APK
  3. Launch and create a new personality (e.g., "WheelBot")

Connect Arduino

  1. Connect Arduino to phone via USB OTG cable
  2. Grant USB permissions when prompted
  3. Agent should detect the controller automatically
┌─────────────────────────────────────────────┐
│  Controller Status                           │
├─────────────────────────────────────────────┤
│                                              │
│  Device: Arduino Mega                        │
│  Status: ● Connected                         │
│  Actuators: 2 (motors.left, motors.right)    │
│                                              │
│  [Configure] [Test]                          │
│                                              │
└─────────────────────────────────────────────┘

Pro Tip

Not all USB OTG cables are created equal. If your phone doesn't detect the Arduino, try a different cable. Some cheap cables only support charging, not data.


Step 6: Configure actuators

Name the motors

  1. Go to SettingsHardwareActuators
  2. Configure each motor:
┌─────────────────────────────────────────────┐
│  Configure Actuator                          │
├─────────────────────────────────────────────┤
│                                              │
│  Name: motors.left                           │
│  Type: DC Motor                              │
│  Control: PWM + Direction                    │
│                                              │
│  PWM Pin: 9                                  │
│  Dir Pin 1: 8                                │
│  Dir Pin 2: 7                                │
│                                              │
│  [Test Motor] [Save]                         │
│                                              │
└─────────────────────────────────────────────┘

Test each motor

Use the Test Motor button to verify:

  • Motor spins in expected direction
  • Forward/reverse works correctly
  • If reversed, swap IN1/IN2 pins in config

Step 7: Pair with Remote

On another device

  1. Install OctoMY™ Remote app
  2. Launch and create a personality

Pairing process

  1. On Remote: Tap [Pair New Agent]
  2. On Agent phone: Navigate to Pairing
  3. Scan the QR code or enter pairing key
  4. Complete the trust handshake
┌─────────────────────────────────────────────┐
│  Pairing Complete                            │
├─────────────────────────────────────────────┤
│                                              │
│  Thundering Walrus (Remote)                  │
│  paired with                                 │
│  Gentle Badger (Agent)                       │
│                                              │
│  Trust Level: [████████░░] Handshake         │
│                                              │
│  [View Agent] [Done]                         │
│                                              │
└─────────────────────────────────────────────┘

Step 8: Drive your robot!

Using Remote control

  1. On Remote, select your Agent
  2. Tap Control
  3. Use the virtual joystick or steering wheel
┌─────────────────────────────────────────────┐
│  Control: Gentle Badger                      │
├─────────────────────────────────────────────┤
│                                              │
│           ┌───────────────┐                  │
│           │      ▲        │                  │
│           │   ◄  ●  ►     │   Speed: 60%    │
│           │      ▼        │                  │
│           └───────────────┘                  │
│               Joystick                       │
│                                              │
│  Mode: [Joystick ▼]  [STOP]                 │
│                                              │
└─────────────────────────────────────────────┘

Control modes

Mode Description
Joystick Arcade-style, push forward to move
Steering Car-style, throttle + steering wheel
Tank Direct control of each motor

Testing and calibration

Verify driving straight

If the robot veers left or right:

  1. Go to SettingsHardwareCalibration
  2. Adjust motor trim values
  3. Or calibrate wheel sizes if using encoders

Speed limits

For safety during testing:

  1. Set maximum speed to 50%
  2. Increase gradually as you gain confidence
  3. Always have a clear path for stopping

Troubleshooting

Robot doesn't move

Issue Solution
No power to motors Check battery connections
Motors jitter but don't spin Battery too weak, use higher voltage
Arduino not detected Try different USB cable/port
Only one motor works Check motor driver wiring

Robot moves erratically

Issue Solution
Sudden direction changes Check for loose connections
Intermittent stops Battery running low
Opposite direction Swap IN1/IN2 in configuration

Connection issues

Issue Solution
Remote can't find Agent Check both on same network
Pairing fails Restart both apps, try again
High latency Move closer, reduce interference

Next steps

Now that your basic robot works:

  1. Add sensors - Sensor Setup
  2. Write a plan - Create a Plan
  3. Build more complex bots - Arduino Integration

In this section
Topics
tutorial hardware wheeled-robot arduino motors L298N differential-drive beginner-hardware
See also