Do-it-yourself police quack on PIC. Police quack (siren) on a PIC microcontroller Schematic diagram of a siren with a power amplifier

I wanted a quack, but a pity to buy? There is an exit!
But it happens when there are many different bells from car alarms, more often - with burned out electronic filling (Chinese output transistors drowned in water due to improper installation, persuaded by endless screeching cycles), but there is nowhere to apply them, and the standard sound of changing melodies from those who survived is not news. I offer my own version of how to diversify the sound. Everyone will find an application, especially car enthusiasts

The basis was a squeak from the factory alarm Cobra 5320.

In appearance, you can say that it will growl.
However, the question remained with the amplifier. A little time - and the amplifier circuit was on paper.
But this is not enough. You also need a part of the signal shaper itself. The options offered on various counters, dividers do not impress me, although it may seem that it is easier with them. However, the stability of the parameters of passive components in frequency-setting circuits leaves much to be desired. In this version, I used 4MHz quartz from the factory board.

The following form of the required signal was proposed.

After that I started writing a program in PIC12F629. A little diligence, and the firmware was written. I choose clocking with quartz in principle always in those circuits where time parameters significantly affect the final result, especially when the device is used in different climatic conditions. In this case, I used the most popular quartz at 4 MHz.
If it is difficult for someone to find such a quartz - write, I will redo it for yours. As a result of all of the above, the firmware for PIC12F629 initially appeared, after which the rest of the switching circuit.

Jumper JP1 - for future functions that can be implemented in the source code of the program, say, for another type of siren.
This was followed by the PCB design phase.

See intermediate stages of assembly:,

As a result, such a device has been assembled.

The circuit is powered by a voltage of 8-16V. In my case, 14V, the current consumption was 1.8A.
The transistors are all left from the factory signaling, their types are indicated in the diagram. It is possible to use it as a preliminary one - at least KT315, it is also possible to use KT805, KT837 in the same plastic cases as power transistors in the key mode. The use of powerful transistors is justified by the power of the emitted sound.
A short video shows how the flame from a lighter goes out under the influence of sound pressure from a crack.

Watch lighter fading in 3GP:

The form of the output signal on transistors loaded by the emitter should have the form.

Shapes were filmed at 5V / div.

In the factory circuit, the resistors were all SMD size 0805, except for 68 ohm, they are 0.25W each.

The whole thought initially began to be expressed. We also leave comments there.

Additions:

Signet for standard chants from egiptjanin

Using a crack in 0.5 seconds of crack / 0.5 seconds of pause.

PIC12F629 + 4.00MHz, no need for 4-leg braces ...
Project and firmware

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

How to make a quack for a car

And if a regulator with light bulbs, after digging for a couple of hours in the garage, managed to get hold of it, then with the search for a "pipe" the situation was a little more complicated - in a motorcycle store it cost, neither more nor less, 400 rubles; and plus everything, at that time it was not on sale. The idea to put 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 stand up and will start to burn, and then for some reason did not want to fence the additional relay.

And the price of a car horn is considerable - even more than that of a motorcycle one. It was here that the idea was born to equip the scooter with some kind of self-practical signal, which at the same time has a small manufacturing cost. Well, and if you 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 the traffic cops had not been seen since the time of Ivan Susanin, and absolutely quiet and sober shepherds (with their horned wards as trainees) were self-proclaimed as road inspectors; the idea arose to equip the car 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 (in contrast to the city, where Of course, the DPS will not allow such liberties - and rightly so, by the way, it will!).

A run through the amateur radio sites showed that "quacks" are, in principle, created by homemade people; however, lately more and more of these devices are based on ... microcontrollers! To me, this approach seemed wasteful and not entirely justified - in fact, using MK for such things is the same as firing a cannon at sparrows (although I myself know how to work with MK, and I love it very much). Therefore, it was decided to come up with the simplest and cheapest "quack" - such that everyone who is able to hold in his hands not only the steering wheel of his "country horse", but also a soldering iron, could easily repeat it. with a couple of hours of free time and a handful of cheap radio parts.

But to begin with, it was necessary to figure out what the same “quack”, so unloved by the majority of traffic offenders, was all the same? And since it was not possible to approach a police car with an oscilloscope and beat the beep (at least, without serious health consequences ©), I had to go the other way to install a special program on my PC (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 find the right sound by ear.

And now, after several hours of violence against one's own ears, the secret finally became clear: the sought-for "quacking" is just asymmetric rectangular oscillations with a frequency of 80-90 Hz, with a fill factor in the range from 3 to 12% - that is, in fact, an ordinary PWM signal. To the author of these lines, the closest to the "brand" seemed two options (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%, then the sound will become very similar to the sound of a standard auto "beep". This means that even the simplest PWM generator will be enough to "quack", as long as it more or less accurately provides a sound signal with specified characteristics at the output.

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. Element ratings in this diagram are for 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 the capacitance C1. The pulse duration is calculated using the formula:

Timp. (sec) \u003d 0.8 * C1 (μF) * R1 (kΩ) / 1000; the pause duration is calculated in the same way, but instead of the R1 value, you must substitute the R2 value. Accordingly, in order to calculate the resistance of the resistor R1 (or R2) for the previously known value of the pulse time (or pause), you need to use the formula opposite to the previous one:

R (kOhm) \u003d Tim. (sec) / 0.8 * C1 (μF) * 1000. The pulse / pause duration (in seconds) can be calculated by specifying the required frequency F (in Hz) and duty cycle D (in percent), using the formulas:

Tim. \u003d (1 / (F * 100)) * D,

Tpause. \u003d (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 will not be any (the author of these lines, for example, at first did just that), then you can simply increase the capacitance C1 by 5-10 times. and the resistances of the resistors, respectively, should be reduced by the same factor. It is also desirable to provide for the possibility of some frequency adjustment in the finished device. to get the most [unpleasant sound.

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

The point here is that the junction resistance of a bipolar transistor, even if fully open in saturation mode, nevertheless has a fairly large value - sometimes it can exceed 10 ohms; but the active resistance of the load - an ordinary dynamo - 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 (transistor) can sometimes turn out to be two (or even more) times higher than the resistance of the upper arm (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 connected in series with the speaker - those same 5-10 ohms. Another thing is the key on the MDP transistor: in the open state, the resistance of its channel is less than Ohm (in some models - even hundredths of Ohm!) - that is, it is at the level of an ordinary conductor; and this means that almost all the voltage applied to the load will drop on it - instead of wastingly heating the crystal of the control transistor.

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

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

You can buy such a product for a penny - at the nearest auto disassembly; then you will need to open the siren's case, unsolder the handkerchief of the standard “howling synthesizer” from its sound emitter, and then connect the described device instead of the latter. On top of that, the bodies of most auto sirens are not only durable and sealed, but also very spacious, so that the whole “quack” scheme can be easily placed directly in such a body. The only limitation here is the fact that not all sirens reproduce low frequencies well.

The printed circuit board for the device was not developed - in the author's version, the basis for all the parts, except for the microcircuit, was a cut of foil-clad fiberglass with a size of ~ 10 × 45 mm, with contact pads etched on it (if there is no desire to etch, then you can simply cut them out with a scalpel or a drill) ; then I soldered the microcircuit to this improvised shawl - with the usual mounting conductors on which it is held (it is also possible to assemble the device on a finished breadboard - "sieve"). After testing the structure, a body about 45 mm long was made for it, cut from a plastic cable channel 40 × 40 mm.

The channel cover was made longer than its U-shaped part by 20 mm in order to drill a hole in the resulting allowance for the fastening bolt. The result is a pretty decent box with an "ear" - like a "nine" relay, only slightly larger. To seal the case, a very reckless attempt was made to fill it with bitumen heated on a blowtorch, which made the circuitry safely go to its "electronic heaven" (do not repeat my mistakes!).

The second copy was more fortunate - 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 body volume, it solidifies extremely slowly, even if it is “dried” on a battery; therefore, such a sealant will reach full polymerization only after a few weeks.

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

The given device is useful not only as an original "horn" for a scooter or a bicycle - it can be successfully used as a howler in a security (or fire) alarm - the sound of a police car, unexpectedly caught off guard by lovers of someone else's good, most likely they will "like ”. 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 off a whole brood of forty.

In such cases, the logical elements D1.3-D1.4, which remained unused in the microcircuit, will come in handy: for example, they can assemble a symmetrical multivibrator at 2-3 Hz (according to the classical scheme), and already use its pulses to start 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 “quacking” generator, calculating its parameters in such a way that the sound turns on, for example, for five seconds every half a minute - you get an almost complete analogue of the widely advertised (and quite expensive!) Industrial device “ Anticrot ".

In addition, the scheme will also be useful for dubbing some toys, performances, 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 state 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 offender: from a large fine (\u003e 5000 rubles), to deprivation of “rights” or even arrest (the latter - in cases where a special signal was used for committing other offenses). Such harsh measures are quite fair - there is no place on the road for reckless drivers, boors and selfish people who consider themselves special and put their own lives and those around them at reckless risk. Let's be polite - both on the road and in life!

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 motorists who would like to have such a device in their car. It is a device that generates powerful low frequency tones.

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


2) Power amplifier - Amplifies the signal and feeds the emitter
3) Emitter - a loudspeaker designed to reproduce a signal.
The generator generates sawtooth pulses and feeds it to the preamplifier, then the signal from the preamplifier goes to the main power amplifier, in our case, this amplifier is made on a cheap monophonic TDA2003 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 causes 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 get an amplified square-wave signal, which is fed to the loudspeaker.


The generator (imitation of a quack) is built on a two-channel pulse generator and dividers. There is a separate microcircuit in the circuit to simulate the sound of a siren.

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


I think the installation power is around 100-130 watts. The device also has a hands-free function, in which case the signal from the dynamic microphone enters the input of the pre-amplifier, where the amplification cycle begins.
AKA KASYAN

Greetings, dear motorists and radio amateurs! It was sometime in February. A friend of mine, with whom I have known most of my life, asked me to assemble the Quack. The main conditions were: low price, power supply from 12 volts, the presence of at least one siren and the actual function of the "crack".

After a little searching for the schemes of these "crackers", it turned out that it would be possible to assemble a sensible device only on a microcontroller. I stopped at a diagram with a PIC16F628A microcontroller. Until that moment, I was not familiar with microcontrollers, and therefore 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 of course itself microcontroller.

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

Programmer circuit:

Ready programmer:

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

I programmed the microcontroller with the WinPic800 program. If suddenly the programmer does not work for someone the first time (like mine), then check if your COM port is enabled in the BIOS settings.

Quacking scheme:

Photo of the finished device:

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

The "bare" circuit gives out too weak a signal, and therefore it was decided to make an amplifier. Options such as TDA2003, TDA2005, TDA7294, TDA7265 and even a transistor amplifier were considered, in the end it was decided to assemble an amplifier on the TDA7265.

The amplifier is switched on by a "bridge" and, according to the developers of the microcircuit, produces as much as 50 watts of power. The amplifier circuit was taken from the datasheet, changed quite a bit, I replaced the 1μF electrolytes with a film. And here is the circuit itself:

The amplifier turned out to be not bad enough, especially since I did not chase Hi-Fi, since it is not needed here. According to measurements, the peak power output was about 40 watts.

I had a board from some speakers for a PC lying around and it just fit this microcircuit, so having broken out the right piece, I put the microcircuit and all its small body kit there. The microcircuit does not need a small heatsink.

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 only requires 5 volts, but the amplifier needs a bipolar supply of +/- 20 volts. It was decided to make the converter on the well-known TL494 microcircuit. It was done according to this scheme:

But I slightly changed the circuit, namely the power supply capacitors from 4 lowered to one 2200μF 25V and instead of 4 field-effect transistors, I put 2.

It is advisable to put R13 2-watt, 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 is 7 + 7 turns and 4 turns for the MK power supply. Instead of IRF3205, IRFZ44 and the like are quite suitable.

Photo of the finished converter:

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

Photos of the finished "Kryakalka":


For sounding children's toys, motorcycles and battery-powered cars, I suggest you make a simple circuit of a sound device that simulates the "Police siren" signal. The circuit is simple, contains few details, and does not require configuration. It is not difficult to assemble it, you can order flashed microcontrollers using the link at the end of the article.

The siren device is assembled on a programmable microcontroller PIC16F628.

The firmware has two different sirens and a Quack.

Schematic diagram of a siren with a power amplifier

Siren circuit board with PA

How to use the siren?

When you press the "Quack" button, a one-time imitation of the "Police quack" is switched on. When you press the "Start" button, "Siren No. 1" is turned on, when pressed again, "Siren No. 2" is turned on. There is also an effect that imitates the end of the sound of the first siren, to enable this effect press the "End" button. Press the Stop button to stop the sound effect. This circuit is easy to assemble and requires no configuration.

"UM" - Power amplifier, diagram above. This circuit is assembled on a printed circuit board, also on the printed circuit board there is a simple stabilizer for powering the microcontroller.

The buttons for this unit were taken from the dashboard of an old car radio, but simple tact buttons can also be used.

You will also need a PIC programmer. There are many different programming schemes on the Internet.

For data transfer, usually a USB or COM port is used.

You can buy a ready-made programmer you need not expensive in China.

Modification: "Quack with a flashing light"

If you wish, you can also add an LED flasher on the PIC12F675 to the "quack" circuit!

Photo of the assembled board with a flashing light

Video of siren operation with flasher

If you want to assemble the proposed siren with a flashing light, you can purchase a kit for assembling it with flashed microcircuits at the link: vsmaster.ru

Sergey V. Kamyshin. (For all questions: [email protected])


SHARE WITH YOUR FRIENDS

P O P U L Y R N O E:

    Electrical valves are required to automatically control various hydraulic systems. Finished products are quite expensive. Let's look for a cheaper solution.