Skip to content

6 KB

Machine-translated by Robotheca from the original in Chinese (opens in a new tab). License: MIT (opens in a new tab).

Wiring Diagram Guide — Cheers No. 1 (Plug-and-Play Edition)

Document status: First edition (2026-08-11) Target audience: Users without an electronics background. Follow this guide step by step to connect the car in the "digital twin" to real motors, lights, and sensors. Principle: Use only off-the-shelf modules + breadboard + DuPont wires. No soldering, no PCB design.

0. List of Pre-Purchased Modules You Need

The off-the-shelf modules used in this guide (totaling about ¥150-250, excluding large components like motors, ESCs, and batteries):

ModulePurposeReference Price
Breadboard (400 holes)Circuit prototyping¥10
Dupont wires (male-to-male / male-to-female)Wiring¥10
Bidirectional level shifter module (4 channels, 5 V ↔ 3.3 V)⚠️ Required for Raspberry Pi ↔ Arduino UART¥10
MOS relay / high-side driver moduleControl high-current lights (e.g., D2 headlight)¥15
WS2812B RGB LED strip (1 m)Body lighting¥15
Hall / potentiometer pedal ×2Throttle / brake¥40-120
Seat pressure sensorOccupancy detection¥15
Push-button switch ×6Headlight / mute / LED strip / horn / emergency brake / intercom¥10
Fuse holder + 20 A fuse⚠️ Battery short-circuit protection¥10
DC-DC buck converter (24 V → 5 V / 3 A)Power supply for Raspberry Pi / Arduino¥15

⚠️ Large components such as motors, ESCs, batteries, and servos are covered in powertrain_sizing.md.

3. Power System (Highest Priority, Safe Wiring)

Lithium battery pack 24V +BAT ──► [Fuse 20A] ──► ESC power input +
Lithium battery pack 24V -BAT ───────────────────► ESC power input -

Motor output from ESC → DC motor (swap positive/negative as needed)
ESC signal wire (white/orange) ──► Arduino D9 (throttle)
ESC power output ──► DC-DC buck converter 24V→5V ──► Raspberry Pi 5V + Arduino 5V

✅ Key Safety Points

  1. Fuse is placed directly next to the battery positive terminal—in case of a short circuit, the fuse will blow before the device is damaged.
  2. Both the Raspberry Pi and Arduino are powered by a 5V DC-DC converter—do not power them simultaneously via USB (use isolated power).
  3. Use thick wires for the battery circuit (to handle high motor current), and thin wires for signal lines.

2. Brain ↔ Cerebellum Communication (Raspberry Pi ↔ Arduino)

Raspberry Pi GPIO14(TXD) ──► Level Shifter L1 ──► Arduino Mega D19 (RX1)
Raspberry Pi GPIO15(RXD) ◄── Level Shifter L1 ◄─── Arduino Mega D18 (TX1)
Raspberry Pi GND ────────────► Level Shifter GND ◄─ Arduino GND (Common Ground!)

⚠️ A bidirectional level shifter module must be used: 5V from Arduino → 3.3V for Raspberry Pi direction conversion, otherwise the Raspberry Pi GPIO will be burned. ⚠️ Common ground must be connected, otherwise the serial port will not work.

3. Arduino Output Wiring (Actuators + Lights)

Arduino PinConnectionNotes
D9ESC signal wireMotor throttle
D10Servo signal wireSteering (to be implemented, see §7)
D2Via MOSFET relay → HeadlightsHigh-current isolation
D3Brake light (LED with resistor)PWM brightness
D4Left turn signal (with resistor)
D5Right turn signal (with resistor)
D11WS2812B LED strip data lineRGB (requires NeoPixel library)

Connect lights directly to GND through a 220Ω resistor, or use a MOSFET relay to drive headlights/LED strips.

4. Arduino Input Wiring (Sensors + Buttons)

Arduino PinConnectionNotes
A0Throttle pedal (Hall/potentiometer midpoint)0-5V → 0-1023
A1Brake pedal
A2Seat pressure sensorSeat-occupied detection
A3Battery voltage (via voltage divider A3 → GND + 10K:4.7K)Do NOT connect 24V directly!
A4NTC thermistor (divided to 0-5V)Battery compartment temperature
A5Current sensor outputMotor current
D22Emergency brake button (connected to GND, pull-up/down)Highest priority
D23Mute button
D24Headlight button
D25LED strip button
D26Horn button
D27Intercom button

⚠️ Never connect A3 directly to 24 V; use a voltage divider to bring it down to 0-5 V, otherwise the ADC will be damaged.

5. One-touch emergency stop with dual insurance (safety red line, must be implemented)

Your firmware already implements software-based emergency braking (D22 + EBRK command). To achieve hardware-level safety, add an additional layer:

Emergency stop button one side ──► Arduino D22 (software emergency stop, already implemented)
Emergency stop button other side ──► ESC enable/power enable pin (hardware direct power cut-off)

This ensures that even if the program fails, pressing the emergency stop physically cuts off power.

6. Wiring Overview Diagram (One-Sentence Version)

Battery 24V ├─►Fuse→ESC→Motor
            └─►DC-DC 5V→Raspberry Pi + Arduino

Raspberry Pi[TXD/RXD]─Level Shifter→Arduino[D19/D18]   ←Serial Protocol
Arduino[D9→ESC] [D10→Servo] [D2,D3,D4,D5→LEDs] [D11→LED Strip]
Arduino[A0,A1,A2,A3,A4,A5→Foot Pedal/Cushion/Voltage/Temperature/Current]
Arduino[D22-D27→Six-Key Panel]

7. ⚠️ Steering and Wheel Speed (Currently Under Development)

These two features are still placeholders/to be implemented in the firmware:

  1. Steering: Currently, only the TURN (turn signal) command exists, there is no STEER (steering execution) command. You can wire the servo to D10 for now, but the driver code needs to be added.
  2. Wheel Speed Sensor: The estimate_speed() function uses "throttle × gear estimation" instead of actual speed. To implement speed closed-loop control and gear speed limiting, you need to connect a Hall sensor/encoder to the Arduino and add a STAT command to report the actual speed.

These two features (STEER command + wheel speed acquisition) are the next firmware parts I will help you write. For now, you can wire them to the corresponding pins.

8. Common Mistakes (Must Read Before Wiring)

ErrorConsequencePrevention
Common ground not connectedNo serial data receivedConnect GND of Raspberry Pi/Arduino/level shifter together
24V directly connected to Raspberry Pi🚨Burned outUse only DC-DC 5V
A3 directly connected to 24VADC burned outMust use voltage divider
Motor wires directly connected to GPIOArduino burned outUse ESC
Level not convertedRaspberry Pi burned outMust use level conversion module

9. Checklist (Step 1: Desktop Static Verification, No One Seated)

Test in order; power on only after confirming no issues:

#TestExpected Result
1Battery → Fuse → ESCESC powers on with a beep
2Level shifter connectedRaspberry Pi can see Arduino READY
3Motor rotationESC signal connected to D9; Arduino output → motor spins
4Emergency stop buttonPressed → motor stops
5Headlights/LED stripControlled via web/button to turn on/off
6Throttle pedalA0 reading changes → motor speed adjusts

✅ Only proceed to S2 (unmanned low-speed test drive) after all tests pass. See powertrain_sizing.md §10.


Before wiring, please also read powertrain_sizing.md (powertrain sizing) and hardware_io_map.md (pin contract). If unsure about any wiring, ask first before proceeding.

Files by @RevolutionLA, at commit a7b0c9d, read from GitHub in your browser. Hardware license: MIT; software license: MIT. Robotheca doesn't review code: read it before running it.