Design and Prototype The prototype circuit was first constructed on a solderless breadboard.

- Completed prototype
The resistor values were chosen so that the maximum output currents of the ICs specified in their respective datasheets would not be exceeded. Exceeding these limits is not recommended by the manufacturer as doing so could damage the components. For other portions of the circuit, the resistor and capacitor values were chosen so that the right frequencies were created for realistic effects. These decisions are detailed further on. The following is the final version of the circuit:

- I dedicate this hand-drawn schematic to Forrest Mims; reference this schematic when reading the following discussion.
I decided that the power supply had to be portable and fit within the center portion of the light bar. It had to supply enough current to light multiple bright LEDs and a siren simultaneously, so watch-size batteries were out. For efficiency sake, AAAs were chosen over a 9 volt battery as using a 9-volt would result in most of the energy being dissipated as heat when powering the lower voltage LEDs. 3 AAAs were chosen as their nominal voltage when configured in series were sufficiently above the maximum forward voltage of any of the LEDs which would allow for operation through the entire life of the batteries.
The HC series of ICs can operate from 2.0V to 6.0V, so this series was chosen as it can operate over a wide range of battery health. Being a logic competition, it made sense to use an inverter-based oscillator to drive the counter. Two inverters of a 74HC04 hex inverter were used for this rotation driver oscillator. R1 and C1 determine the frequency of the oscillator and is used to clock the counter transitions from one channel to the next. This translates into the speed of the rotation effect. As with any oscillator that incorporates an RC network, its frequency is inversely proportional to both the resistor value and the capacitor value. I chose a .1uF capacitor as it was within the ballpark of what I needed for the correct rotation speed and because it is a common value. I then experimented with different resistor values until I found the value that produced a rotation speed that seemed realistic to me.

- The frequency of the oscillator is inversely proportional to the product of the resistance and capacitance values.
- 06_R1-C1_Frequency.PNG (6.17 KiB) Viewed 4563 times
Connecting LEDs to outputs of a circuit that don't have any current limiting isn't wise, and I chose the simplest solution--current-limiting resistors. The data sheet for the 74HC4017 lists the maximum current output as 25mA, so my target was just below that value. As I used a 5.0V supply for prototyping and was planning on using three AAA batteries for the final project, I used 5.0V for the supply voltage when making calculations to determining maximum currents. With a higher 2.89V forward voltage of the blue LEDs when compared to the red LEDs 1.93V forward voltage, the blue LED would require less resistance to limit the current to equal that of a red LED. However, the human eye is more sensitive to the wavelength of the blue LEDs, and I found that the apparent brightnesses of the two LEDs were fairly close when I used 220 ohms for both the red and the blue LEDs. Note from the following calculations that the maximum output current is not exceeded with these components.
IDB1 = IR3 = VR3 / R3 = ( 5.0 - VDB1 ) / R3 = ( 5.0 - 2.89 ) / 220 = 10 mA
IDR1 = IR2 = VR2 / R2 = ( 5.0 - VDR1 ) / R2 = ( 5.0 - 1.93 ) / 220 = 14 mA
ID1 = 0.1 uA (negligible for these calculations)
IQ0 = IDB1 + IDR1 + ID1 = 10 mA + 14 mA = 24 mA < 25.0 mA
While the original car had a microphone with a siren capability, the microphone was lost before we acquired this hand-me-down toy from a neighbor. Since I had four additional inverters available in the 74HC04 hex inverter package, it made sense to create a siren using them. In my original design, a pair of inverters were used to construct an astable multivibrator that creates the high-pitched carrier tone of the siren, and another pair of inverters were used to construct the slow oscillator that is used to modulate the frequency of the astable multivibrator, creating the "wee-oo-wee-oo-wee-oo" warble.
The siren circuit's astable multivibrator, built with the two inverters IC1C and IC1D, drives the speaker with the high-pitched carrier tone whose frequency is determined by the R5-C3 and R6-C4 networks. Each of the networks determines one half of the square waveform period. For simplicity sake, I chose .1uF capacitors and decided to use the same value resistor for R5 and R6. Here again, the higher the resistance, the lower the frequency, and vice versa. I settled on a value that created a siren that centered around what seemed to be a realistic frequency.
The frequency of the astable multivibrator was originally modulated with an inverter-based oscillator with an identical structure as the rotation driver oscillator. This oscillator had a frequency that was close to that of the counter's carry output and was subsequently replaced with the carry output. This replacement is detailed further in this report.
Changes of the R4-C2 network component values result in a different effect than changes of the values of the other RC networks in this circuit. This RC network smooths the signal that is used to modulate the frequency of the astable multivibrator while the other RC networks control the actual frequency of their signals. The rate of change of the frequency sweep increases as the product of the resistance and capacitance values is decreased. Decreasing the RC constant also has the secondary effect of widening the frequency difference between the lowest and highest frequencies heard in the siren sweeps.

- Decreasing the R4-C2 constant increases the slope of the frequency curves and the frequency limits, but does not change the period of the sweeps. In the final circuit, the period of the sweeps is determined by the frequency of the counter's carry output.
When first testing the siren, the siren started at an inappropriately high frequency when first powering the device. It would then take a few seconds for the siren frequency to work its way down to a natural pattern that sounded correct. I significantly improved this by lowering the value of C2. This resulted in the capacitor charging more quickly so that the modulator reached equilibrium in less than a second.
The speaker I had on hand came from a busted set of headphones. As the speaker was only 32 ohms, I had to limit the current with a 220 ohm series resistor to prevent over-driving the inverter. This had the effect of significantly reducing the volume that I may have obtained had I had a speaker with an impedance closer to the current-limiting resistance. However, after a couple hours of the children playing cops, I'm glad I had to make this "compromise" in component selection.
ISPK = IR7 = VIC1out / ( R7 + RSPK ) = 5.0 / ( 220 + 32 ) = 20 mA < 25.0 mA
PR7 = IR72 * R7 = 0.0202 * 220 = 88 mW
PSPK = ISPK2 * RSPK = 0.0202 * 32 = 13 mW
13 / ( 88 + 13 ) = only 13% of siren circuit power actually used to annoy parents
Near the end of the prototyping stage, I returned my focus again to simplicity. I first eliminated the series resistors that I had with each of the red and blue LEDs. As only one of the LEDs in each ring would be powered at any one time, it became obvious that I only needed one resistor per LED ring. This netted me a savings of 18 passive components.
Also, I discovered that the Johnson counter had an unused carry output that the referenced datasheet calls the "most significant flip-flop". This output, as configured, has an oscillation frequency similar to that of the siren's frequency modulator oscillator. I decided to use the carry output in place of the previously used frequency modulator oscillator. This freed up two of the inverters.
Modern emergency light arrays usually incorporate some strobe lights. I used the newly freed inverters to create the strobe light effects. The white LEDs used for the strobe light effects have a forward voltage of about 2.91V.
IIC1Eout = IDW1 + IDW2 = IR8 + IR9 = VR8 / R8 + VR9 / R9 = { 5.0 - 2.91 ) / 150 + ( 5.0 - 2.91 ) / 150 = 28 mA > 25 mA
As I wanted a harsh bright flash effect for the strobes, I exceeded the 25mA continuous current rating of the inverters by 3mA, or about 10%. I justify doing this because it isn't a commercial product, there are no safety issues involved, and the duty cycle for these lights is only 20%.
The inverters that power the white LEDs are controlled by outputs from the counter fed through diodes. Like the Cylon circuit discussed above, these diodes allow the counter channels to independently control the same inverter, while not over-driving the counter channels by shorting them together.
Considering this was going to be used with three AAA cells, I checked the operation of the circuit over a wide range of voltages. The circuit worked fine from 5.0V down to 2.8V at which point the brightness of the white LEDs were very low. The circuit seemed to lose the harsh brightness one would expect from a strobe light when the supply voltage dropped below about 3.3V. With these voltages, an average of 1.1V to 1.67V is required per cell to offer a good show. This fits well with my desire to completely deplete the batteries before having to replace them.