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.
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 state | Robot motion |
|---|---|
| Left forward + right forward | Forward |
| Left backward + right backward | Reverse |
| Left slow + right fast | Curved left |
| Left backward + right forward | Spin 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.