Hardware reference, component architecture, pinout, and configuration guide for the Arduino Uno R3 microcontroller development board used as the main controller in the tracked_bot platform.
This board features a Microchip ATmega328P primary motion microcontroller clocked at 16 MHz alongside an onboard USB-to-UART serial interface (ATmega16U2 or CH340G) providing deterministic serial communication to host controllers at 115200 baud.
The Arduino Uno R3 provides a robust, single-microcontroller embedded control platform:
PD0/RX, PD1/TX) at 115200 baud (8-N-1).VIN 7β12V rail).Original manufacturer datasheets for the core integrated circuits on this board are preserved in the repository:
| Feature | Primary Controller (ATmega328P) |
|---|---|
| Architecture | 8-bit AVR RISC |
| Clock Frequency | 16 MHz (external crystal) |
| Operating Voltage | 5.0 V DC |
| Flash Memory | 32 KB (0.5 KB used by Optiboot bootloader) |
| SRAM | 2 KB internal SRAM |
| EEPROM | 1 KB internal EEPROM |
| Timers | 2x 8-bit (Timer0, Timer2), 1x 16-bit (Timer1) |
| Hardware Serial (UART) | 1x USART (PD0/RXD, PD1/TXD) |
| I/O Logic Levels | 5 V TTL/CMOS |
| Analog Inputs | 6 channels (10-bit ADC, A0βA5) |
| Interrupts | External (INT0 on D2, INT1 on D3), Pin Change (PCINT0..PCINT23) |
All communication between the robot firmware and the host controller is conducted strictly over the hardware USART0 interface:
Incoming serial frames are ingested via the USART_RX_vect interrupt into a lock-free Single-Producer Single-Consumer (SPSC) ring buffer, decoded by a 5-state finite state machine (FSM), and dispatched deterministically in the main loop.
The headers on the Arduino Uno R3 provide standard female sockets that mate directly with the L293D Motor Shield. The table below details signal routing and dedicated functions within tracked_bot:
| Pin | AVR Port | Onboard Connection | Role in tracked_bot |
|---|---|---|---|
| D0 (RX) | PD0 |
ATmega328P USART RX | USART0 RX: Serial binary command reception from Host |
| D1 (TX) | PD1 |
ATmega328P USART TX | USART0 TX: Serial binary telemetry transmission to Host |
| D2 | PD2 |
Header pin | FREE GPIO: External Interrupt 0 (INT0), sensors, encoders |
| D3 | PD3 |
Header pin / L293D PWM2B |
Reserved (Timer2 OC2B for Motor 2 PWM on shield) |
| D4 | PD4 |
Header pin / L293D DIR_CLK |
74HC595 Shift Clock: Clock line for direction register |
| D5 | PD5 |
Header pin / L293D PWM0B |
Reserved (Timer0 OC0B for Motor 4 PWM on shield) |
| D6 | PD6 |
Header pin / L293D PWM0A |
Left Track PWM Speed: Timer0 OC0A Fast PWM |
| D7 | PD7 |
Header pin / L293D DIR_EN |
74HC595 Output Enable: Active-low output buffer enable (~OE) |
| D8 | PB0 |
Header pin / L293D DIR_SER |
74HC595 Serial Data: Direction bit data line (SER) |
| D9 | PB1 |
Header pin / L293D PWM1A |
Reserved for Pan-Tilt Servo 2 (Timer1 OC1A) |
| D10 | PB2 |
Header pin / L293D PWM1B |
Reserved for Pan-Tilt Servo 1 (Timer1 OC1B) |
| D11 | PB3 |
Header pin / L293D PWM2A |
Right Track PWM Speed: Timer2 OC2A Fast PWM |
| D12 | PB4 |
Header pin / L293D DIR_LATCH |
74HC595 Storage Latch: Latches direction bits to outputs (RCLK) |
| D13 | PB5 |
Header pin / Onboard SCK LED | Status Heartbeat LED: Built-in diagnostic LED toggle |
All analog pins pass directly through the L293D motor shield to top breakout pads:
| Pin | AVR Port | Alternative Functions | Dedicated Purpose in tracked_bot |
|---|---|---|---|
| A0 | PC0 |
ADC0 / PCINT8 | Battery Voltage Sense: 4:1 resistive divider monitoring 2S battery pack |
| A1 | PC1 |
ADC1 / PCINT9 | HC-SR04 Ultrasonic Trigger: Pulse generator |
| A2 | PC2 |
ADC2 / PCINT10 | HC-SR04 Ultrasonic Echo: Pulse duration measurement |
| A3 | PC3 |
ADC3 / PCINT11 | Auxiliary GPIO / Analog Input |
| A4 | PC4 |
ADC4 / I2C SDA | I2C Bus SDA: IMU gyroscope/accelerometer (MPU-6050) / OLED display |
| A5 | PC5 |
ADC5 / I2C SCL | I2C Bus SCL: IMU gyroscope/accelerometer (MPU-6050) / OLED display |
tracked_bot)To compile and flash the bare-metal AVR C firmware onto the ATmega328P:
/dev/ttyUSB0 or /dev/ttyACM0 on Linux):
ls -l /dev/ttyUSB* /dev/ttyACM*
make:
make -C sw/trackedbot/build flash PORT=/dev/ttyUSB0
avrdude will synchronize with the Optiboot / STK500v1 bootloader at 115200 baud and program the Flash memory.After flashing the firmware:
D0 (RX) and host RX to D1 (TX) with a common ground (5V level tolerant).flowchart TD
subgraph Host ["<b>Development PC / Host Controller</b>"]
CLIENT["<b>Control Application</b><br/>CLI / Web GUI / ROS Node"]
USB_PORT["<b>USB Host Controller</b><br/>Type-B / Virtual COM Port"]
CLIENT <-->|"Serial Data Stream"| USB_PORT
end
subgraph UnoBoard ["<b>Arduino Uno R3 Main Board</b>"]
direction TB
subgraph CommLayer ["USB-to-UART Bridge"]
USB_UART["<b>ATmega16U2 / CH340G</b><br/>USB-to-Serial Converter"]
end
ATMEGA["<b>ATmega328P MCU Core</b><br/>Primary Real-Time Motion Engine (16 MHz)"]
USB_UART <-->|"Hardware USART0 (D0/RX, D1/TX)"| ATMEGA
end
subgraph MotorShield ["<b>L293D Motor Driver Shield</b>"]
direction TB
L293D_CTRL["<b>74HC595 Shift Register</b><br/>Direction Multiplexer (Q0..Q7)"]
L293D_DRV["<b>Dual L293D H-Bridges</b><br/>Motor Driver ICs (IC1, IC2)"]
L293D_CTRL --> L293D_DRV
end
subgraph Chassis ["<b>Locomotion Platform: T101 Aluminum Chassis</b>"]
MOTOR_R["<b>Right Track DC Gearmotor</b><br/>Channel M1"]
MOTOR_L["<b>Left Track DC Gearmotor</b><br/>Channel M3"]
TRACKS["<b>Modular Caterpillar Tracks</b><br/>POM Interlocking Links"]
MOTOR_R --> TRACKS
MOTOR_L --> TRACKS
end
USB_PORT ==>|"USB Cable / Serial UART (115200 8-N-1)"| USB_UART
ATMEGA -->|"Timer0 Fast PWM D6 (Left Speed)"| L293D_DRV
ATMEGA -->|"Timer2 Fast PWM D11 (Right Speed)"| L293D_DRV
ATMEGA -->|"Direction Bus D4/D7/D8/D12"| L293D_CTRL
ATMEGA -.->|"Sensors & ADC Bus A0..A5"| MotorShield
L293D_DRV ==>|"PWM Motor Drive M1"| MOTOR_R
L293D_DRV ==>|"PWM Motor Drive M3"| MOTOR_L
classDef hostStyle fill:#0f766e,stroke:#14b8a6,stroke-width:2px,color:#ffffff;
classDef commStyle fill:#312e81,stroke:#818cf8,stroke-width:2px,color:#ffffff;
classDef mcuStyle fill:#0c4a6e,stroke:#38bdf8,stroke-width:2px,color:#ffffff;
classDef shieldStyle fill:#831843,stroke:#f472b6,stroke-width:2px,color:#ffffff;
classDef motorStyle fill:#701a75,stroke:#e879f9,stroke-width:2px,color:#ffffff;
class CLIENT,USB_PORT hostStyle;
class USB_UART commStyle;
class ATMEGA mcuStyle;
class L293D_CTRL,L293D_DRV shieldStyle;
class MOTOR_R,MOTOR_L,TRACKS motorStyle;
style Host fill:none,stroke:#14b8a6,stroke-width:2px,stroke-dasharray: 4 4
style UnoBoard fill:none,stroke:#38bdf8,stroke-width:2px,stroke-dasharray: 4 4
style CommLayer fill:none,stroke:#818cf8,stroke-width:1px
style MotorShield fill:none,stroke:#f472b6,stroke-width:2px,stroke-dasharray: 4 4
style Chassis fill:none,stroke:#e879f9,stroke-width:2px,stroke-dasharray: 4 4
For motor shield driver circuits and register assignments, refer to motor_shield.md. For power rail wiring and battery safety, refer to power_supply.md.
The tracked_bot firmware is compatible with standard Arduino Uno R3 boards and equivalent open-source hardware designs:
/dev/ttyACM* on Linux)./dev/ttyUSB* on Linux). Both versions provide identical 5V TTL serial connections to the ATmega328P USART0 core.