Wiring

Electrical interconnects and Nucleo pin assignments for the final robot

Wiring Overview

This page defines the electrical interconnects used on our Romi robot, including motor driver control, encoder feedback, reflectance sensing, inertial sensing, and bump-event inputs. The goal is to provide a single reference for connector-level wiring, Nucleo pin assignments, and the signals required by each subsystem in the final autonomous robot.

STM32 Nucleo pinout reference
STM32 Nucleo pinout reference used to assign PWM, analog, I2C, and digital I/O signals for the Romi wiring harness.
  • Red wire
  • Black wire
  • Yellow wire
  • Blue wire
  • Green wire
  • Orange wire
  • Brown wire
  • Gray wire
  • Purple wire
  • White wire

Nucleo Pin Constraints

Several Nucleo pins were avoided because they are tied to onboard functions such as ST-Link communication, USB, SWD programming, the user button, the onboard LED, and the RTC oscillator. Avoiding these pins helped preserve reliable programming, debugging, and serial access during development and testing.

Nucleo Pin Arduino Label Reserved Function
PA2A2UART link to ST-Link interface
PA3A3UART link to ST-Link interface
PA5A5Onboard user LED
PA11A11USB interface
PA12A12USB interface
PA13A13SWD programming interface
PA14A14SWD programming interface
PC13C13User button input
PC14C1432 kHz RTC oscillator
PC15C1532 kHz RTC oscillator

Power

Signal Connection Wire Color Notes
VIN VIN Red Main battery power input
GND GND Black Common ground reference for the system

Motor Control

The drivetrain used separate effort, direction, and enable lines for each motor. These connections supported closed-loop speed control and direction changes during line following, turning, and wall-response behaviors.

Motor Signal Nucleo Pin Wire Color
RightMotor EffortPB6Green
RightMotor DirectionPA7Blue
RightMotor EnablePA6Yellow
LeftMotor EnablePB3Yellow
LeftMotor DirectionPB5Blue
LeftMotor EffortPB4Green

Encoder Connections

Quadrature encoder feedback from both wheels was routed directly to the Nucleo so that the software could measure wheel speed and traveled distance for closed-loop motor control and state estimation.

Encoder Signal Nucleo Pin Wire Color
RightEncoder Channel BPA1Yellow
RightEncoder Channel APA0Blue
LeftEncoder Channel BPA8Blue
LeftEncoder Channel APA9Yellow

IR Sensor Array

The line sensor array used seven analog reflectance channels. These signals were read by the controller to compute line position and steering error during centroid-based line following.

Sensor Channel Nucleo Pin Wire Color Notes
Sensor 13PC3BrownOuter channel
Sensor 11PC2RedOuter-mid channel
Sensor 9PC0OrangeMid channel
Sensor 7PC1YellowCenter channel region
Sensor 5PB0GreenCenter channel region
Sensor 3PA4GrayInner channel
Sensor 1PC4PurpleOuter channel
Sensor GNDGNDBlackSensor ground
Sensor VCC+3V3WhiteSensor supply voltage

IMU Connections

The BNO055 IMU was connected over I2C and powered from the 3.3 V rail. This interface provided heading information used during turning actions and observer-based state estimation.

IMU Signal Nucleo Pin / Connection Wire Color Notes
SCLPB9BlueI2C clock
SDAPB8YellowI2C data
Reset / Ground tieGNDGreenGround-related reset connection shown in the board table
GNDGNDBlackGround reference
VIN+3V3Red3.3 V supply from the controller

Bump Sensors

Left and right bumper switch assemblies were connected as grouped digital inputs. These signals were used by the navigation task to detect wall contact and trigger backing-up and recovery behaviors.

Side Board Pin Nucleo Pin Wire Color
RightBMP2PB15Yellow
RightBMP1PB14Orange
RightBMP0PB13Red
LeftBMP5PC8Yellow
LeftBMP4PC6Orange
LeftBMP3PC5Red

Wiring Diagram and Full Assembly

Final Romi wiring diagram
Final wiring diagram showing the pin-level interconnects used on the robot.
Fully assembled Romi robot
Fully assembled Romi with integrated controller stack, front sensors, and wiring harness used during obstacle-course testing.