Electronics & Wiring
Complete wiring guide for assembling Fabrica's electronics
Step-by-step wiring demonstration for all electronics connections
Wiring Diagram
┌─────────────────────────┐
│ 5V 5A Power Supply │
│ (Barrel Jack) │
└───────────┬─────────────┘
│
│ 5V
│
┌───────────────────┴─────────────────┐
│ │
┌───────┴─────────┐ ┌──────────┴──────────┐
│ PCA9685 Board │ │ Raspberry Pi Pico │
│ (I2C Address: │ │ 2W │
│ 0x40) │ │ (Microcontroller) │
└────┬────────────┘ └──────────┬──────────┘
│ │
│ V+ GND SCL SDA │ GP0 GP1
│ │ │ │ │ │ │ │
┌────┴──┴───┴────┴────┴─────┐ │ │ │
│ I2C Connection │ │ │ │
│ V+ ────────────────── VBUS (5V) │ │ │
│ GND ───────────────── GND │ │ │
│ SCL ───────────────── GP0 (I2C0 SCL) │ │ │
│ SDA ───────────────── GP1 (I2C0 SDA) │ │ │
└────────────────────────────────────────────┘ │ │
│ │
PCA9685 Servo Outputs │ │
┌───────────────────┐ │ │
│ │ │ │
Servo 0 Servo 1 ... Servo 7 GP16 (LED)
│ │ │ │
Panel 1 Panel 2 ... Panel 8 Status LED
Servo Wire Color Code:
├── Brown/Black: Ground (-)
├── Red: Power (5V)
└── Orange/Yellow: Signal (PWM from PCA9685)
Important Notes:
- • All grounds (GND) must be connected together (common ground)
- • PCA9685 and servos share the same 5V power source
- • I2C only requires 4 wires: V+, GND, SCL, SDA
- • Each servo connects to PCA9685 channels 1-16 (motors numbered 1-16 for ease of use)
Step-by-Step Wiring
1
Prepare the PCA9685 Servo Driver
- • Solder header pins to the PCA9685 board (if not pre-soldered)
- • Solder the 4-pin I2C header on the left side
- • Solder the V+ and GND terminals for external power
- • Test for continuity to ensure good solder joints
2
Connect Power to PCA9685
- • Connect 5V power supply positive (+) to V+ terminal
- • Connect 5V power supply negative (-) to GND terminal
- • Use screw terminals or solder thick wires (18-20 AWG)
- • Double-check polarity before connecting power
Polarity Warning: Reversed polarity will damage the board!
3
I2C Connection to Pico 2W
| PCA9685 Pin | Pico 2W Pin | Function |
|---|---|---|
| V+ | VBUS (Pin 40) | 5V Power |
| GND | GND (Pin 38) | Ground |
| SCL | GP0 (Pin 1) | I2C Clock |
| SDA | GP1 (Pin 2) | I2C Data |
Use Dupont wires or solder connections for reliability
4
Connect Servo Motors
- • Plug each servo into channels on the PCA9685 (Motor 1 → Channel 1, Motor 2 → Channel 2, etc.)
- • Match servo wire colors: Brown→GND, Red→5V, Orange→Signal
- • Panel 1 → Motor 1 (Channel 1), Panel 2 → Motor 2 (Channel 2), etc.
- • Ensure connectors are fully seated in the headers
Servo Channel Mapping (Motors 1-16):
• Panel 1 → Motor 1 (Channel 1)
• Panel 5 → Motor 5 (Channel 5)
• Panel 2 → Channel 1
• Panel 6 → Channel 5
• Panel 3 → Channel 2
• Panel 7 → Channel 6
• Panel 4 → Channel 3
• Panel 8 → Channel 7
5
Add Status LED (Optional)
- • Connect LED anode (+) to GP16 through a 220Ω resistor
- • Connect LED cathode (-) to GND
- • LED indicates system status and mode (solid/blinking)
- • Mount LED in a visible location on the frame
6
Final Checks Before Power-On
- • Verify all connections match the wiring diagram
- • Check for any shorts between power and ground
- • Ensure no loose strands touching adjacent pins
- • Confirm power supply is set to 5V
- • Double-check servo polarity (signal on correct pin)
I2C Configuration
Understanding I2C Communication
The PCA9685 uses the I2C protocol to receive commands from the Pico 2W. This allows control of 16 servos using only 2 data wires (SCL and SDA).
Default Settings:
- • I2C Address: 0x40 (default)
- • Clock Speed: 100 kHz (standard)
- • SCL Pin: GP0
- • SDA Pin: GP1
- • Pull-ups: On-board (no external needed)
Changing I2C Address (Advanced):
Use solder jumpers on PCA9685 to change address:
- • A0-A5 jumpers set bits 0-5
- • Address range: 0x40 to 0x7F
- • Useful for controlling multiple boards
Testing I2C: After wiring, you can test the connection using MicroPython:
from machine import I2C, Pin
i2c = I2C(0, scl=Pin(0), sda=Pin(1), freq=100000)
devices = i2c.scan()
print("I2C devices found:", [hex(d) for d in devices])
# Should print: I2C devices found: ['0x40']Common Wiring Issues
❌ No I2C Devices Found
- • Check SCL and SDA are not swapped
- • Verify power is connected to PCA9685 (LED should be on)
- • Test continuity of I2C wires
- • Ensure common ground between Pico and PCA9685
❌ Servos Not Moving
- • Check servo power is connected (V+ and GND to PCA9685)
- • Verify servos are plugged into correct channels
- • Test individual servo with a servo tester
- • Ensure power supply provides enough current (5A minimum)
❌ Erratic Servo Movement
- • Power supply voltage drop (use thicker wires)
- • Loose connections (re-seat servo connectors)
- • Electrical noise (add 100µF capacitor across power)
- • Too many servos moving at once (adjust sequence)
❌ Pico Won't Boot
- • Disconnect all peripherals and test Pico alone
- • Check for shorts on VBUS or GND pins
- • Try different USB cable or power source
- • Re-flash MicroPython firmware if software corruption
Electronics Complete!
Your electronics are now wired and ready for testing. Next, we'll install the software that brings your robot to life.