How to Build a Remote-Controlled Car with a Horn Sound
Building a remote-controlled car from scratch is one of the most rewarding DIY electronics projects you can tackle. It combines mechanical engineering, circuit design, and programming into a single, tangible machine that you can actually drive around your living room. But if you want to take it a step further — adding personality and interactivity — nothing beats integrating a micro servo motor to create a realistic horn sound mechanism. Unlike simple buzzers or piezo speakers, a micro servo can physically strike a metal bell, press a rubber bulb horn, or even actuate a small hammer against a resonant surface. This gives your RC car a tactile, authentic “honk” that feels far more satisfying than a digital beep.
In this guide, I’ll walk you through the entire process of building a remote-controlled car, with a heavy focus on how to leverage a micro servo motor for the horn system. We’ll cover component selection, chassis construction, motor control, wireless communication, and the servo integration itself. By the end, you’ll have a fully functional RC car that can drive, steer, and honk on command.
Why a Micro Servo Motor for the Horn?
Before we dive into the build, let’s talk about why a micro servo is the ideal choice for a horn mechanism. Standard DC motors are great for wheels, but they’re terrible for precise, repeatable angular movements. A micro servo, on the other hand, is designed for exactly that. It can rotate to a specific angle (typically 0 to 180 degrees) with high accuracy, and it holds that position under load. This makes it perfect for:
- Striking a physical bell or gong – The servo arm can swing a small hammer into a metal surface.
- Pressing a rubber bulb horn – A gentle 45-degree rotation can squeeze a bulb horn like the ones on vintage bicycles.
- Actuating a mechanical switch – The servo can push a lever that completes a circuit for a louder electronic horn.
The key advantage is feedback. Unlike a solenoid or a simple motor, a micro servo reports its position back to the controller. You know exactly when the horn is engaged and when it’s retracted. This allows for precise timing, like a quick “beep-beep” or a long, sustained honk.
Choosing the Right Micro Servo
For this project, I recommend the SG90 or MG90S micro servo. These are cheap, widely available, and run on 5V, which is the same voltage as most Arduino and ESP32 boards. The MG90S has metal gears, which is a plus if your horn mechanism requires a bit of force. The SG90 has plastic gears but is lighter and quieter. Both have a stall torque of around 1.5 kg·cm at 5V, which is more than enough to push a small horn button or strike a lightweight bell.
Core Components for the RC Car
Here’s a full list of what you’ll need. I’ve broken it down into subsystems so you can source parts easily.
Chassis and Drive Train
- Chassis base: A 4WD robot car chassis kit (acrylic or aluminum) with four wheels and two geared DC motors. These kits usually come with a battery holder and mounting screws. You can find them on Amazon or AliExpress for under $15.
- Wheels: The kit will include plastic wheels with rubber tires. If you want better traction, look for wheels with a foam or silicone tread.
- Motor driver: An L298N or L293D motor driver module. The L298N is more common and can handle up to 2A per channel, which is plenty for small DC motors.
- Battery pack: A 6V or 7.4V rechargeable battery pack (4x AA NiMH or a 2S LiPo). I prefer a 2S LiPo (7.4V) because it’s lighter and provides more consistent power to the motors and servo.
Control and Communication
- Microcontroller: An ESP32 or Arduino Uno. The ESP32 has built-in Wi-Fi and Bluetooth, which makes remote control via smartphone or gamepad much easier. If you want a dedicated radio controller, use an Arduino Uno with an nRF24L01 module.
- Radio module (if not using ESP32): nRF24L01 with an adapter board. This gives you a 2.4GHz link with a range of about 100 meters in open air.
- Joystick or gamepad: For the transmitter side, you can use a second Arduino with a joystick shield, or simply use a smartphone app like “Arduino RC Car” if you’re on ESP32.
Horn System (The Micro Servo Part)
- Micro servo motor: SG90 or MG90S.
- Horn sound source: This is where you get creative. Options include:
- A small brass bell (like a bicycle bell) with a plastic striker attached to the servo arm.
- A rubber bulb horn (the kind that goes “ah-OO-gah”).
- A piezo buzzer activated by a mechanical switch pushed by the servo.
- Mounting hardware: M2 screws and nuts, a 3D-printed servo bracket, or even a zip-tie solution for prototyping.
Power Distribution
- Voltage regulator (optional): If you’re using a 7.4V LiPo, you’ll need a 5V regulator (like an LM7805) to power the servo and the microcontroller safely. The motors can run directly on the battery voltage.
- Capacitors: A 100µF electrolytic capacitor across the servo power lines to smooth out current spikes when the servo moves.
Step 1: Assembling the Chassis
Start by building the chassis according to your kit’s instructions. Most 4WD kits have a two-layer acrylic frame. Mount the two DC motors to the bottom plate using the included brackets. Attach the wheels to the motor shafts with the set screws. Then, screw the battery pack onto the top plate.
Pro tip: Leave the top plate loose for now. You’ll need to run wires between the layers later.
Wiring the Motors
Connect the two DC motors to the L298N motor driver. Label them “Left” and “Right” so you don’t mix them up. The L298N has screw terminals for each motor (OUT1, OUT2 for Motor A, and OUT3, OUT4 for Motor B). Connect the motor wires arbitrarily; if a motor spins backward later, just swap the two wires.
- Motor A (Left): OUT1 and OUT2
- Motor B (Right): OUT3 and OUT4
Now connect the L298N to your microcontroller:
- ENA (Enable A) → GPIO pin on ESP32 (e.g., GPIO5)
- IN1 → GPIO pin (e.g., GPIO18)
- IN2 → GPIO pin (e.g., GPIO19)
- IN3 → GPIO pin (e.g., GPIO21)
- IN4 → GPIO pin (e.g., GPIO22)
- ENB (Enable B) → GPIO pin (e.g., GPIO23)
The ENA and ENB pins control the speed of each motor using PWM. If you don’t need variable speed, you can tie them to 5V to run at full speed.
Step 2: Setting Up the Micro Servo for the Horn
This is the heart of the project. I’ll describe two popular horn mechanisms: a bell striker and a bulb horn presser. Pick the one that fits your available materials.
Option A: Bell Striker Mechanism
- Mount the servo: Use a 3D-printed bracket or a metal L-bracket to attach the micro servo to the front of the chassis. The servo should be positioned so that its rotation arm can swing toward a small brass bell mounted nearby.
- Attach the striker: Screw a small metal rod or a thick paperclip into the servo horn. Bend the end into a small loop or a flat pad that will strike the bell.
- Mount the bell: Use double-sided tape or a small screw to attach a 1-inch brass bell to the chassis, directly in the path of the servo arm’s swing.
- Calibrate the angles: In your code, set the servo to 0 degrees (rest position) and 45 degrees (strike position). You may need to adjust these values based on your physical setup. The strike should be firm but not so hard that it damages the servo gears.
Option B: Bulb Horn Presser
- Mount the servo: Place the servo sideways, with its arm pointing toward the bulb horn’s squeeze bulb.
- Attach a pusher: Use a small rectangular piece of plastic or a 3D-printed paddle on the servo horn. This paddle will press against the bulb when the servo rotates.
- Secure the bulb horn: Use zip ties or a clamp to hold the bulb horn in place on the chassis. The horn’s trumpet should point outward so the sound projects.
- Calibrate the angles: The servo will start at 0 degrees (clear of the bulb) and rotate to 60 degrees to compress the bulb. Test the compression distance to ensure a full “honk” without crushing the bulb permanently.
Wiring the Servo
The micro servo has three wires:
- Brown (or black): Ground → connect to GND on the ESP32 and the L298N’s ground.
- Red (or orange): 5V power → connect to the 5V output of your voltage regulator (or the 5V pin on the ESP32 if it’s powered via USB, but for battery operation, use the regulator).
- Yellow (or white): Signal → connect to a PWM-capable GPIO pin on the ESP32, e.g., GPIO13.
Important: Do not power the servo directly from the ESP32’s 5V pin if you’re running on battery. The servo can draw up to 500mA under load, which will overload the ESP32’s onboard regulator. Always use a separate 5V supply or a regulator from the main battery.
Step 3: Programming the ESP32
Now for the code. I’ll use the Arduino IDE with the ESP32 board package. The code handles three main tasks:
- Receiving commands via Wi-Fi (or Bluetooth) from a smartphone or gamepad.
- Driving the motors in forward, backward, left, and right directions.
- Actuating the servo to produce the horn sound.
Wi-Fi Remote Control Setup
We’ll create a simple web server on the ESP32 that listens for HTTP requests. You can then use a browser or a custom app to send commands. For a more responsive experience, use WebSocket instead of HTTP, but HTTP is simpler for a tutorial.
cpp
include <WiFi.h> include <ESP32Servo.h>
// Wi-Fi credentials const char* ssid = "YourWiFiName"; const char* password = "YourWiFiPassword";
// Motor pins const int ENA = 5; const int IN1 = 18; const int IN2 = 19; const int IN3 = 21; const int IN4 = 22; const int ENB = 23;
// Servo pin const int SERVO_PIN = 13; Servo hornServo;
// Horn state bool hornActive = false;
WiFiServer server(80);
void setup() { Serial.begin(115200);
// Set motor pins as outputs pinMode(ENA, OUTPUT); pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT); pinMode(ENB, OUTPUT);
// Attach servo hornServo.attach(SERVO_PIN); hornServo.write(0); // Rest position
// Connect to Wi-Fi WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println("Connected! IP: " + WiFi.localIP().toString());
server.begin(); }
void loop() { WiFiClient client = server.available(); if (client) { String request = client.readStringUntil('\r'); client.flush();
// Parse the request if (request.indexOf("/forward") != -1) { forward(); } else if (request.indexOf("/backward") != -1) { backward(); } else if (request.indexOf("/left") != -1) { left(); } else if (request.indexOf("/right") != -1) { right(); } else if (request.indexOf("/stop") != -1) { stopMotors(); } else if (request.indexOf("/horn") != -1) { honkHorn(); } // Send HTTP response client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(""); client.println("<h1>RC Car Control</h1>"); client.println("<a href='/forward'>Forward</a><br>"); client.println("<a href='/backward'>Backward</a><br>"); client.println("<a href='/left'>Left</a><br>"); client.println("<a href='/right'>Right</a><br>"); client.println("<a href='/stop'>Stop</a><br>"); client.println("<a href='/horn'>Honk Horn</a><br>"); client.println(""); client.stop(); } }
Motor Control Functions
These functions set the direction of the two motors. For differential steering (skid-steer), turning is achieved by running the motors in opposite directions.
cpp void forward() { digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW); digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW); analogWrite(ENA, 200); // PWM speed (0-255) analogWrite(ENB, 200); }
void backward() { digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH); digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH); analogWrite(ENA, 200); analogWrite(ENB, 200); }
void left() { digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH); digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW); analogWrite(ENA, 150); analogWrite(ENB, 150); }
void right() { digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH); analogWrite(ENA, 150); analogWrite(ENB, 150); }
void stopMotors() { digitalWrite(IN1, LOW); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, LOW); analogWrite(ENA, 0); analogWrite(ENB, 0); }
The Honk Function
This is where the micro servo shines. The function moves the servo to the strike position, holds it for a moment, then returns to rest. You can add multiple honks for a “beep-beep” effect.
cpp void honkHorn() { if (!hornActive) { hornActive = true; hornServo.write(45); // Strike position (adjust for your mechanism) delay(200); // Hold for 200ms hornServo.write(0); // Return to rest delay(100); // Optional: double honk hornServo.write(45); delay(150); hornServo.write(0); hornActive = false; } }
Why the hornActive flag? It prevents the horn from being triggered multiple times in rapid succession, which could cause the servo to jitter or overheat. The servo needs time to return to its rest position before the next strike.
Step 4: Power Management and Testing
Before you power everything up, double-check your connections. A common mistake is connecting the servo power to the wrong voltage or sharing a ground incorrectly. All grounds (ESP32, L298N, servo, battery) must be connected together.
Power Budget
- ESP32: ~80mA
- L298N + motors: 200-500mA per motor under load
- Micro servo: 150-500mA peak during movement
Total peak current is around 1.5A. A 2S LiPo (7.4V, 1500mAh) will run this setup for about 30-45 minutes of continuous driving. If you use a 6V battery pack (4x AA), expect shorter runtime due to lower capacity.
Testing the Horn
- Upload the code to the ESP32.
- Open the Serial Monitor to see the IP address.
- Open a browser on your phone or laptop and navigate to
http://<ESP32_IP>. - Click the “Honk Horn” link. You should hear the servo move and the horn sound. If the servo doesn’t move, check the wiring and ensure the servo’s PWM pin is correct.
If the horn sounds weak, adjust the servo angle in the honkHorn() function. For a bell striker, you might need 50 degrees instead of 45. For a bulb horn, you might need 70 degrees to fully compress the bulb.
Step 5: Enhancing the Horn Experience
A single honk is nice, but you can do so much more with the micro servo’s precision. Here are some advanced ideas.
Variable Honk Duration
Instead of a fixed 200ms honk, let the user control the duration by holding down the button. On the web interface, you can implement a “press and hold” using JavaScript, but a simpler approach is to use two endpoints: /hornStart and /hornStop.
cpp void honkStart() { hornServo.write(45); hornActive = true; }
void honkStop() { hornServo.write(0); hornActive = false; }
In the client code, you’d send /hornStart on mousedown and /hornStop on mouseup. This gives the user full control over the honk length.
Rhythmic Honking
Use a timer to create a pattern, like the classic “beep-beep-beep” of a truck backing up. You can do this without any user interaction — just call the honk function in a loop with delays.
cpp void alarmHonk() { for (int i = 0; i < 3; i++) { hornServo.write(45); delay(100); hornServo.write(0); delay(200); } }
Using the Servo as a Musical Instrument
If you mount a series of metal bars (like a small xylophone) and program the servo to strike different bars at different angles, you can play simple melodies. The micro servo’s angular precision (about 1 degree) allows you to hit up to 180 different notes. This turns your RC car into a mobile music box — a fun party trick.
Troubleshooting Common Issues
The Servo Jitters or Doesn’t Move
- Power issue: The servo isn’t getting enough current. Add a 100µF capacitor between the servo’s power and ground pins.
- PWM pin conflict: Some ESP32 pins are not PWM-capable. Use GPIO13, 12, 14, or 27. Avoid GPIO0, 2, and 15 during boot.
- Wrong servo angle: Make sure the angle you’re writing is within the servo’s range (usually 0-180). Writing 200 will cause undefined behavior.
The Horn Sound Is Too Quiet
- Mechanical leverage: The servo arm might not be striking the bell hard enough. Attach a longer arm or use a stronger servo like the MG90S.
- Resonance: The bell needs to be mounted on a rigid surface. If it’s on a flexible plastic chassis, the sound will be dampened. Add a metal bracket or a small wooden block behind the bell.
The Car Doesn’t Drive Straight
- Motor speed mismatch: Even identical motors have slight variations. In the
forward()function, adjust the PWM values individually. For example, set ENA to 200 and ENB to 210 to compensate. - Wheel alignment: Make sure all four wheels are touching the ground evenly. If the chassis is warped, add washers under the motor mounts.
Final Thoughts on the Micro Servo Horn
The micro servo motor is often overlooked in RC car projects, where people default to simple buzzers or speakers. But by using a servo to physically actuate a sound-producing mechanism, you gain a level of realism and interactivity that electronics alone can’t match. The servo’s precision allows for nuanced control — quick taps, long presses, rhythmic patterns — and its mechanical nature means the sound is acoustic, not synthesized. There’s something deeply satisfying about hearing a real bell ring or a rubber bulb honk when you press a button on your phone.
This project is also a great foundation for further experimentation. You can replace the horn with a servo-actuated claw, a camera tilt mechanism, or even a small flag that raises when the car is in “alert” mode. The skills you’ve learned — PWM control, mechanical linkage design, and wireless communication — apply directly to robotics, animatronics, and IoT devices.
So go ahead, build your RC car, wire up that micro servo, and give it a voice. And when you drive it around the park, don’t be shy about honking at pedestrians — they’ll smile when they realize it’s not a digital beep, but a real, physical honk coming from a tiny robot car.
Copyright Statement:
Author: Micro Servo Motor
Link: https://microservomotor.com/building-remote-controlled-cars/rc-car-horn-sound.htm
Source: Micro Servo Motor
The copyright of this article belongs to the author. Reproduction is not allowed without permission.
Recommended Blog
- How to Build a Remote-Controlled Car with an Aerodynamic Body
- How to Build a Remote-Controlled Car with Telemetry Sensors
- How to Build a Remote-Controlled Car with a Rack and Pinion Steering System
- How to Build a Remote-Controlled Car with a Smartphone App
- Building Your First Remote-Controlled Car: A Beginner's Guide
- How to Build a Remote-Controlled Car with a Lightweight Body
- Understanding the Basics of Radio Frequency Control in RC Cars
- How to Build a Remote-Controlled Car with a 3D-Printed Chassis
- How to Build a Remote-Controlled Car with Wi-Fi Control
- How to Build a Remote-Controlled Car with a Digital Proportional System
About Us
- Lucas Bennett
- Welcome to my blog!
Hot Blog
- How to Build a Remote-Controlled Car with a Lightweight Body
- Building Your First Remote-Controlled Car: A Beginner's Guide
- Micro Servo Motor Gear Types: Plastic vs Metal Gears
- Comparing Micro Servo Brands for Robotics Projects
- Voltage Drop at Wire Leads: Spec vs Real-World Conditions
- How to Prevent Binding in RC Car Steering with Micro Servos
- Brushless vs Brushed Micro Servos for Long-Lasting RC Boat Use
- Understanding the Basics of Control Circuit Design
- The Role of Voltage and Current in Motor Torque and Speed
- The Importance of Signal Integrity in PCB Design
Latest Blog
- How to Build a Remote-Controlled Car with a Horn Sound
- Using Arduino to Control the Angle, Speed, and Direction of a Micro Servo Motor
- How to Connect a Micro Servo Motor to Arduino MKR NB 1500
- Exploring the Use of Micro Servo Robotic Arms in Logistics
- The Evolution of Gear Materials in Servo Motors
- Micro Servo Motors in Automated Assembly Lines
- What Voltage and Power Do Micro Servo Motors Require?
- Micro Servo Motors in Automated Sorting Systems
- Designing a Micro Servo Robotic Arm for Military Applications
- Vector's Approach to Compact and Efficient Micro Servo Motors
- Using Raspberry Pi to Control Servo Motors in IoT Applications
- How to Build a Remote-Controlled Car with an Aerodynamic Body
- Thermal Performance: How Micro and Standard Servos Handle Heat
- High Precision Micro Servos for Scale RC Airplanes
- The Impact of Artificial Intelligence on Micro Servo Motor Control Systems
- How to Build a Remote-Controlled Car with Telemetry Sensors
- How to Select Micro Servos for RC Airplanes & Park Flyers
- The Impact of PWM on Signal Distortion: Techniques and Tools
- The Role of Duty Cycle in PWM Signals
- Micro Servo Motor Latency Issues in Real-Time Robot Control