MPU-6050 IMU connection guide — pulsing orange pins = connect here
(Pin 1 = top-left, near board edge. Hover for details.)
| MPU-6050 | Pi 5 Pin | GPIO | Status |
|---|---|---|---|
| VCC | Pin 1 | 3.3V | shared |
| SDA | Pin 3 | GPIO 2 | shared (sonar) |
| SCL | Pin 5 | GPIO 3 | shared (sonar) |
| GND | Pin 6 | GND | shared |
| AD0 | GND or float | addr 0x68 | |
| INT | not connected | optional | |
| Pin | GPIO | Used For |
|---|---|---|
| 2, 4 | 5V | Board power (STM32 + motors) |
| 3 | GPIO 2 (SDA) | I2C: sonar 0x77, line follower |
| 5 | GPIO 3 (SCL) | I2C: sonar 0x77, line follower |
| 8 | GPIO 14 (TX) | UART to STM32 (/dev/ttyAMA0) |
| 10 | GPIO 15 (RX) | UART from STM32 |
| 6,9,14 | GND | Common ground |
# SSH to Pi and scan I2C bus: ssh pi "sudo i2cdetect -y 1" # Expected: 68 (MPU) and 77 (sonar) 0 1 2 3 4 5 6 7 8 60: -- -- -- -- -- -- -- -- 68 70: -- -- -- -- -- -- -- 77 # Quick MPU-6050 read test: ssh pi "python3 -c \" from smbus2 import SMBus bus = SMBus(1) who = bus.read_byte_data(0x68, 0x75) print(f'WHO_AM_I: 0x{who:02x}') \"" # Should print: WHO_AM_I: 0x68