COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
Picture
RASPBERRY PI | RC RACE CAR (PART 2)
In Part 2 we look at:
RC Car Anatomy

Identify the motor, ESC, receiver, servo, and battery
Understanding how the RC system sends throttle/steering signals

Disconnecting the Stock Receiver
  • How to locate the signal wires (usually white/yellow)
  • Label everything before disconnecting

Testing the ESC and Servo with Arduino
  • Simple Arduino PWM test code for motor and steering
  • Understanding PWM pulse width control (1–2 ms range)

Wiring Diagram
  • ESC + steering servo connected to Arduino pins
  • Common ground between Arduino, Pi, and ESC

SECTION 1 | RC CAR ANATOMY

Before you begin modifying your RC car, it’s important to understand how it works in its original form. Most RC cars, regardless of brand or scale, share the same key components. Knowing what each one does will help you identify where to connect your Raspberry Pi or Arduino later in the project.

The Chassis and Drive System
The chassis is the main frame of the car. It supports all the electronic and mechanical components, including the battery, motor, and steering mechanism.
  • Motor – Converts electrical energy into mechanical energy to drive the wheels. Most cars use a DC brushed or brushless motor, depending on their power and speed.
  • Transmission and Gears – Transfer the motor’s rotation to the wheels.
  • Wheels and Suspension – Provide traction and absorb bumps during driving.
  • Battery – Powers the motor and all onboard electronics. Most hobby RC cars use LiPo (Lithium Polymer) batteries, which provide high current and long run time.

The Steering System
  • Steering in an RC car is handled by a servo motor mounted at the front of the chassis.
  • The servo receives a PWM (Pulse Width Modulation) signal that tells it what angle to turn to.
  • Inside the servo is a small motor, gear system, and potentiometer that allows precise control of movement.
  • The servo connects to the front steering linkage, moving both wheels left or right together.

You’ll later control this servo using the Arduino or Raspberry Pi, replacing the original receiver.

The Electronic Speed Controller (ESC)
  • The ESC is the heart of the car’s power control system. It connects directly to:
  • The battery (for power input)
  • The motor (for power output)
  • The receiver (for the control signal)

The ESC interprets PWM signals to control how much power goes to the motor — just like pressing a gas pedal. It also handles braking and sometimes reversing. You’ll connect the ESC’s signal wire to the Arduino or Raspberry Pi to control the motor speed programmatically.

The Receiver
In a standard RC setup, the receiver receives wireless signals from the remote control and outputs them as PWM signals to the ESC and steering servo.
It typically has three connections per channel:
  • Signal (white, yellow, or orange)
  • Power (red)
  • Ground (black or brown)

For this project, you’ll remove or bypass the original receiver so that the Raspberry Pi and Arduino can take control of those same PWM lines instead.

The Power Distribution
  • The car’s battery usually powers both the motor and the receiver system through the ESC.
  • The ESC’s built-in Battery Eliminator Circuit (BEC) provides 5 V output for servos and control electronics. However:
  • This BEC should not directly power the Raspberry Pi.

You’ll use a separate UBEC or power module for the Pi and Arduino to ensure stable voltage and prevent brownouts.
Understanding how power flows through the car will help prevent wiring mistakes and component damage.

Identifying Connection Points

Before moving forward, take time to locate and label:
  • The ESC signal lead
  • The servo signal lead
  • The battery connector
  • The power and ground rails

You can mark these with small coloured stickers or masking tape. This will make wiring the Pi and Arduino much simpler in the next stage.

Reflection and Observation
After examining your RC car, answer the following questions in your engineering logbook:
  • What components are powered directly by the main battery?
  • What is the purpose of the ESC’s three-wire signal cable?
  • How does the steering servo know what position to move to?
  • What potential risks are there if you connect the Raspberry Pi directly to the ESC’s power line?
SECTION 2 | DISCONNECTING THE ORIGINAL RC RECEIVER
Once you understand the main parts of your RC car, the next step is to identify how it’s currently controlled and prepare it for your custom system. Most RC cars use a small receiver box that takes signals from the handheld transmitter and passes them to the steering servo and Electronic Speed Controller (ESC).

In this section, you’ll learn how to locate the receiver, understand its wiring, and safely disconnect it so your own hardware can take over.

Understanding the Receiver’s Role
The receiver acts as a translator between the remote control and the car’s electronics. It outputs PWM signals to:
  • Control the steering servo
  • Control the ESC (and therefore the motor speed)

These PWM signals are exactly what your Raspberry Pi or Arduino will later generate — which means you can remove the receiver entirely and feed your own control signals directly into those same inputs.

Locating the Receiver

Remove the car’s outer shell and locate the receiver module. It is usually a small black box connected to both the steering servo and ESC. The wires leading into it typically include:
  • Channel 1 (CH1) – Steering servo
  • Channel 2 (CH2) – Throttle / ESC
  • Battery input (sometimes combined with the ESC’s BEC line)

Tip: Take a photo of the wiring layout before you start unplugging anything. This will be useful for reference later.

Identifying the Wires

Each connection into the receiver usually follows this colour code:
  • Signal wire – white, yellow, or orange
  • Power (VCC) – red
  • Ground (GND) – black or brown

The signal wire is the most important one for you, as it carries the PWM information that the ESC and servo use to operate. When you eventually connect the Arduino or Raspberry Pi, you’ll plug into the signal and ground pins of each channel — not the power line.

Disconnecting the Receiver

Follow these steps carefully:
  • Unplug the battery before doing any wiring work.
  • Gently pull the ESC and servo connectors out of the receiver.
  • They should slide out easily — never force them.
Label each plug:
  • “ESC Signal”
  • “Steering Servo Signal”

Remove or tape over the receiver to prevent it from interfering once disconnected. At this point, your ESC and steering servo are free to receive new control signals from your Arduino or Raspberry Pi.

Testing After Disconnection | Before connecting any new components:
  • Confirm that the ESC’s power light still comes on when the battery is connected.
  • Ensure the servo remains stationary (it should not move without a control signal).
  • Double-check that no power wires are accidentally shorted or touching each other.
  • If everything looks correct, your car is now ready for integration with the new control system.

Safety Reminder

Never plug the Raspberry Pi directly into the car’s main battery or ESC power lead. The voltage is too high and can permanently damage the Pi.
  • Always ensure a common ground connection between all devices later on — Pi, Arduino, ESC, and servo.
  • Keep the car’s wheels off the ground during early testing to prevent sudden movement.

Reflection and Documentation

Record the following in your engineering logbook:
  • How many channels does your receiver have, and what were they controlling?
  • What is the function of the signal, power, and ground wires?
  • Why is it necessary to establish a common ground between devices?
  • What potential risks could occur if power wiring is mixed up?

Taking time to document your observations helps you understand the electronics behind remote control systems — and prepares you for wiring your own custom setup in the next stage.
SECTION 2| TESTING THE ESC AND SERVO WITH THE ARDUINO
Now that the receiver is disconnected, you’re ready to test whether your Electronic Speed Controller (ESC) and steering servo can be controlled directly by an Arduino. This is a crucial step before integrating the Raspberry Pi, as it confirms that both the ESC and servo respond correctly to PWM (Pulse Width Modulation) signals.

The goal of this activity is to:
  • Verify that the ESC and steering servo are functioning correctly.
  • Learn how PWM signals control speed and direction.
  • Understand the range of pulse widths that correspond to forward, reverse, and neutral.

By the end, you’ll be able to make the car’s wheels turn and the steering move without using the original RC transmitter.

Components Needed
  • Arduino Uno or Nano
  • USB cable (to connect to computer)
  • ESC and DC motor from your RC car
  • Steering servo
  • Jumper wires
  • External power (LiPo battery or ESC BEC output for servo)

Make sure your car’s wheels are off the ground during testing to avoid accidental movement.

Wiring the Components

Connect the components as follows:
  • ESC signal (white/yellow) Arduino digital pin 9 Controls motor speed
  • Servo signal (white/yellow) Arduino digital pin 10 Controls steering
  • ESC ground Arduino GND Shared ground is essential
  • Servo ground Arduino GND Common ground with ESC and Arduino
  • ESC 5 V (BEC) Servo 5 V Power for servo (do not power Arduino from this)

Important: The ESC’s red wire (5 V) can power the servo, but not the Arduino or Raspberry Pi.
C++ ARDUINO SERVO CONTROL CODE

    
This code sends PWM signals between 1000–2000 µs, which corresponds to full reverse to full forward for most ESCs, and left-to-right range for the steering servo.

ESC Calibration

Some ESCs require calibration before they respond correctly. If your motor doesn’t spin as expected:
  • Disconnect the motor’s wheels or lift the car off the ground.
  • Turn on the power and hold the Arduino in the setup phase with esc.writeMicroseconds(2000) (full throttle).
  • Connect the battery — the ESC should beep.
  • After the beeps, send esc.writeMicroseconds(1000) (full reverse) and wait for another confirmation beep.
  • Set back to 1500 (neutral).
  • After calibration, the ESC will recognise your signal range properly.

Understanding What’s Happening

When your Arduino runs this code:
  • Each writeMicroseconds() command sends a pulse between 1000–2000 µs every 20 ms.
  • The ESC interprets these pulses to control motor speed, while the servo interprets them as position commands.
  • The motor accelerates smoothly as pulse width increases, giving analoge-like control from a digital signal.

This principle |Pulse Width Modulation (PWM) is what makes it possible to control speed and direction using only digital pins.

SECTION 3 | TROUBLESHOOTING & REFLECTION

Troubleshooting
  • Servo not moving | Wrong signal pin or missing ground - Check wiring and common ground
  • Motor not responding | ESC not armed - Wait longer or recalibrate ESC
  • Sudden power loss | Overloaded BEC - Use separate 5 V power for servo
  • Servo twitching | Electrical noise - Add capacitor or ensure tight connections

Always verify that the Arduino’s GND is shared with the ESC and servo — most control issues come from missing this connection.

Reflection and Logbook Tasks

After completing this stage, record the following in your engineering logbook:
  • What pulse width values correspond to full reverse, neutral, and full forward?
  • Why must the ESC be calibrated before use?
  • What are the risks of powering servos or the Arduino directly from the ESC’s BEC?
  • What did you learn about PWM and analoge-like control from this test?

SECTION 4 | WIRING THE PI AND ARDUINO

​Now that you’ve confirmed your Electronic Speed Controller (ESC) and steering servo work with the Arduino, it’s time to connect everything together into a single, integrated system. This section explains how to wire the Raspberry Pi, Arduino, ESC, servo, camera, and power supply safely and effectively.

Overview of the Wiring

Your setup now has three main systems working together:
  • Control and Processing – handled by the Raspberry Pi
  • Signal Generation – handled by the Arduino
  • Power Delivery – handled by the ESC, UBEC, and battery

The Raspberry Pi sends commands to the Arduino, which outputs PWM signals to control the ESC (motor speed) and servo (steering). At the same time, the Pi Camera provides live video feedback to your control computer.
COMPONENT
CONNECTION
DESCRIPTION
Raspberry Pi → Arduino
USB cable
Sends serial commands (e.g., M1700S1600)
Arduino → ESC
Digital Pin 9 → ESC signal
Controls motor throttle via PWM
Arduino → Steering Servo
Digital Pin 10 → Servo signal
Controls steering angle via PWM
ESC → Motor
ESC motor outputs
Drives the wheels
ESC → Batter
Battery connector
Powers the ESC and motor
ESC (BEC 5V) → Servo VCC
5 V output from ESCV
Powers the servo
UBEC / External 5V → Raspberry Pi + Arduino 5V
Stable power supply
Powers the microcontrollers
Common Ground
Connect all GND pins together
Shared reference for all signals
Pi Camera
CSI port on Raspberry Pi
Provides live video feed
Power Distribution Explanation
  • The main LiPo battery supplies power to the ESC and motor.
  • The ESC’s BEC output (usually 5 V, 2 A) provides power for the steering servo only.
  • The Raspberry Pi and Arduino are powered separately using a UBEC or USB power bank capable of providing a stable 5 V at 2–3 A.
  • All grounds (GND​) from the ESC, Arduino, servo, and Pi must be connected together. Without a shared ground, signal voltages won’t be properly referenced, and the motor or steering may behave unpredictably
​
Serial Communication Between Pi and Arduino

The Raspberry Pi connects to the Arduino via a USB cable. Commands such as "M1700S1500\n" are sent from the Pi to the Arduino, where:
  • M = Motor PWM value (ESC control)
  • S = Steering PWM value (servo control)
The Arduino receives the command, separates the numbers, and adjusts the PWM outputs accordingly.

Example command flow: PC → Raspberry Pi → Arduino → ESC/Servo

This simple protocol allows smooth and fast updates while keeping timing precise, since the Arduino’s hardware PWM handles signal accuracy.

Safety and Power Notes
  • Never power the Raspberry Pi directly from the ESC’s BEC line. Although it outputs 5 V, it often fluctuates under motor load, which can cause the Pi to reboot or be damaged.
  • Ensure polarity is correct on every connection. Reversing power wires can instantly destroy components.
  • Use thick wires for motor and power connections and thin signal wires for PWM control.
  • Always disconnect the battery when not in use.

Optional Additions


Once your basic wiring works, you can add:
  • A servo pan mount for the camera, connected to another Arduino pin (e.g., D11)
  • LEDs or sensors powered by the Pi’s 3.3 V pins
  • A switch or button for emergency motor cut-off connected to a Pi GPIO or Arduino pin

Step-by-Step Wiring Checklist

Before applying power, check the following:
  • The Arduino is connected to the Raspberry Pi via USB.
  • ESC signal wire (white/yellow) → Arduino pin 9.
  • Steering servo signal wire (white/yellow) → Arduino pin 10.
  • All black/brown wires (grounds) connected together.
  • Raspberry Pi and Arduino powered by a separate 5 V supply.
  • Motor securely mounted and car wheels lifted for first test.
  • Pi camera connected to CSI port with ribbon cable.

SECTION 4 | TESTING THE COMPLETE CIRCUIT

Once all connections are verified:
  • Connect the battery and power supplies.
  • Run a simple Python script on the Pi to send a test command to the Arduino:
PYTHON ON THE PI TO SEND TEST COMMAND TO ARDUINO

    
  • The wheels should turn slightly forward and the steering remain centered.
  • ​Adjust values to confirm full left/right and forward/reverse motion.

Reflection and Logbook Tasks
Record the following in your logbook:
  • Why is it important that all components share a common ground?
  • What would happen if the ESC’s 5 V output was used to power the Raspberry Pi?
  • What advantage does the Arduino provide compared to controlling PWM directly from the Pi?
  • What steps can you take to make your wiring tidy, safe, and easy to maintain?
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.