Introduction: Digital Car Horn
This Instructable will help you build a digital horn for your car! It will play up to 83 sound effects/clip using a small control pad of 11 buttons. Three of the buttons are dedicated to "favorite" sounds, while the remaining eight buttons represent sound "categories" that store 10 sounds each. Each press of these latter buttons will play a random sound from that category.
Note: This project isn't limited to car horns! It can be added to toys, bicycles, motorcycles, kids' riding vehicles, and anything else that needs sound effects. The control pad is relatively small and can fit anywhere.
The heart of the system is the Adafruit Audio FX board. There is no programming involved; simply connect the board to your computer via a micro USB cable and it turns into a flash drive. Copy OGG audio files to it (it's easy to convert to OGG from MP3 or WAV) with a particular naming convention that will match the buttons on the control pad. This is explained more later on.
The Audio FX board is powered with a micro USB cable and outputs sound via a 3.5mm jack. This is fed into an inexpensive 120W amplifier that supports one or two horns. The horns are 5" 15W PA-style horns, easy to fit into an engine compartment. One horn has decent volume, but I installed two horns for a bit more loudness.
This project requires 3D printing for the control pad and amplifier enclosure. If you don't have a 3D printer, then you can manually build these with other means; it's not rocket science. :)
Thanks for Mark Rober's video build of his car horn that inspired my project:
Let's get started!
Step 1: Parts Needed
Note there are four variations of this board. Get the board with 16MB of memory, a 3.5mm audio jack on one end, and a micro USB connector on the other.
This 15W speaker is decently loud enough for use as a car horn and small enough to fit into an engine compartment. I installed two horns for best overall loudness. These speakers are weather resistant, too. Note these are PA-style horns with no bass. Simple sound effects will sound good, but rich music will not.
This is a stereo amplifier, meaning that it can drive one or two horns. I connected two horns to mine for adequate (in my option) loudness. Be sure to look at the photo in this step of the Instructable to be sure you buy the same style as the one in the photo.
You will use 11 of these buttons for the project. These are 12mm buttons. There is a colored cap that snap onto a yellow stalk on the button. Look at the photo in this Instructable. Buy this exact style so that they fit the 3D printed control pad properly!
The buttons will mount to this. Any kind of perf board will do, provided that it has the standard 2.54mm (0.1") hole spacing. Perf. board with or without individual copper pads are fine, though make sure that the holes are not electrically connected via metal traces! If you buy a board larger than the above size, you can score & snap it to the size you need.
This will connect the audio output from the Audio FX board to the amplifier. Only one end needs to be right angled to fit into the control pad enclosure. The other end can be male or female.
This will provide power to the Audio FX board. The micro USB end is left angled to fit into the control pad enclosure, while the USB-A end will connect to the 5V power source (see below).
This allows the 12V lighter port in your car to be converted to 5V to power the Audio FX board. The board needs very few amps, so a cheap, low-amp car charger should work fine.
This provides 5V power (via the USB car charger above) to the Audio FX board and 12V power to the amplifier above. Buy two of these; cut-off the male connector on the second splitter to build a custom cable that will connect to the amplifier. You can use this modified cable to disconnect power to the amplifier at-will via the splitter.
You'll need two of these. These connectors make it easy to connect the 11 buttons to the Audio FX board.
It is likely that you will hear a hum in the horn when not in-use. This is coming from your car's electrical system. This isolator goes between the Audio FX 3.5mm output and the amplifier to remove the hum.
This connects the left-angle micro USB adapter cable (above) to the USB car charger (above). It's important to purchase both this cable and the left-angle cable so that you can disconnect the cable easily to upload new sound effects with a laptop near the car.
Not much is needed, just a foot or so. Make sure that it is very thin and solid core (not stranded). This is used to solder & connect the buttons' ground terminals to each other. You can also use leftover wire from the 7-pin JST connectors above, but this wire is stranded and will be harder to solder with the buttons' close placement and tiny legs.
Step 2: Wiring Overview
Please refer to the attached picture that outlines the car wiring for the project.
Car lighter socket or relay for power?
The car horn system gets its power from your car's 12V cigarette lighter / accessory socket. This socket only provides power when the car is running or the car key is turned to "accessory". This way the car horn does not drain your car's battery when the car isn't running. I run an extension cable from the lighter socket to under my car seat, keeping all of the wiring out-of-view.
If your car does not have an accessory port or the port is not conveniently located to provide power to the horn, you can skip using the accessory port. Instead, connect an automotive relay to the car battery, then tap into the fusebox to provide power to the car horn only when the car is running. If you prefer this power solution instead, message me and I will provide wiring advice.
With the lighter/accessory socket approach, the overview is below. Details are provided later in the Instructable.
Insert a socket splitter into the lighter socket. Insert a 12V to 5V USB power adapter into one of the splitter's output sockets, then connect a micro USB cable into the adapter. This will provide power to the Audio FX board.
Build a custom cable that has a male 12V lighter/accessory plug on one end and bare wires on the other. Connect the male plug to the splitter's output sockets. This will provide 12V power to the amplifier.
Sound output from the Audio FX board is sent to a ground loop isolator via a 3.5mm cable. This removes noise generated from your car's dirty power output. Build a custom cable with a 3.5mm plug on one end (this cable comes with the ground loop isolator) and a 3-pin white JST plug on the other end (a cable with this plug comes with the amplifier). This connects the isolator to the amplifier, providing a clean audio signal to it.
The horn(s) connect to the amplifier. Each horn comes with a long cable with a 3.5mm mono plug. Mount the horn in the engine compartment, cut-off the plug, then fish the cable through the car's firewall into the cabin. Once inside the cabin, connect the horn's cable to the (+) and (-) terminals on the amplifier. Repeat if you want to install a second horn (the amplifier has two sets of terminals to support two horns).
Lastly, build the control pad. This involves mounting 11 buttons on a perf. board and soldering wires between each of them to provide a common ground. Connect this ground wire to the GND pin on the Audio FX board. Then connect each buttons' non-grounded legs to pins 0-10 on the board.
It all sounds like a lot of work, but most of it is easy. Soldering the control pad is tricky as it is tiny wiring work.
All of these steps are explained in detail in further steps. Let's get started with building the control pad!
Step 3: Build the Control Pad
3D print the control pad
The buttons and Audio FX board fit inside a 3D printed control pad. You can download the STL and print it here:
Print the control pad with the button hole facing down. Print with ABS filament so that the heat of the sun inside the car doesn't melt the control pad (do not use PLA). Print with 15% infill and no supports.
Once printed, push the legs of the 11 button switches into the perf. board so that they align with the holes in the control pad.
Note that the buttons switches are not symmetrical, even though they look it. There are tiny letters stamped into the bottom of each one. Make sure that the lettering faces the same direction for each switch that you press into the perf board. This is important so that the button caps align into the control pad's holes properly.
The eight button switches on the right of the control pad face the same direction in the perf. board. Of the three left-side switches arranged in a triangle shape on the left side of the pad, the top switch needs rotated 90 degrees on the perf. board so that it fits into the control pad properly.
Modify button caps
The button spacing is very tight. The colored button caps will rub against each other as a result. When you look at the caps, each has a collar. Use a Dremel tool to shave-off some of the collar so that the button collars will not touch each other when mounted to the button switches on the perf. board.
Attach the colored caps onto each button, then test-fit the buttons by inserting the perf board into the control pad. The buttons should travel freely without sticking. Once you are satisfied with the fit, flip the board over, push on each switch to seat it firmly on the board, then bend each switch's legs 45 degrees to keep the switch from moving while soldering in the next step.
Paint button caps (optional)
The button caps come in a kit of five colors. If you want to paint the caps so that each is a different color, Testor's model paint (enamel) works well. Do not paint thickly, paint the caps with a few thin layers as possible to avoid friction with the control pad's holes.
Step 4: Wire the Control Pad
The control pad will have 12 wires connecting it to the Audio FX board. 11 wires for the buttons and the 12th wire for ground.
Instead of running individual ground wires from each button to the Audio FX board, daisy chain a ground wire between each button. On the final button, a single wire can then connect to the board.
To determine which pins to connect the ground wires to, use a voltmeter, setting it to continuity mode. Each button has four legs. Three legs will complete a circuit when the button is not pressed. These are the legs you can connect wires to when daisy chaining the buttons together for the common ground wire.
Solder the thin wire onto the legs between buttons. It is tiny, delicate work. I find it helpful to bend each end of the wire into a hook shape with needle-nose pliers, then pinch the hook onto the buttons' legs before soldering.
Once you have connected all of the buttons with a common ground wire, test continuity between the first and last buttons in the chain. You should have continuity with no buttons pressed.
Step 5: Build Control Pad Connectors
Attach the 14-pin male header
The Audio FX board should have included a 14-pin male header. Insert this header into the top of the board, carefully flip over the board, then prop the board so that it sits level. Then solder the header pins from the bottom of the board.
Prepare two 7-pin female plugs
The two 7-pin JST connectors have white plugs. These will attach to the 14-pin male header that you soldered to the Audio FX board. These JST connectors have lips that prevent them from being flush against each other. Use a Dremel tool to trim-off these lips.
Solder connector wires to Audio FX board
The next step is soldering the JST connector wires to the button pad. On the Audio FX board, there are 14 pins. However, you will not use the first pin (RST) nor the 13th pin (ACT). Instead, the buttons will connect to pins 2-12 (when counting from the left), marked as 0-10 on the board. The buttons' common ground will connect to pin 14 on the board, marked as GND.
Shorten the wires on the JST connector, leaving about 3" length. Conservatively strip the ends of the wires, then solder wires 2-12 to a leg on each button. Make sure the button leg that you choose does not short to the ground wire for that button. In other words, be sure to solder to the 4th leg that is not a common ground. To determine which leg is the correct one, use a voltmeter in continuity mode. The leg that shorts to one of the ground legs when the button is pressed is the leg that you want to solder the wire to.
As for the order of the wires on the buttons, use the attached picture as a reference.
Attach plugs and cables to the Audio FX board
Attach the Left-angle micro USB extension cable to the Audio FX board. Attach the right-angle plug of the 3.5mm cable to the Audio FX board.
Connect the two 7-connectors to the Audio FX board, making sure that the button wires align with pins 0-10 and the ground wire gets to GND on the board. Finally, attach the board to the control pad using three screws (or bolts) that pass through the holes on the board but are large enough to grip into the receiving holes on the 3D printed control panel. You're done building the control pad!
Step 6: Prepare Sound Files
Choosing sound file format
The Audio FX board accepts sound files in OGG or WAV format. You'll want to use OGG as the file sizes are smaller, allowing you to load over 80 sound files onto the board. WAV files can take around 10 times more space.
Note: A great place to find sound effects is https://www.zedge.net/find/sound%20effects. You don't to create an account, the files are free, and download as MP3 (you need to convert these to OGG).
Trimming sound file length (timewise)
Sound files should be relatively short when used as a car horn. My sounds effects are between 7 and 18 seconds. You can use the free Audacity program here to shorten sound files that are too long (time wise). You can find lots of Audacity tutorials on YouTube here to learn how to do this.
Adjust sound file volume
If you are downloading sound files from the Internet, it is likely that the volume will be different among the files. Use the free MP3Gain program here to set all of your sound files to 100.0 db. Click here for tutorials how to use MP3Gain.
Convert sound files to OGG format
Most sounds effects that you find on the Internet will be in MP3 or WAV format. To convert them to OGG format, download this free program VSDC Audio Converter here. After installing the program, here is how to convert a file to OGG
Click Files > Open Files in the top menu, then find/choose the MP3 file that you wish to convert
- Click Formats from the top menu, then choose [To OGG] button in the top bar
- Click Edit Profiles on the right side of the screen
- At the bottom of the window, choose "160 kbps" for the Audio bitrate and "Mono" for the Channels
- Tip: If, after converting all of your sounds files to OGG, the total size of all of the files is greater than 16 megabytes, reconvert the MP3 files to 128 kbps to reduce the total size to less than 16 megabytes.
- Click [Apply profile] button at the bottom-right corner of the screen
- Click the [Convert Files] button in the top bar
- The converted file will be placed in your computer's Music folder
Naming the sound files
The sound effect files need to have particular filenames in order for the Audio FX board to assign them to particular buttons. For sounds assigned to the three "favorite" buttons on the left side of the control pad (the triangle shaped area), name the files:
Note that the control pad has 11 buttons, but the Audio FX board assigns the first button "00" and the 11th button "10".
Each of the remaining eight buttons on the control pad (the two rows of four) can have up to 10 sound files each. When one of these buttons is pressed, the Audio FX board will play a random file of the 10 associated with that button.
For the first of the eight buttons, name up to 10 sound files:
For the second of the eight buttons, name the 10 sound files:
...and so on. You don't need to have 10 sound files for each button, but you get the idea how to name them.
To finish, here is how to name the sound files on the eighth button:
For a detailed description on naming the sound files for the Audio FX board to use, click here.
Upload the sound files to the Audio FX board
To upload the sound files to the Audio FX board, connect it to your computer via a micro USB cable. It will appear as a flash drive. Simply copy the files as you would with any flash drive. The transfer process is slow, but it will work. That's it!
Step 7: Test the Audio FX Board
At this point, your Audio FX board should be connected to the control pad buttons via the two 7-pin JST connectors. These wires tell the board which button that you pressed as well as provide a common ground to all of them. You also have the left-angle micro USB cable and right-angle 3.5mm cable attached to the board.
To test the board, connect a pair of PC speakers to the 3.5mm cable. Provide power to the board with a phone charger that has a micro USB plug. Do not power the board with a USB port from the computer as this puts the board into "flash drive mode" where the buttons will be unresponsive.
When you apply board to the board, the speakers may make a soft "pop". This is a good sign. When you press a button, a red light will appear on the board as the sound is played on the speakers. Note that you need to wait for the red light to go out (wait for the current sound to finish playing) before you can play a different sound.
- If the red light is not coming on when you press a button, then the button wiring on the control pad may be incorrect. Make sure that each button has a leg that connects to the ground pin on the board. Check that another pin on that button completes a circuit to the 0-10 pin on the board only when the button is pressed.
- Another idea is to remove the two JST connectors from the board then connect two female-to-male cables to the board manually. One cable goes to pin 0-10 and the other goes to ground. When you touch the two wires together, a sound should play.
- Also check that the filenames are named properly as explained in the previous step.
Step 8: Powering the Control Pad and Amplifier
Using a a lighter/accessory socket for power
Your car should have a cigarette lighter power socket (also called an accessory power port) which will be used to power the control pad and the amplifier. The horn(s) will receive power from the amplifier.
Note: Some car's lighter/power socket is not in convenient location; you may see unsightly cables for your car horn project when you finish building it. One option is to build an extension cable for the socket splitter cable so that you can hide the splitter and its cables under the car seat.
Using an automotive relay instead
Another option is to skip using the lighter socket altogether. Instead, wire an automotive relay to the 12V car battery, connecting the "switch" portion of the relay to a fuse in your fuse box that activates the relay only when the car is running. If you are interested in this latter option, do this:
What you will need to do is get an automotive relay. It has four terminals. Two of them go to the positive & negative terminals on your battery.
The third terminal is an output that feeds power to your horn & sound board.
The fourth terminal is a "trigger" that allows the power from the battery to pass to the output terminal. You'll need to find the fuse box(es) in your car and find which fuse only provides power when the key is in ACC or when the car is running. Fuses marked "ACC" or "lighter" are a good place to start looking at.
Once you find an acceptable fuse, you can buy a fuse tap that allows you to tap-in a wire from the fuse to the fourth terminal on the relay.
For more information on installing automotive relays, search for that on YouTube.
Important Note: Most cars do not provide power to the cigarette lighter / accessory socket when the engine is not running. This is good so that the amplifier does not slowly drain the car's battery when the car isn't running! Use a voltmeter on the power socket to ensure that your car works this way! If your car provides power to the power socket if the car is off, you'll need not use the socket method below and wire a relay to the battery instead.
Wire the lighter power socket
For the lighter power socket solution, follow these instructions:
- To power the control pad:
- Insert the socket splitter into you car's lighter power socket.
- Insert the 12V to 5V USB power adapter into one of the sockets of the splitter
- Connect the USB A to Micro USB cable to the above adapter
- Fish the above cable to where you will install the control pad
- Connect the above USB cable to the female micro USB connector on the control pad
- The power cable will be a custom cable with a male car lighter plug on one end and bare wires on the other end. This cable should have two conductors for positive and negative (ground) signals coming from the plug. Use a voltmeter to visually mark the conductors' polarity; the tips of the plug is positive and the metal clips on the side of the plug are negative.
- Connect the male plug of this cable to one of the splitter's female sockets.
- Fish the cable to where you will mount the amplifier (should be near the control pad)
- On the amplifier, the green terminal on the same side of the white connector is the power input. Connect the positive and negative conductors of the cable to the respective sockets of this terminal.
- Tip: To make the amplifier easy to disconnect in case of future problems, solder a 2-wire male/female removable connector to this cable.
Step 9: Prepare the Amplifier
The amplifier receives the audio signal from the Audio FX board, amplifies it, then sends it to 1-2 car horns. While the Audio FX board requires roughly 5V to operate, the amplifier requires 12V. This is the native voltage of a car battery (in gas cars, at least).
To begin download and 3D print an enclosure for the amplifier here. Print the lid facing down and the enclosure with supports enabled. As with the control pad, print with ABS plastic to ensure the heat of a hot car. The lid is supposed to be snug-fit, but if your printer is perfectly calibrated, the lid may not stay on the enclosure. If that happens, print the lid at 1% or more larger scale or simply tape the lid on.
As with the control pad, find screws that are small enough to pass through the holes on the amplifier, but large enough to grip the enclosure's mounted when gently tightened.
Note with cables: Instead of attaching the horn(s) signal cable and power cable directly to the amplifier, I chose to add a 2-pin male/female connectors to these cables, before they connect to the amplifier. This way I could easily disconnect the amplifier in the future if needed.
On one side of the amplifier are two green terminals. These are for the horn(s). It doesn't matter which horn attaches to which block, but what does matter is the polarity. If you purchased the horns recommended in this Instructable, there are two connectors in it's black cable. The conductor marked in white is the positive signal, the all-black conductor is negative. The circuit board is marked positive & negative near the terminal blocks, so attach the horn's cable appropriately.
The power input on the amplifier is another green terminal on the same side of the board as the white connector. With the cable that you created in the previous steps (a male car lighter plug on one end and bare cables on the other), connect this to the green power terminal. The conductor that goes to the lighter plug's top is positive and the other conductor that goes to the plug's metal side ears is negative.
It is likely that the 12V power provided by your car is "dirty"; it could introduce a hum into the sound going to the horn. To easily fix, this, connect the straight, male end of the 3.5mm cable coming from the control pad to the ground loop isolator.
The isolator should have come with a short 3.5mm cable with straight plugs on both ends. Cut-off one of the plugs. Strip the exposed end to show the wire colors. There are three conductors in this cable. If you look at the 3.5mm plug, there are three metal sections. The conductor that connectors to the tip of the plug is the positive audio signal, the middle metal section of the plug is the negative signal, and the metal band at the base of the plug (closest to the cable) is the ground.
The amplifier should have come with a gray cable with white connectors on each end. Cut one of the connectors off, then strip the exposed end to reveal three conductors: white, red, and black. Solder the three conductors on your 3.5mm cable to this gray cable like this:
- Positive signal (3.5mm plug tip) to red conductor on gray cable
- Negative signal (middle metal band on 3.5mm plug) to white conductor on gray cable
- Ground (lower metal band on 3.5mm plug) to black conductor on gray cable.
Connect the white plug on the gray cable to the white socket on the amplifier.
Adjust amplifier volume
The amplifier is rated at 100-120 watts per horn, but the horn itself is rated 15-25W. There are two white knobs on the amplifier. If these volume knobs are turned all of the way up, you will hear distortion in the horn(s) as it plays sound, especially with rich sound like songs.
For the optimal volume level, use a small flat blade screw driver to turn turn both white knobs clockwise until they stop. Then turn them counter-clockwise 1/2 turn on both knobs.
Step 10: Install the Car Horn(s)
One of the tricky parts of this project is finding room in your engine compartment for the horn(s). Although the horns are relatively small, they may present a challenge. Open the hood and take a look. Keep the horn away from hot engine components and away from open exposure to the road from rain, snow, etc., if possible. These are water resistant horns, but keep them protected if you can. Also place the horns in a way that won't make the engine difficult to access by mechanics.
You can use zip ties to secure the horn(s) or bolt the horns to existing bolt holes in the engine compartment. On some cars, you can mount the horn(s) to the frame behind the radiator, avoiding the engine compartment altogether.
Fish horn cable(s)
The Pyle horn suggested in this Instructable come with an attached, long two-conductor cable with a 3.5mm plug. You need to find a way to pass this cable from the engine compartment to inside the car's cabin. This can be tricky!
Here is one idea that worked for me. If you look near the steering wheel area from inside the engine compartment, you may see a bundle of wires with a large rubber grommet around it. Then look in the cavity where the gas pedal is (inside the cabin), to see where the other side of the grommet is.
Take a coat hangar or a heavy-gauge house electrical wire that is difficult to bend. Cut the end at 45 degrees to make a sharp point. CAREFULLY push it into the collar of the grommet from inside the engine compartment, keeping it away from the car's bundle of wires using that grommet. Be very carefully not to damage any of these wires! With enough force, the sharp point will pierce the grommet and you can push the sharp wire/coat hanger through to the cabin.
Cut-off the 3.5mm plug on the horn(s). Attach the cable to the end of the sharp wire/coat hanger with masking tape, wrapping the tape around both wires in a spiral so that both are butted against each other, making the assembly as thin as possible. From inside the cabin, pull the sharp wire/coat hanger into the cabin so that the horn cable will follow in. Repeat for the second horn if needed.
Step 11: Connect Car Horn to Amplifier
Lastly, visually mark the car horn cables (now in the cabin) for polarity. On this black cable, the conductor marked with white is positive and the pure black conductor is negative.
Tip: If you wish the horn cables to be disconnectable from the amplifier, solder a male/female removable connector to the horn cables.
On the amplifier, there are two green terminals on the same side of the board. These are for the horn(s).
Connect the positive and negative leads on the car horn(s) to the respective green terminals on the amplifier. If you are only using one horn, it doesn't matter which of these green terminals that you attach it to.
Step 12: Test the Car Horn!
Your car's cigarette lighter / accessory socket should not provide power while your engine is not running. So when the engine key is not inserted, the control pad and horn is not usable.
To test the horn, either start the car or turn the key to the "accessory position". You may hear a slight pop from the horn, indicating that the control pad and amplifier are getting power. Press a button on the control pad; you should hear a sound effect on the horn! If not, consider these troubleshooting tips:
- Make sure the control pad is getting power. Disconnect the micro USB cable from the control pad's female connector. Plug the male end into your phone; it should show a "charging status" if the cable is providing power. If not, make sure the connections between this cable, the 12V to 5V adapter, the splitter cable, and the car lighter socket are all secure.
- Make sure that the amplifier is getting power. I think the amplifier has a power light. If there is no light, make sure the connections between the amplifier's cable, the splitter cable, and the car lighter socket are all secure.
- Check the filenames of the OGG files on the Audio FX board. They may be named incorrectly. At the very least, name 11 files T00.OGG, T01.OGG to T10.OGG. To check the files while the control pad is in the car, disconnect the female micro USB connector on the back of the control pad, then use a separate micro USB cable to connect the control pad to a laptop.
- Make sure the white volume knobs on the amplifier are turned clockwise enough to reach volume.
Some buttons do not work
- The button hats may be rubbing against the control pad's front holes. You may need to shave the holes a bit larger or reposition the circuit board where the buttons are attached.
- The button wiring may be incorrect. Each button needs to have a ground wire to the Audio FX board (all of the buttons can share the same ground wire). Perhaps some button's legs are not wired to the signal pins on the Audio FX board properly and are shorting straight to ground instead. To determine which pins to connect the ground wires to, use a voltmeter, setting it to continuity mode. Each button has four legs. Three legs will complete a circuit even if the button is not pressed. These are the legs you can connect wires to when daisy chaining the buttons together for the common ground wire.
- The two white volume knobs on the amplifier are turned to maximum. Use a small flat-blade screwdriver to turn them clockwise to maximum, then turn them both a half-turn counter clockwise to reach an optimal volume for the horns.