Here a simple Arduino code to generate a wailing audio tone. The code can be used to generate tones similar to a police siren, ambulance siren, warning sirens, etc.
This circuit works using the tone function of the Arduino. The tone() function generates a square wave with the given frequency at the specified pin.
In order to generate a wailing sound, two for loop are used in the program to modulate the frequency; one (for loop) for to increment from lower to a higher frequency and another one(for loop) to decrement from higher to a lower frequency. In the given program the output frequency range is between 700-800 HZ.
The sound effect of the siren can be modified by varying the frequency range, the time delay, also by additional modulation of frequency and time contents. With a precise tuning and code adjustments, we can experiment various effects of sound.