Saturday, January 16, 2016

One of my current projects: Arduino police siren w/simple, custom transistor amplifier/speaker driver circuit


Subscribe by Email!
By Gabriel Staples Written: 16 Jan 2016
Last Updated: 2 Oct. 2017
History (newest on top):
2 Oct. 2017 - link to source code added
16 Jan 2016 - first written

A Few Other Articles:
So, a few days ago I got a car horn *and* a car audio speaker to play a siren sound!

In these two videos, I do a quick desktop demo of playing a siren sound through first a "fixed frequency" car horn, and then through a standard car audio speaker, rated at 120W peak, 60W RMS, and 4 Ohms. Using an Arduino, a relatively simple, custom transistor-based amplifier circuit, and the Arduino core tone() function in my code, I drive the horn and speaker to play a siren sound by sinusoidally varying the driving frequency.  I also show the signal to the devices on an oscilloscope, and briefly discuss and hook up a Schottky diode in a "snubber diode" configuration to knock down the inductance-induced voltage spikes created each time the square wave has a falling edge.

First, watch the "fixed frequency" type car horn play a varying-frequency siren sound:




Advertisement
Next, watch the car audio speaker get driven by the same Arduino, code, amplifier circuit, and 3S LiPo battery. It is *much* louder!

SOURCE CODE: http://www.electricrcaircraftguy.com/2017/10/arduino-sine-wave-siren-code.html


END


***Subscribe by Email!***

11 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. I watched your video very successful, I want to do the melody work in the car horn (I tried to run the horn on different frequencies but the volume is low) How can I increase the horn decibel? I am very pleased if you can help me very importantly.

    ReplyDelete
    Replies
    1. Try driving the speaker through a high-power H-bridge designed for driving DC motors. To power it, use a LiPo battery of the correct voltage for the speaker. Also consider placing a high-capacitance (ex: 4700uF or larger) AC-coupling capacitor in series between the speaker and the H-bridge to help remove any DC bias.

      Delete
    2. Also use the Arduino ToneAC library to drive the H-bridge/speaker so that you can dual-drive the speaker, thereby getting less DC bias and double the volume that you'd normally get from the basic "tone" library.

      Delete
    3. WARNING: for the AC-coupling capacitor, it *must* be bipolar, meaning it is electrolytic but NOT polarized. If you use a polarized capacitor and then dual-drive it, you'll blow the capacitor. It is possible to make an electrolytic bipolar capacitor from two electrolytic polarized capacitors back-to-back, with a couple of high-speed diodes too, but I'll have to explain that one more later. Try googling it or just buy a bipolar (non-polarized) electrolytic capacitor to start.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Could add from my facebook address.https: //m.facebook.com/devotedster? Ref = bookmarks

    ReplyDelete
  5. (To spammer John Snow): Send me one for free and I'd be glad to review it. But since this sounds like spam, you have 24 hrs to either send me one for free or explain how this isn't spam, or else I delete your comment.

    UPDATE: I changed my mind, spammer. I've deleted your comment. If you send me a free one you can put your comment back up.

    ReplyDelete
  6. Hi Gabriel, really interesting article. I'm new to the world of arduino so some of this stuff is kinda hard to grasp sometimes. Could you upload your connections diagram to this? Also, would it be possible, if I just wanted to use the car horn, to replicate the behavior with just a pwm pin, a mosfet and a diode? If not, why not? Thank you very much for your time.
    Juan

    ReplyDelete
  7. can you post a wiring diagram by any chance?

    ReplyDelete
  8. hola, tendrias ademas del codigo en arduino los planos de las conexiones y una lista de materiales necesarios?

    ReplyDelete

Thanks for your comment or question! If it is a question, I will try to get back to you quickly. Notice to spammers: I personally remove all spam promptly and report spammers to Google, so please don't do it.

Note: some HTML tags are allowed in your comments. To learn how to add bold (<b>...</b>), italics (<i>...</i>), or hyperlinks (<a href="URL">NAME</a>) to your comments, read here.

~Sincerely, Gabriel Staples.

P.S. Yo hablo español también. Je parle français aussi. (I speak Spanish & French too).