A little curiosity. A whole lot of making.Robotics, CNC & connected ideas
robodatech.
← Learning library
Build & understand

Theory of a 2-Wheeled Robot

Understand motion, power, sensors, signals, and decision loops before wiring.

A small robot. A complete system.CONTROLLERSENSE → DECIDE → ACT
Concept illustration. Check the component datasheet before wiring.
Try it yourself

Change an input.
See what follows.

A simplified learning model. Values describe the model, not a connected robot.

The robot loop

A robot repeats a simple loop: sense, think, act, check. Sensors collect facts, Arduino Nano decides, L293D powers the motors, and the robot checks the result again.

For grade 3-5: think of the Arduino Nano like the class captain that listens and gives instructions. For grade 9-12: this is a feedback-control loop.
Signal and power are separate pathsControllerDriverMotorMotor supplyLogic supplyCommon signal groundPWMPowerUse the pin reference for the exact board and module.
Signal and power overview. Exact connections are listed below.
Connection reference for this build
  • Theory Arduino Nano pin wiring schematic
  • Straight lines show electrical nets. Check the printed labels on each real module before connecting power.
  • +5V logic rail
  • 7.4V motor rail from 2 x 3.7V Li-ion through switch
  • Common GND rail
  • Arduino Nano
  • D2 HC-05 TX
  • D3 HC-05 RX divider
  • D4 Ultrasonic TRIG
  • D5 L293D ENA PWM
  • D6 L293D ENB PWM
  • D7 Ultrasonic ECHO
  • D8 L293D IN1
  • D9 L293D IN2
  • D10 L293D IN3
  • D11 L293D IN4
  • D12 Servo SIG
  • A0 Left IR OUT
  • A1 Right IR OUT
  • A2-A5 RF F/B/L/R
  • L293D
  • Pin 1 EN1,2 = D5
  • Pin 2 IN1 = D8
  • Pin 7 IN2 = D9
  • Pin 9 EN3,4 = D6
  • Pin 10 IN3 = D10
  • Pin 15 IN4 = D11
  • Pin 8 VCC2 = 7.4V motor
  • Pin 16 VCC1 = +5V logic
  • Pins 4,5,12,13 = GND
  • Left BO
  • Right BO
  • HC-05
  • VCC 5V, GND
  • TXD D2, RXD D3
  • HC-SR04
  • TRIG D4
  • ECHO D7
  • Servo
  • SIG D12, 5V, GND
  • IR Pair
  • Left A0, Right A1
  • RF Module
  • F/B/L/R to A2-A5
  • Breadboard
  • Distribute 5V/GND
  • Blue = Arduino signal, red = power, gray = ground, orange line = motor battery rail. Connect battery only after checking every net.

Motion theory

Motor stateRobot motion
Left forward + right forwardForward
Left backward + right backwardReverse
Left slow + right fastCurved left
Left backward + right forwardSpin left

Do and don't

Do
  • Use Arduino Nano as the controller.
  • Keep battery negative and all module GND pins connected.
  • Test motors with wheels lifted first.
  • Use a voltage divider for HC-05 RX if Arduino TX is 5 V.
  • Power servo from a stable 5 V source.
Don't
  • Do not short Li-ion cells.
  • Do not connect motors directly to Arduino Nano pins.
  • Do not mix loose wires without labels.
  • Do not run high motor speed during first tests.
  • Do not assume every RF module has the same pinout.

Take the next step

Where this is used

Explore real robotics applications, from mobile robots to inspection and joint motion. Define a measurable target and test one change at a time.

Good ideas start here.

Free robotics lessons, CNC build notes and product updates. Confirm your email to join. Unsubscribe anytime.