24.09.2024
Home / News / Police quack (siren) on a PIC microcontroller. Do-it-yourself police quack on PIC Quack on a car from domestic parts

Police quack (siren) on a PIC microcontroller. Do-it-yourself police quack on PIC Quack on a car from domestic parts

Before starting the article, I want to warn you that the use of such signaling devices is illegal, at best you will face a hefty fine. VIP signals have always been considered a luxury item and there are many car enthusiasts who would like to have such a device in their car. This is a device that generates powerful low-frequency sound signals.


The signal consists of three main parts.
1) Control panel - in new models, very often the entire generator circuit is located in the control panel. Models such as the right have only one MK, which is programmed and has several operating modes.


2) Power amplifier - Amplifies the signal and supplies it to the emitter
3) Emitter - a loudspeaker that is designed to reproduce a signal.
The generator produces sawtooth pulses and feeds them to the pre-amplifier, then the signal from the pre-amplifier goes to the main power amplifier, in our case this amplifier is made using a cheap TDA2003 monophonic microcircuit.


The circuit has a matching transformer; the signal from the UMZCH goes to the primary winding of this transformer. The secondary windings of the transformer are connected to the bases of powerful key transistors. The signal forces the transistors to open, the latter supply voltage to the primary winding of a more powerful (power) transformer.


At the output of this transformer we already receive an amplified rectangular signal, which is fed to the loudspeaker.


The generator (imitation of a quack) is built on a two-channel pulse generator and counter-dividers. To simulate the sound of a siren, the circuit has a separate microcircuit.

The design diagram is available in the full archive, the download link for which you can find at the end of the article (download is free).

Once the author of these lines had to repair a Chinese-made scooter, which the “next generation” had brought to a rather depressing state. In addition to many purely mechanical problems, the scooter also had “electrical” problems - the young riders must have not been very interested in the technical condition of their “iron horse”, and therefore rode with the voltage regulator “dead to zero” - in As a result, almost all the lamps on the machine burned out, and the sound signal did not work.

How to make a quack for a car

And if, after rummaging around in the garage for a couple of hours, we managed to get a regulator with light bulbs, but with the search for a “pipe” the situation was a little more complicated - in a motorcycle store it cost no more, no less, 400 rubles; and plus everything, at that time it was not on sale. The idea of ​​installing a car horn on the scooter, after some thought, was also rejected - it has too much power - most likely, the weak button in the steering switch will not hold up and will start to burn, and for some reason I didn’t want to install an additional relay.

And the price of a car horn is considerable - even more than that of a motorcycle one. This is where the idea was born to equip the scooter with some kind of home-made signal, which would have a low manufacturing cost. Well, if you do start a self-propelled gun, then let the result be interesting and unusual - it works, so to speak, for the image of a “moped.”

Since life was not easy for this scooter, in the countryside - where traffic cops had not been seen since the time of Ivan Susanin, and absolutely quiet and sober shepherds (with their horned charges as trainees) were self-proclaimed road inspectors; the idea arose to equip the machine with a signal reminiscent of the famous “quack” - like the one installed on police cars and other emergency services - after all, in the village such a “little prank” most likely will not create any problems (unlike the city, where The traffic police, of course, will not allow such liberties - and, by the way, they will do the right thing!).

A run through amateur radio sites showed that “quacks” are, in principle, created by home-made people; true, in lately More and more of these devices are built on... microcontrollers! To me, this approach seemed wasteful and not entirely justified - in fact, using MK for such things is like shooting sparrows from a cannon (although I myself actually know how to work with MK, and really love it). Therefore, it was decided to come up with the simplest and cheapest possible “quack” - such that anyone who is able to hold in their hands not only the steering wheel of their “country horse”, but also a soldering iron, could easily repeat it. having a couple of hours of free time and a handful of cheap radio parts.

But first, we had to figure out what exactly that “quacking” is, so disliked by the majority of traffic violators? And since it was not possible to approach a police car with an oscilloscope and beep the beep (at least without serious health consequences ©), I had to take a different route to install it on my PC special program(Signal Generator from the WaveTools package - a generator of sound vibrations, with the ability to set their frequency and shape; the author of the program is Paul Kellett) in order to experiment a little and select the desired sound by ear.

And now, after several hours of violence to my own ears, the secret finally became clear: the desired “quack” is just asymmetrical rectangular oscillations with a frequency of 80-90 Hz, having a duty cycle in the range from 3 to 12% - that is, in fact, an ordinary PWM signal. To the author of these lines, two options seemed closest to “branded” ones (especially the first): 80 Hz at 4%, and 85 Hz at 9%.

By the way, if the frequency of this signal is raised to 250-400 Hz. and make the fill factor equal to 15-30%, the sound will become very similar to the sound of a standard car horn. This means that in order to “quack”, even the simplest PWM generator will be enough - as long as it more or less accurately provides an output sound signal with the specified characteristics.

The diagram of the resulting device is shown in the figure - it is a classic asymmetrical multivibrator loaded onto a transistor switch, which is the simplest amplifier here. The ratings of the elements in this circuit are indicated for the 80 Hz/4% mode. The frequency, as well as the duty cycle of the pulses at the output of such a generator, depend on the resistances R1 (sets the pulse duration), R2 (sets the pause duration) and capacitance C1. The pulse duration is calculated using the formula:

Timp. (sec)=0.8*C1 (uF)*R1 (kOhm)/1000; The duration of the pause is calculated in a similar way, only instead of the value of R1 it is necessary to substitute the value of R2. Accordingly, in order to calculate the resistance of resistor R1 (or R2) for a previously known value of the pulse time (or pause), you need to use the formula inverse to the previous one:

R(kOhm)=Tymp. (sec)/0.8*C1(uF)*1000. The pulse/pause duration (in seconds) can be calculated by setting the required frequency F (in Hz) and duty cycle D (in percent), using the formulas:

Timp.=(1/(F*100))*D,

Тpause.=(1/(F*100))*(100-D).

If, according to the results of calculations, the resistances of the resistors turn out to be very large (several megohms), and there are no such ones available (the author of these lines, for example, this is exactly what happened at first), then you can simply increase the capacitance C1 by 5-10 times. and the resistance of the resistors, accordingly, is reduced by the same amount. It is also advisable to provide the possibility of some frequency adjustment in the finished device. in order to achieve the most [unpleasant sound.

To do this, the capacity of the real C1 needs to be selected slightly less than the calculated one, and in parallel to it, turn on the “tuner”, which, within small limits, will make the “adjustment”. The output transistor VT1, in principle, can be used as a bipolar one, but it is still better to take an MIS - not necessarily the one indicated in the diagram (IRF610 was chosen only because it “came to hand”) - almost any transistor will do. channel; the main thing is that it has an Imax of at least 1 A and a Umax of at least 30 V (applicable, for example, IRF610-640, IRF740, IRF3205 - as well as many others).

The whole point here is that the junction resistance of a bipolar transistor, even if completely open in saturation mode, nevertheless has a fairly large value - sometimes it can exceed 10 Ohms; but the active resistance of the load - a regular speaker - is only 2-8 ohms. Thus, the transistor and its load form a kind of voltage divider, the resistance of the lower arm of which (the transistor) can sometimes be two (or even more) times higher than the resistance of the upper arm (the speaker).

As a result, the voltage drop across the transistor begins to exceed the voltage drop across the load, which in turn inevitably leads to a decrease in the sound volume - after all, in fact, an additional resistance of the transistor junction is switched on in series with the speaker - those same 5-10 Ohms. The switch on the MIS transistor is a different matter: in the open state, the resistance of its channel is less than an Ohm (for some models - even hundredths of an Ohm!) - that is, it is at the level of a regular conductor; and this means that almost all the voltage applied to the load will drop across it - instead of wastingly heating up the control transistor crystal.

If there is no opportunity (or desire) to use an MOS transistor, then a pair of bipolar ones will do - they need to be connected using a Darlington circuit. An ideal sound emitter for of this device it could be a factory-made “bell” - like those installed at a train station to notify passengers - of course, if it were on sale more often and at an attractive price. However, you can do without any expense at all by using a regular dynamic head as a sound emitter - it is desirable that it be larger and more powerful (although the author of these lines got good results with a simple two-watt “oval” from a “dead” Soviet radio).

Moreover, this is almost the only case in radio electronics when the principle “the worse the better” is completely justified: the speaker can be “hoarse”, have a torn diffuser - it has been verified that the “quack” will not lose any of this, and even vice versa - the sound will become more “juicy” and “angry”. Sirens from car alarms also have good sound (and high mechanical strength, unlike flimsy speakers!).

You can purchase such a product for pennies at the nearest auto repair shop; Next, you will need to open the siren’s body, unsolder the standard “howl synthesizer” scarf from its sound emitter, and then connect the described device instead of the latter. Plus, the housings of most car sirens are not only durable and sealed, but also very spacious, thanks to which the entire “quack” circuit can be easily placed directly in such a housing. The only limitation here is the fact that not all sirens reproduce low frequencies well.

A printed circuit board for the device was not developed - in the author’s version, the basis for all parts, except for the microcircuit, was a piece of foil fiberglass laminate measuring ~10x45 mm, with contact pads etched on it (if you don’t want to etch, you can simply cut them out with a scalpel or a drill) ; then I soldered the microcircuit to this improvised scarf using ordinary mounting conductors, on which it is supported (it is also possible to assemble the device on a ready-made breadboard - a “sieve”). After testing the design, a casing approximately 45 mm long was made for it, cut from a 40x40 mm plastic cable channel.

I made the channel cover 20 mm longer than its U-shaped part in order to drill a hole for the fastening bolt in the resulting allowance. The result was a pretty decent box with an “eye” - like a “nine” relay, only a little larger. To seal the case, a very reckless attempt was made to fill it with bitumen heated on a blowtorch, which is why the circuit safely went to its “electronic paradise” (don’t repeat my mistakes!).

The second specimen was luckier - it was decided to fill its body with transparent construction silicone (which is sold in large syringes - “pistols”), and the “patient” bravely endured this “execution”. True, silicone has one significant drawback - in a relatively large volume of the case it hardens extremely slowly, even if you “dry” it on a radiator; therefore, such a sealant will achieve complete polymerization only after a few weeks.

Ultimately, the cost of all this “tuning” turned out to be even lower than the 10 rubles indicated in the title of the article. - in fact, I only had to buy K176LA7 (~3 rubles, replaceable with K561LA7, K176(561)LE5; and with a slight change in the circuit - also with K176(561)LN2); All other parts, including the output transistor and speaker, thanks to many years of “collecting and investigating”, I got absolutely free.

The above device will be useful not only as an original “horn” for a scooter or bicycle - it can also be successfully used as a bellower in a security (or fire) alarm - the sound of a police car, which unexpectedly took lovers of other people’s property by surprise, will most likely be “to their taste” " And in agriculture, such a “quack” will help scare away uninvited guests - rodents, moles, birds, etc., from the long-awaited harvest - the author of these lines, for example, personally observed how the sound of this device scared away an entire brood of magpies.

In such cases, the logical elements D1.3-D1.4, which remained unused in the microcircuit, will come in handy: on them, for example, you can assemble a symmetrical multivibrator at 2-3 Hz (according to the classical scheme), and with its pulses you can trigger the sound described here generator - then the sound of the “quack” will become intermittent, which is good for use in alarms. Or use another, similar PWM generator to start the “crackling” generator, calculating its parameters in such a way that the sound is turned on, for example, for five seconds every half a minute - you will get an almost complete analogue of the widely advertised (and not at all cheap!) industrial device “ Antikrot."

In addition, the diagram will also be useful for dubbing some toys, productions, games, etc.

Attention! The sound reproduced by the device described here is equated to special signals, and they are allowed to be installed only on vehicles of specialized government services! Unauthorized equipping of personal or commercial vehicles with such signals is an offense, as a result of which various sanctions can be applied to the violator: from a large fine (>5000 rubles), to deprivation of “rights” or even arrest (the latter in cases where a special signal was used to commit other offences). Such tough measures are quite fair - there is no place on the road for reckless drivers, boors and selfish people who consider themselves special and mindlessly put their own lives and those around them at risk. Let's be polite - both on the road and in life!

I offer you to repeat the circuit of a sound device that simulates the signal of a “Police Siren”. The device is made on a PIC16F628 microcontroller. The circuit has two different sirens and a “Quack”.

When you press the "Quack" button, a one-time imitation of the "Police Quack" is activated. When you press the "Start" button, "Siren No. 1" turns on, when you press it again, "Siren No. 2" turns on. There is also an effect that simulates the end of the sound of the first siren; to turn on this effect, press the "End" button. To stop playing the sound effect, press the "Stop" button. This circuit is easy to assemble and does not require configuration.

“PA” – Power amplifier, it is not shown in the diagram. This circuit is assembled on a printed circuit board; there is also a simple stabilizer on the printed circuit board to power the microcontroller.

The buttons for this device were taken from the panel of an old car radio, but simple tact buttons can also be used. The housing for the device is made of plastic, size (55X35X15).

Download printed circuit boards, project in , firmware you can see below

List of radioelements

Designation Type Denomination Quantity NoteShopMy notepad
MK PIC 8-bit

PIC16F628A

1 To notepad
Capacitor33 pF2 To notepad
Quartz resonator4 MHz1 To notepad
ButtonWithout fixation4 To notepad
Add all

Greetings, dear car enthusiasts and radio enthusiasts! It was sometime in February. A friend of mine, whom I have known for most of my life, asked me to build a Quack. The main conditions were: low price, power supply from 12 Volts, the presence of at least one siren and, in fact, the “crack” function itself.

After a little searching for the circuit diagrams of these “quacks”, it turned out that it would be possible to assemble a useful device only on a microcontroller. I settled on a circuit with a PIC16F628A microcontroller. Until this moment, I was not familiar with microcontrollers, and so I had to read a little about them.

After reading a little about them, I realized that I would have to assemble a programmer and I chose the simplest JDM programmer, which consisted of only a few parts, namely a board, four resistors, a 5-volt stabilizer, a COM port connector, a 6F22 battery, and the actual microcontroller.

The programmer is extremely simple and therefore it took me literally 10 minutes to make it (not counting making the board).

Programmer circuit:

Ready programmer:

I hid all the “stuffing” of the programmer under electrical tape. This programmer can program PIC microcontrollers in DIP8, DIP14, DIP18 packages.

I programmed the microcontroller using the WinPic800 program. If suddenly someone’s programmer does not work the first time (like me), then check whether your COM port is enabled in the BIOS settings.

Quack diagram:

Photo of the finished device:

The diagram contains almost no details. In addition to the MK, 2 33pF capacitors and 4 MHz quartz are important in it, and the rest is essentially not so important. Sound effects are activated by shorting the corresponding contacts to ground.

The “naked” scheme produces too much weak signal, and so it was decided to make an amplifier. We considered options such as TDA2003, TDA2005, TDA7294, TDA7265 and even a transistor amplifier, in the end it was decided to build an amplifier using TDA7265.

The amplifier is switched on as a “bridge” and, according to the chip developers, produces as much as 50 watts of power. The amplifier circuit was taken from the datasheet, changed quite a bit, and replaced the 1 µF electrolytes with film. And here is the diagram itself:

The amplifier turned out to be quite good, especially since I wasn’t chasing Hi-Fi, since it’s not needed here. According to measurements, the peak output power was about 40 watts.

I had a board lying around from some speakers for a PC and it just fit this chip, so I broke out the required piece and put the chip and all its few accessories there. The microcircuit does not require a small radiator.

Photo of the finished amplifier:

After assembling the amplifier, I thought about how to power the whole thing from 12 volts? The quack is okay, it requires only 5 volts, but the amplifier needs bipolar power supply +/- 20 volts. It was decided to make a converter using the well-known TL494 chip. It was done according to this scheme:

But I changed the circuit a little, namely, I lowered the power supply capacitors from 4 to one 2200uF 25V and instead of 4 field effect transistors, put 2.

It is advisable to use a 2-watt R13, as it gets a little hot. The converter is turned on by supplying “+” power to the “REM” contact.

The transformer is W-shaped without a gap, the primary winding is 5+5 turns, the secondary winding is 7+7 turns and 4 turns for powering the MK. Instead of IRF3205, IRFZ44 and the like are quite suitable.

Photo of the finished converter:

The converter turned out to be quite good and its power is quite enough to power the amplifier. Everything was placed in a metal case and covered with cardboard. The control panel was placed in a plastic case.

Photos of the finished “Quack”:



The VIP signal is a special-purpose signaling device that is used by intelligence agencies and is inaccessible to civilians, but this is only at first glance. Recently they brought that very same COPT quack for repairs.

The signal is quite old, although it was used until recently - of course, by civilians. Modern special signals are made on specialized microcontrollers, this can dramatically reduce the size of the generator board and the circuit itself as a whole, but this signal was used back in the dashing nineties, so to obtain the quack effect, a huge number of components are used here - counters, square-wave generators, low-frequency amplifier , matching transformer, amplifier stage on powerful bipolar switches and power transformer.

The circuit has three main operating modes - loudspeaker, quack signal and howl of police sirens. The effect is obtained using a square pulse generator and a counter, then the signal is pre-amplified and fed to the input of a low-frequency amplifier.




The amplifier itself is made on the widely used single-channel TDA2003 microcircuit, which allows you to amplify the input signal rating hundreds of times (the microcircuit provides 10-12 watts of power). Then the signal goes to the primary winding of the matching transformer. That transformer has two secondary windings, each feeding a base of powerful power switches.




Power switches are triggered according to the amplitude of the base signal, forming multiple voltage amplification. Amplification is provided by a power transformer. In the circuit, the frequency is regulated within 200 Hertz, therefore all transformers used have an iron core.