Projects

12 Projects of Christmas - Part 2

6 of 12 small electronics projects for kids

Daniel Koch

Issue 77, December 2023

If you missed last month's instalment of 12 Circuits of Christmas, you may benefit from reading it over. We covered a lot of basic information for those less familiar with electronics who may want to tackle these projects over the Christmas holidays. Besides that, there is little to say this time, so we will launch straight into it.

Circuit #7: Emergency Lights

Parts Required:IDJaycarAltronics
1 x Solderless Breadboard-PB8815P1009A
1 Packet Wire Links-PB8850P1014A
3 x Plug-to-Socket Jumper Wires-WC6028P1021
3 x 100Ω ResistorsR6, R7, R8RR0548R7534
3 x 150Ω ResistorsR9, R10, R11RR0552R7538
4 x 1kΩ ResistorsR3, R4, R5, R12RR0572R7558
1 x 3.6kΩ ResistorR1RR0585R7571
1 x 15kΩ ResistorR2RR0600R7586
1 x 250kΩ PotentiometerR13RP3520R2221
1 x 4.7µF Electrolytic CapacitorC1RE6058R5048
1 x 10µF Electrolytic CapactorC2RE6066R5065
1 x 1N4004 General Purpose DiodeD1ZR1004Z0109
1 x BC547 NPN TransistorQ1ZT2152Z1040
1 x BC327 PNP TransistorQ3ZT2110Z1030
1 x BC337 NPN TransistorQ2ZT2115Z1035
2 x NE555 Timer ICsIC1, IC2ZL3555Z2755
3 x Blue LEDsLED1, LED2, LED3ZD0185Z0869
3 x Red LEDsLED4, LED5, LED6ZD0152Z0863A
1 x 4AA Battery Holder-PH9200S5031 + P0455
4 x AA Batteries-SB2425S4955B

Parts Required:

This circuit is less complicated than it looks at first, but that's after we tried with a completely different IC! You can find lots of circuits online for emergency lights, as a project on their own or to put on kids toys. However, we found major flaws with many of them, even by the standards of what is acceptable for these projects. This design overcomes some of the bigger flaws. The lights can be red and blue, or yellow if you want to put them on a construction or towing vehicle. That could be a hand-pushed toy or even an electric ride-on type. The idea is that one IC generates the flashing signal, and the other IC and the two transistors send it to the LED clusters alternately. There is no microcontroller needed but the trade-off is that we have only one flash pattern, and it needs a little 'tuning' to get it perfect.

Step 1:

Place the breadboard with the outer red (+) rail away from you and the outer blue (-) rail closest to you. Insert a 1N4004 diode with its striped cathode (-) end in the upper red (+) rail and its unmarked end in the first row of the board. Add an NE555 timer IC, and the wire links shown. One is from the upper red (+) rail to pin 8, one from the lower blue (-) rail to pin 1, and another from the lower red (+) rail to pin 4. Three more join pin 6 around to pin 2.

Step 2:

Install a 3.6kΩ resistor (ORANGE BLUE BLACK BROWN SPACE BROWN) from the upper red (+) rail to pin 7 of the NED555. Add a 1.5kΩ resistor (BROWN GREEN BLACK BROWN SPACE BROWN) from pin 7, across to the right of the IC and then use a wire link to connect it back to pin 6. Finally, add a 4.7µF electrolytic capacitor with its striped negative lead in the lower blue (-) rail and its unmarked positive lead to pin 2 of the NE555.

Step 3:

Place a 1kΩ resistor (BROWN BLACK BLACK BROWN SPACE BROWN) across the gap in the board, and use a wire link to connect it to pin 3 of the IC. Add a BC337 NPN transistor with its flat side facing you and connect its middle (base) leg to the resistor with another wire link. Finally, add another wire link between the right-hand (emitter) leg and a spot to the right.

Step 4:

Install another 1kΩ resistor (BROWN BLACK BLACK BROWN SPACE BROWN) from the end of the wire link from pin 3 of the IC, and add a BC547 NPN transistor at the other end with its middle (base leg to the resistor and its flat side facing away from you. Use a wire link to connect its left-hand (emitter) leg to the lower blue (-) rail and connect another 1kΩ resistor (BROWN BLACK BLACK BROWN SPACE BROWN) to the BC547's right-hand (collector) leg.

At the other end of this transistor, place a BC327 NPN transistor with its flat face toward you and its middle (base) leg to the end of the 1kΩ resistor. Finally, use a wire link from the right-hand (emitter) leg of the BC327, to the wire link on the other side of the board.

Step 5:

Insert three 150Ω resistors (BROWN GREEN BLACK BLACK SPACE BROWN), all with one end to the left-hand (collector) leg of the BC337 NPN transistor. Make sure each ends in its own, empty row. To the vacant end of each resistor, connect a blue LED with its long positive (anode, +) leg in the upper red (+) rail, and the shorter negative (cathode, -) leg to the end of the resistor. Note that on ours we had to use space on both sides of the transistor to make things fit.

Step 6:

Place three 100Ω resistors (BROWN BLACK BLACK BLACK SPACE BROWN) with one end of each to the left-hand (collector) leg of the BC327 PNP transistor. The other end of each resistor needs to end in an empty row. Note that to use the available empty rows, ours had to pass over rows used by other components, including other resistors, so look at the photo very carefully and check the previous photos for changes. To the other end of each resistor, add a red LED with its long positive (anode, +) leg to the resistor and its shorter negative (cathode, -) leg to the lower blue (-) rail.

Step 7:

Place another NE555 and three wire links. One joins pin 8 to the upper red (+) rail, one joins pin 1 to the lower blue (-) rail, and the last one connects pin 3 back to the junction of the BC327 transistor and the wire link that crossed the board. This last one is white so it may not stand out in the photos.

Step 8:

Insert a 1kΩ (BROWN BLACK BLACK BROWN SPACE BROWN) resistor between the upper red (+) rail and pin 7 of the NE555. Add three wire links to join pin 6 around to pin 2, and another to connect pin 4 to the lower red (+) rail. Finally, add a 10µF electrolytic capacitor with its negative (striped) lead to the lower blue (-) rail and its positive leg (unmarked) to pin 2 of the IC.

Step 9:

Take three plug-to-socket jumper wires and connect the sockets to the pins on a 250kΩ linear potentiometer. Linear potentiometers are usually marked with a 'B', like B250k or something like that. Unfortunately 250kΩ is usually only available in the 24mm size, which has thicker pins than the 16mm ones we usually use on a breadboard. We had to carefully crush and break away the plastic housing of the sockets for ours to fit.

Step 10:

Insert the plugs from the potentiometer so that the wiper (the middle leg) and one of the outer legs of the potentiometer are connected to pin 7 of the IC. Plug the other outer leg into pin 6 of the IC.

Step 11:

Plug the red wire from a 4 x AA battery pack into the unmarked end of the diode in the first row. Insert the black wire into the lower blue (-) rail. Also shown in this shot are the two wire links used to connect the rails. One connects both red (+) rails, and one connects both blue (-) rails. Add batteries to the battery holder and your LEDs should start flashing. Adjust the potentiometer until the number of flashes is the same for red and blue, and the pause between them is even.

HOW IT WORKS

This circuit has two sections, both built around an NE555 in traditional astable mode. IC1 is set up as an Astable producing a wave with a longer high and shorter low. When power is first applied, pin 3 is high, and the internal discharge transistor between pin 7 and ground is off. Current flows from Vcc, through R1 and R2, to charge capacitor C1. The junction of C1 and R2 is also connected to pins 2 and 6. When the voltage across the charging capacitor has reached two thirds Vcc, pin 6 senses it and switches the internal state of the IC. Pin 3 now goes low, and the discharge transistor turns on to connect pin 7 to ground. Now, the current through R1 is shorted to ground and no longer charges C1, which discharges through R2 only via pin 7 to ground. The falling voltage is sensed by pin 2 when it reaches one third Vcc, at which point the discharge transistor turns off, pin 3 goes high, and the cycle repeats.

The on time is set by the value of R1, R2, and C1, while the off time is set by C1and R2 only. With these values, the high time is around 0.06 seconds, and the low time around 0.049 seconds. This is known as the 'duty cycle' and is the amount of on time compared to off time in the total cycle time. In this case, it is 55%.

The output of the first NE555 is connected to three transistors. Q1 is an NPN BC337. NPN transistors function when current flows from the emitter, to the base, and then on to ground. Q2 is a PNP BC327. PNP transistors operate when current can flow from the emitter, out through the base, and to ground. However, we want them both on while IC1 is high, and both off when it is low. Therefore, Q3 is included, another NPN transistor. It is used to connect Q2's base to ground only when IC1's output is high. We could have used two NPN transistors for Q1 and Q2, but there is a reason we made Q2 an NPN. Notice the junction of Q1 and Q2? They are connected to pin 3 of IC2, which decides which is on and which is off.

This is where IC2, a second NE555, comes into play. It is set up in the same astable arrangement, but producing a nearly square wave. When power is first applied, pin 3 is high, and the internal discharge transistor between pin 7 and ground is off. Current flows from Vcc, through R12 and R13, to charge capacitor C2. The junction of C2 and R13 is also connected to pins 2 and 6. When the voltage across the charging capacitor has reached two thirds Vcc, pin 6 senses it and switches the internal state of the IC.

Pin 3 now goes low, and the discharge transistor turns on to connect pin 7 to ground. Now, the current through R12 is shorted to ground and no longer charges C2, which discharges through R13 only through pin 7 to ground. The falling voltage is sensed by pin 2 when it reaches one third Vcc, at which point the discharge transistor turns off, pin 3 goes high, and the cycle repeats.

The on time is set by the value of R12, R13, and C2, while the off time is set by C2 and R13 only. Because R13 is a potentiometer wired up as a variable resistor, the timings, and duty cycle, of IC2 can be changed.

Notice the connection of pin 3 if IC2 earlier? It connects to the junction of Q1 and Q2. When IC2's pin 3 is high, it provides current to the junction, which can only flow through Q2, and then only when it is on, as controlled by the output of IC1. When IC2 is low, Q1's base emitter junction is grounded, so current can flow through it and to ground. There is no current to Q2's emitter because the path through pin 3 is a lower resistance than Q2's base-emitter junction.

The order of Q1 and Q2 is important for this functionality. If they were the other way around, current could flow out Q2's base and into Q1's base, to ground. The voltage drop from base to emitter and the 1kΩ resistors help make sure that, when connected the way they are, the path through IC1 is the lower resistance and current will not flow from Q2's base up to Q1's in that part of the cycle.

You will have to adjust R13 until the high and low periods (which are equal in the arrangement of IC1) is the same as two, three, or four flashes (the choice is up to you), so the switch between red and blue does not happen in the middle of a flash or pause, but rather at the transition.

WHERE TO NEXT

The logical use for this is to build it into a child's toy like a police car or fire truck, or construction equipment. However, that will probably mean some creative engineering because the clear coloured plastic that these toys often have for their 'lights' is rarely able to be reused. Instead, you will have to make new ones. If you have a 3D printer, clear filament or resin will be your friend. If not, cutting up thin acrylic sheets or even clear plastic containers from a dollar shop, and glueing carefully with hot melt glue, would likely get you an not elegant but totally satisfactory result. The same can be said if you are installing these into a ride-on toy.

You will have to mount the LEDs on wires like we did a few times in the previous instalment. In a push along toy, these could just be jumper wires like previously. However, in a bigger toy like a ride-on, you will need to solder wires onto the LEDs and mount them far away from the breadboard.

Circuit #8: Pulsing LED

Parts Required:IDJaycarAltronics
1 x Solderless Breadboard-PB8815P1009A
1 Packet Wire Links-PB8850P1014A
8 x 330Ω ResistorsR1 to R8RR0560R7546
2 x 10kΩ ResistorsR9, R12RR0596R7582
1 x 100kΩ ResistorR11RR0620R7606
1 x 330kΩ ResistorR10RR0632R7618
2 x 22µF CapacitorsR1, C2RE6092R5084
1 x 1N4004 General Purpose DiodeD1ZR1004Z0109
1 x 1N4148/1N914 Small Signal DiodeD2ZR1100Z0101
1 x BC327 PNP TransistorQ1ZT2110Z1030
1 x NE555 Timer ICIC1ZL3555Z2755
8 x Red LEDsLED1 to LED8ZD0152Z0863A
1 x 4AA Battery Holder-PH9200S5031 + P0455
4 x AA Batteries-SB2425S4955B

Parts Required:

This circuit produces a sudden pulse of LED light which then decays away over time, over and over again. It is something of a 'heart beat' effect. The number of LEDs is limited by the size of the transistor but at up to 500mA minimum, you can have at least 16 for 30mA LEDs, 25 for 20mA LEDs, and 50 if you limit them to 10mA! These would look great around a Christmas tree star or the like.

Step 1:

Place the breadboard with the outer red (+) rail away from you and the outer blue (-) rail closest to you. Insert a 1N4004 diode with its striped cathode (-) end in the upper red (+) rail and its unmarked end in the first row of the board. Add an NE555 timer IC, and the wire links shown. One is from the upper red (+) rail to pin 8, one from the lower blue (-) rail to pin 1, and another from the lower red (+) rail to pin 4. Three more join pin 6 around to pin 2. Insert a 22µF electrolytic capacitor with its striped negative leg in the lower blue (-) rail and its unmarked positive leg to pin 2 of the IC.

Step 2:

Install a 100kΩ resistor (BROWN BLACK BLACK ORANGE SPACE BROWN) from the upper red (+) rail to pin 7 of the IC. Insert a 10kΩ resistor (BROWN BLACK BLACK RED SPACE BROWN) from pin 7 off to the right, and use a wire link to connect the other end back to pin 6.

Step 3:

Place a 1N4148 diode with its striped cathode (negative, -) end to pin 3 of the IC and its other end in an empty row to the right. From this end, insert a 330kΩ resistor (ORANGE ORANGE BLACK ORANGE SPACE BROWN) from the lower red (+) rail, and a wire link to the right. At the other side of this wire link, insert a 22µF electrolytic capacitor with its negative (-, striped) lead to the lower blue (-) rail and its unmarked positive lead to the wire link.

Step 4:

Insert a 10kΩ resistor (BROWN BLACK BLACK RED SPACE BROWN) from the junction of the diode, 330kΩ resistor, and wire link, off to the right. Add a BC327 PNP transistor with its flat side facing away from you and middle (base) leg to the other end of the 10kΩ resistor. Install a wire link from the left-hand (emitter) leg of the transistor to the lower red (+) rail.

Step 5:

Install a total of seven wire links as shown. The first one is shorter, and has one end in the same row as the right-hand (collector) leg of the transistor.

Step 6:

Add eight 330Ω resistors (ORANGE ORANGE BLACK BLACK SPACE BROWN), with the end of the first one in the same row as the collector of the transistor, and the short wire link. Make sure the other end of this resistor ends up in an empty row. Then, the next resistors start at the end of each wire link, and finish in a row just before the next wire link.

Step 7:

Place eight red LEDs (or LEDs of your colour choice with the appropriate resistor value). The long positive (anode, +) legs go to the free end of each resistor. The shorter negative (cathode, -) legs go to the lower blue (-) rail.

Step 8:

Insert the red wire of a 4 x AA battery holder into the first row of the breadboard, at the unmarked end of the 1N4004 diode. Connect the black wire to the lower blue (-) rail. Add four AA batteries, and the LEDs should light up quickly then dim slowly, over and over again.

HOW IT WORKS

Finally, we have a simpler circuit to explain. IC1, an NE555. When power is first applied, pin 3 is high, and the internal discharge transistor between pin 7 and ground is off. Current flows from Vcc, through R11 and R12, to charge capacitor C2. The junction of C1 and R2 is also connected to pins 2 and 6. When the voltage across the charging capacitor has reached two thirds Vcc, pin 6 senses it and switches the internal state of the IC. Pin 3 now goes low, and the discharge transistor turns on to connect pin 7 to ground. Now, the current through R1 is shorted to ground and no longer charges C1, which discharges through R2 only via pin 7 to ground. The falling voltage is sensed by pin 2 when it reaches one third Vcc, at which point the discharge transistor turns off, pin 3 goes high, and the cycle repeats.

IC1 is set up to have a high time of 1.68 seconds and a low time of 0.16 seconds. This controls what happens with Q1, C1, and R10. Q1 is a BC327 PNP transistor. For a large current to flow across the emitter-collector path, a smaller current has to flow between the emitter and base, and then to ground. If the output of IC1 is high, no current can flow from Q1, R10, or C1 into it. The diode D2 stops any current flowing from Pin 3 to charge the capacitor, either. When pin 3 goes low, however, C1 discharges almost immediately into it. Current can also flow from Q1's emitter, through the base, through D2 and pin 3 of IC1, to ground, which turns the transistor on.

However, the low time of IC1 is short. When it goes high again, the diode blocks the current from going anywhere. Instead, the emitter current from Q1 flows into the capacitor, charging it.The more it charges, the less the current that flows, so the capacitor charges even more slowly. C1 would actually charge far enough to turn off the transistor, both because of this reduced current issue, and because of the exponential nature of a capacitor's charging curve. After the initial steep rise, it tapers off so slowly that the reverse fading effect on the LED is lost. So, we add current through R10 just to make sure at the end, when the current through Q1's base is not significant, charging is still rapid enough to give the effect we want.

The current through the emitter and out the collector of Q1 is a set number of times the current from emitter to base, so as the base current reduces, so does the collector current and hence the brightness of the LEDs. Then, next time IC1 is low, C1 discharges and the process repeats.

Circuit #9: Simple Daylight Switch

Parts Required:IDJaycarAltronics
1 x Solderless Breadboard-PB8815P1009A
1 Packet Wire Links-PB8850P1014A
1 x 1kΩ ResistorR4RR0572R7558
2 x 100kΩ TrimpotsR1, R3RT4318R2483B
1 x Light Dependent ResistorR2RD3485Z1621
3 x 1N4004 General Purpose DiodesD1, D2, D3ZR1004Z0109
1 x BC327 PNP TransistorQ1ZT2110Z1030
1 x LM311 Comparator ICIC1ZL3311Z2516
3xAA-powered LED String, see Text-Ours was from Kmart-
1 x 4AA Battery Holder-PH9200S5031 + P0455
4 x AA Batteries-SB2425S4955B

Parts Required:

This circuit can turn on or off a string of LEDs when it gets dark enough or, if you want, turn them off when it gets dark. You can use it to turn on a Christmas decoration when the evening sets in, or to turn one off when you turn out the room lights to go to bed. We'll use a new IC for this one, and raid the LED string from a shop-bought set.

Step 1:

Place the breadboard with the outer red (+) rail away from you and the outer blue (-) rail closest to you. Insert a 1N4004 diode with its striped cathode (-) end in the upper red (+) rail and its unmarked end in the first row of the board. Add an LM311 comparator IC, and the wire links shown. One is from the upper red (+) rail to pin 8, one from the lower blue (-) rail to pin 1, and another from the lower blue (-) rail to pin 4.

Step 2:

Insert a 100kΩ trimmer potentiometer )trimpot). You may have to bend the legs outwards to make it fit across the gap in the board. Add three wire links. One connects one of the outer terminals to the upper blue (-) rail, and one connects the outer outer terminal to the upper red (+) rail.

On the other side of the board, the middle terminal (from the 'wiper' inside the potentiometer) is connected to pin 2 of the comparator IC.

Step 3:

Install a light-dependent resistor (LDR) between pin 3 of the IC and pin 1. Pin 1 is the ground and this enables you to bend the LDR over the side of the board easily, rather than using the lower blue (-) rail for the other leg, which would make bending in a usable direction hard. Plug another 100kΩ trimpot in beside the IC. This one does not need its legs bent, they can stay under it. Connect one outer terminal to the lower red (+) rail with a wire link, and use another wire link to connect the wiper (middle terminal) to pin 3 of the IC and the LDR.

Step 4:

Place a BC327 PNP transistor with its flat side away from you, somewhere to the right of the IC, and a 1kΩ resistor (BROWN BLACK BLACK BROWN SPACE BROWN) between pin 7 and the middle (base) leg of the transistor. Add a wire link between the left-hand (emitter) leg of the transistor and the upper red (+) rail.

Step 5:

Prepare your LED string. These are sourced from the cheap AA battery-powered light strings from hardware and discount department stores. Ours is from Kmart. You can cut off as little or as much as you like. Cut from the end away from the battery box so the rest still works. Scrape the ends of the wire to remove the plastic coating on them. It is usually a clear coating and quite strong, so do this carefully. Unfortunately you can't see it in the photos because the wire is silvered and the coating crystal clear.

Step 6:

Plug the red wire from a 4 x AA battery holder into the first row of the board with the unmarked end of the diode. Plug the black wire into the lower blue (-) rail. Add a 150Ω resistor (BROWN GREEN BLACK BLACK SPACE BROWN) between the upper red (+) rail and an empty row. While they are not shown here, you will also need the two wire links at the end of the board, one connecting the two red (+) rails, and the other connecting the two blue (-) rails. Once they are in, plug in the wires from the LED string, one to the free end of the resistor and one to the upper blue (-) rail. If the LEDs light up, the positive (+) wire is to the resistor and the negative

wire is to the blue (-) rail. If they do not light up, the wires are the other way around and need to be swapped. You might like to use a black marker to colour the negative (-) wire.

Step 7:

Remove the 150Ω resistor, and connect a 1N4004 diode with its unmarked anode (positive, +) end to the right-hand (collector) leg of the transistor, and its striped cathode (negative, -) end in a row to the right. Add a second 1N4004 diode with its unmarked anode end to the striped cathode of the previous diode, and its striped cathode end in an empty row. Connect the positive LED string wire to the end of this last diode, and the negative LED string wire to the upper blue (-) rail. Now, your daylight switch should work but you may need to fiddle with the trimpots to get it to work.

HOW IT WORKS

This circuit is based around an IC called a 'comparator' because it compares two values and switches its output depending on the relationship between the inputs. It has an 'inverting' input, marked with a '-', and a non-inverting input, marked with a '+'. Different voltages are fed to these inputs. Regardless of the actual voltages, if the voltage at the non-inverting input is greater than the voltage at the inverting input, the output is off. If the voltage at the non-inverting input is less than the voltage at the inverting input, the output is on.

The output of the LM311 is an internal transistor with what is known as 'open collector' and 'open emitter' outputs. All that means is that both are connected to pins, rather than the collector being connected to Vcc or the emitter to ground inside the IC. We connect the emitter to ground because we are using it as an NPN transistor (in reality it is a set of transistors inside the IC and can behave as a PNP or NPN depending on how you connect it).

The collector is connected by a 1kΩ resistor R4 to the base of a BC327 PNP transistor, Q1. This limits the base current to a level below its maximum allowable limit. PNP transistors work when current can flow from the emitter, out the base, and to ground. Then, a larger current can flow from the emitter, out the collector, and to ground. We connect the emitter to Vcc, and when the IC's output is 'on', the internal transistor connects the resistor to ground, thus giving the base current a way to get to ground and turn on the transistor. The two diodes combine with their 0.6V forward voltage drops each to take the edge off the 6V supply, making it safe for the LED string which comes from the factory with a 4.5V, 3xAA battery pack.

On the input side, we have two voltage dividers. A voltage divider is two or more resistors connected in series (one after the other). The voltage difference between the two ends is shared across the resistors, in the same ratio as their values. They can be connected to any difference in voltage, but we connect them between Vcc and ground. So, the amount of Vcc that appears at the junction of the divider depends on the amount that the two resistors contribute to the total. So, if the first resistor is one quarter of the total, then there is one quarter of the voltage dropped across it and the voltage at the junction will be three quarters of Vcc.

The first voltage divider is made up of a manually-variable resistor, R1, and a light-dependent resistor, R2. A light-dependent resistor (LDR) has a resistance that changes depending on how much light falls on it. There are different types but most on the retail market have a high darkness resistance and a much lower resistance in light. However, the value of resistance in each case varies wildly. That's why R1 is a potentiometer connected as a variable resistor. The junction of this voltage divider is connected to the inverting (-) input of the comparator. Turn the trimpot so that the resistance is roughly the same as the LDR in indoor light, if you have a multimeter. If you don;t, just experiment until the daylight switching is reasonably crisp.

The second voltage divider is also variable, and made by connecting the outer terminals of a potentiometer to the supply rails (Vcc and GND) and the wiper (the middle terminal) to the non-inverting input (+) of the comparator. This way, the wiper rests somewhere along the resistor, creating two resistors. The amount of the resistor above the wiper and the amount below determines the voltage at the wiper. This is used to set the 'on' point for the comparator. Turn this potentiometer when the lighting conditions are right for when you want the LEDs to turn on, and when they do, your device is set up!

As a side note, comparators in theory are a switching device, where they change from high to low crisply and quickly. In reality, and in the LM311's case particularly, there is a small 'transition' zone as the difference between the inputs gets small, crosses zero, and increases again. You may notice the LEds glow softly then increase in brightness as the ambient light falls, rather than switch crisply on. This is the IC itself and not your building skills!

Circuit #10: Music-Activated Strobe

Parts Required:IDJaycarAltronics
1 x Solderless Breadboard-PB8815P1009A
1 Packet Wire Links-PB8850P1014A
3 x 100Ω ResistorsR7, R8, R9RR0548R7534
1 x 1kΩ ResistorR5RR0572R7558
2 x 10kΩ ResistorsR1, R4RR0596R7582
1 x 100kΩ ResistorR3RR0620R7606
1 x 50kΩ TrimpotR3RT4316R2482B
1 x 1MΩ TrimpotR2RT3472R2486B
1 x 100nF CapacitorC1RM7125R3025B
1 x 10µF Electrolytic CapacitorC2RE6066R5065
1 x 1N4004 General Purpose DiodeD1ZR1004Z0109
1 x BC547 NPN TransistorQ1ZT2152Z1040
1 x BC337 NPN TransistorQ2ZT2115Z1035
1 x NE555 Timer ICIC1ZL3555Z2755
3 x High-Brightness White LEDsLED1, LED2, LED3ZD0196Z0877B
1 x Electret Microphone Insert-AM4011C0171
1 x 4AA Battery Holder-PH9200S5031 + P0455
4 x AA Batteries-SB2425S4955B

Parts Required:

This circuit uses a small microphone and amplifier to drive the familiar NE555 in one-shot mode, to flash some bright LEDs on the beat of the music. Use it in a bed-room-sized space in low light for best results. Before you start, you will need to identify the active and ground pins of the microphone module. The ground pin has three (usually) small tracks on the PCB connecting it to the metal case of the microphone. The active pin is isolated. In this image, the active pin is on the left and the ground on the right, but bear in mind that when you turn the microphone upside down to plug it into the board, these will flip.

Step 1:

Place the breadboard with the outer red (+) rail away from you and the outer blue (-) rail closest to you. Insert a 1N4004 diode with its striped cathode (-) end in the upper red (+) rail and its unmarked end in the first row of the board. Plug the microphone into the board with the ground to the left and the active pin to the right.

Add a wire link between the ground pin and the upper blue (-) rail, and a 10kΩ resistor (BROWN BLACK BLACK RED SPACE BROWN) between the upper red () rail and the active pin. Also insert a 100nF capacitor (100n or 104) with one lead in the same row as the resistor.

Step 2:

Install a 100kΩ resistor (BROWN BLACK BLACK ORANGE SPACE BROWN) from the other end of the capacitor, to across the gap in the board. On the lower side, plug in a 1MΩ trimpot (105 on the case) with its middle (wiper) leg to the 100kΩ resistor. Add a wire link from the lower blue (-) rail to one of the outer legs of the trimpot, and a link from the lower red (+) rail to the other outer leg.

Step 3:

Insert a wire link from the capacitor/100kΩ resistor junction to the right. Insert a BC547 NPN transistor with its flat side facing away from you, and its middle (base) leg to the wire link. Add another wire link from the upper blue (-) rail to the left-hand (emitter) leg, and a 10kΩ resistor (BROWN BLACK BLACK RED SPACE BROWN) between the upper red (+) rail and the right-hand (collector) leg of the transistor.

Step 4:

Place an NE555 timer IC into the board and add wire links to connect pin 8 to the upper red (+) rail, pin 1 to the lower blue (-) rail, and pin 4 to the lower red (+) rail. Also link pin 2 to the right-hand (collector) leg of the transistor, using two links.

Step 5:

Install a 1MΩ trimpot to the right of the IC, and connect its wiper (middle leg) to the upper red (+) rail with a wire link. Use another wire link to connect either of its outer legs to pin 7 if the IC. Add a short wire link, difficult to see in the photos, between pins 6 and 7. Insert a 10µF capacitor with its negative (striped) leg into the upper blue (-) rail, and its positive (unmarked) leg to pin 6 of the IC. Finally, add a 1kΩ resistor (BROWN BLACK BLACK BROWN SPACE BROWN) from pin 3 off to the right, and a BC337 NPN transistor with its flat side away from you and its middle (base) leg to the resistor. Add a wire link between the left-hand (emitter) leg and the lower blue (-) rail.

Step 6:

Place three 100Ω resistors (BROWN BLACK BLACK BLACK SPACE BROWN), all with their left-hand end in the same row as the right-hand (collector) leg of the BC337 transistor. The right-hand end of each resistor needs to end in its own row.

Add three high-brightness white LEDs, all with their long anode (positive, +) leg in the lower red (+) rail, and each with its shorter cathode (negative, -) leg to the end of one of the resistors. We used green LEDs for photography because the white ones are clear and do not show up so well.

Step 7:

Add two wire links, one to join both the upper and lower red (+) rails to each other and another to join the two blue (-) rails to each other. Then, plug the black wire from a 4 x AA battery holder into the lower blue (-) rail, and the red wire into the first row at the unmarked end of the diode. Install batteries into the holder, and adjust the left-hand trimpot until the LEDs turn on. Back it off gently until the LEDs turn off. This is the sensitivity control. Then, clap and the LEDs should light up. Adjust the right-hand trimpot for the length of flash.

HOW IT WORKS

The circuit has two main sections: The microphone and its amplifier, and the NE555 timer to give the flash. The microphone itself is known as an 'electret' microphone, but modern versions work on a slightly different principle to a true electret. Basically, there is a flexible plate across a chamber, and it has a permanent electrostatic charge on it. As the plate physically moves, the charge in it causes charge in the other plate to move, and this is processed and amplified by an onboard 'field effect transistor', or FET. The FET is why we need a 10kΩ resistor between the supply rail and the microphone. It is not a 'bias' resistor as it is often called, this term being a legacy of capacitive microphones. However, the end result is that as sound makes the plate in the microphone move, a changing current exists at the output of the FET.

This is connected via a capacitor, C1, so that only the changing current can pass through and not the DC from the supply resistor R1. The capacitor is connected to the base of Q1, a BC547 NPN transistor. The base is also connected to the wiper of R2, a 1MΩ trimmer potentiometer (trimpot). The outer ends of the resistor are connected across the supply rails, and the adjustment of R2 gives a differing voltage at the wiper. This is used to 'load; the base so that it is very close to conducting, and therefore small changes from the capacitor will have immediate and full effect on the transistor.

The transistor is connected to pin 2 of IC1, as well as a 10kΩ resistor, R4, from the supply rail. Normally, when there is no loud enough sound, current from the supply rail flows through R4 and keeps pin 2 of IC1 high. Pin 2 is the trigger pin of the NE555, and it along with pin 6 control the behaviour of the output pin 3. However, we have used the NE666 so far in 'astable' mode where the timer is self-triggering. In this case, it is in 'monostable' mode, or one-shot. When power is first applied, the output on pin 3 is high. There is an internal transistor inside the NE555, connected between the discharge pin 7, and ground. When the output is high, this transistor is low. Therefore, current flows through R6 to charge C2.

Pin 7 and pin 6 are tied together, and pin 6 is the threshold pin. When the voltage on it rises above two thirds of the supply voltage, this pin sets an internal flip flop, connected to the output and to the discharge transistor. As the capacitor charges, the voltage across it rises to this threshold. Then, the output is turned off and the discharge transistor is turned on. The capacitor now discharges because pin 7 is a low-resistance path to ground, meaning the current through R6 is shorted to ground and the capacitor can discharge through there easily too.

At this point, the circuit stays in this state. The NE555 needs the voltage on pin 2, the trigger pin, to fall below one third of the supply voltage in order to change the flip flip again and activate the capacitor charging cycle. In astable mode, we tie pin 6 and pin 2 together so that the rising and falling capacitor voltage is used by both pins. In monostable, we use an external trigger for pin 2. Pin 2 is held high, at the supply voltage, by the 10kΩ resistor R4. Something needs to take that voltage away to trigger the circuit. This happens when the microphone detects a loud enough noise. When it does move enough charge via capacitor C1 to activate the base of Q1, the current through R4 is shorted to ground via Q1's collector-emitter path. Now, the voltage at pin 2 of IC1 is well below one third of the supply voltage, so the internal flip flop changes state.

Now, the output goes high for a time determined by the current flowing through R6 charging C2. The larger the value of C2, the longer it will take to charge. The larger the value of R6, the longer it will take to charge C2. You can change the value of one or the other, or both, to change the timing. However, variable resistors are easier to make than variable capacitors in all but the smallest values, so we use a variable resistor for R6 to allow timing changes.

The output pin 3 of IC1 is connected via a 1kΩ resistor to the base of Q2, a BC337 NPN transistor. The output of the NE555 can source (supply) or sink (carry to ground) 200mA of current. That is enough for a couple of LEDs but not very many. The BC337, on the other hand, can handle 500mA continuously, with a maximum level for short periods even higher than that. Some brands and models of the BC337 even handle 800mA continuously! We need to use the LEDs in parallel because the voltage on the supply is not high enough to use even two high-brightness white LEDs in series. They generally have forward voltage drops of 3V as a minimum, but most are 3.2V or 3.5V. So, we use three in parallel, each with its own current-limiting resistor. When the IC's output is high, Q2 conducts and the LEDs light.

We used a value of 100Ω for the LED resistors in the build, and green LEDs instead of white, too. There is a reason for this, even though for our LED specifications we should have used at least 220Ω on the supply voltage we have. Some LEDs can handle four times their rated continuous current! However, there is a catch: The duration needs to be short, often less than 0.01 seconds. This can be repeated on a 10 duty cycle, which means that for every 0.1 seconds, the LED is on for 0.01 seconds and off for the next 0.09 seconds. The longer the pulse, the less overcurrent the LED can handle.

Circuit #11: Rolling LED Display

Parts Required:IDJaycarAltronics
1 x Solderless Breadboard-PB8815P1009A
1 Packet Wire Links-PB8850P1014A
8 x 330Ω ResistorsR1 to R8RR0560R7546
1 x 5.6kΩ ResistorR18RR0590R7576
4 x 120kΩ ResistorsR10, R11, R14, R15RR0622R7608
4 x 150kΩ ResistorsR9, R12, R13, R16RR0624R7610
1 x 50kΩ TrimpotR17RT4316R2482B
4 x 22µF Electrolytic CapacitorsC1, C2, C3, C4RE6092R5084
1 x 100µF Electrolytic CapacitorC5RE6310R5123
1 x 1N4004 General Purpose DiodeD1ZR1004Z0109
2 x BC327 PNP TransistorsQ2, Q4ZT2110Z1030
2 x BC337 NPN TransistorsQ1, Q3ZT2115Z1035
1 x NE555 Timer ICIC1ZL3555Z2755
8 x Red LEDsLED1 to LED8ZD0152Z0863A
1 x 4AA Battery Holder-PH9200S5031 + P0455
4 x AA Batteries-SB2425S4955B

Parts Required:

This visually engaging circuit does not have a practical purpose, but it forms a display that can light up a decoration or be included in some sort of kids' art or craft. The eight LEDs, in four pairs of two, light up one pair after another, then fade out in the same order in which they were lit.

Step 1:

Place the breadboard with the outer red (+) rail away from you and the outer blue (-) rail closest to you. Insert a 1N4004 diode with its striped cathode (-) end in the upper red (+) rail and its unmarked end in the first row of the board. Add an NE555 timer IC, and the wire links shown. One is from the upper red (+) rail to pin 8, one from the lower blue (-) rail to pin 1, and another from the lower red (+) rail to pin 4. Also add a 5.6kΩ resistor (GREEN BLUE BLACK BROWN SPACE BROWN) between pin 7 and a row off to the right, then use a wire link to connect the resistor back to pin 6 of the IC. Finally, place a short link to pin 7 and a space off to the left of the IC.

Step 2:

Insert a 50kΩ trimmer potentiometer (trimpot) into the board so that its middle (wiper) terminal is in the row with the end of the wire link to pin 7, and then add a new wire link from one of the outer terminals up to the upper red (+) rail. Add three wire links to join pin 6 around to pin 2 of the IC, and a 100µF electrolytic capacitor with its striped negative lead to the lower blue (-) rail and its unmarked positive lead to pin 2 of the IC.

Step 3:

Install a 150kΩ resistor (BROWN GREEN BLACK ORANGE SPACE BROWN) between pin 3 of the IC and a spot to the right. Insert a BC327 PNP transistor with its middle (base) terminal to the end of the 150kΩ resistor, and its flat side away from you. Place a wire link between the left-hand (emitter) leg of the transistor and the lower red (+) rail, and a 120kΩ resistor (BROWN RED BLACK ORANGE SPACE BROWN) between the base and the lower red (+) rail. Add a wire link from the base and resistor junction off to the right, and install a 22µF electrolytic capacitor with its striped negative lead to the lower red (+) rail and its unmarked positive leg to the wire link.

Step 4:

Place a 150kΩ resistor (BROWN GREEN BLACK ORANGE SPACE BROWN) from the right-hand (collector) leg of the BC327 from step 3, off to the right. Place a BC337 NPN transistor with its flat face away from you and its middle (base) leg to the 150kΩ resistor. Insert a wire link from the left-hand (emitter) leg of the transistor to the lower blue (-) rail, and another from the base leg off to the right. Add a 120kΩ resistor (BROWN RED BLACK ORANGE SPACE BROWN) from the base leg to the lower blue (-) rail and a 22µf capacitor with its negative (striped) leg to the lower blue (-) rail and its unmarked positive leg to the wire link.

Step 5:

Place a 150kΩ resistor (BROWN GREEN BLACK ORANGE SPACE BROWN) from the right-hand (collector) leg of the BC337 from step 4, off to the right. Place a BC327 PNP transistor with its flat face away from you and its middle (base) leg to the 150kΩ resistor. Insert a wire link from the left-hand (emitter) leg of the transistor to the lower red (+) rail, and another from the base leg off to the right. Add a 120kΩ resistor (BROWN RED BLACK ORANGE SPACE BROWN) from the base leg to the lower red (+) rail and a 22µf capacitor with its negative (striped) leg to the lower red(+) rail and its unmarked positive leg to the wire link.

Step 6:

Place a 150kΩ resistor (BROWN GREEN BLACK ORANGE SPACE BROWN) from the right-hand (collector) leg of the BC327 from step 5, off to the right. Place a BC337 NPN transistor with its flat face away from you and its middle (base) leg to the 150kΩ resistor. Insert a wire link from the left-hand (emitter) leg of the transistor to the lower blue (-) rail, and another from the base leg off to the right. Add a 120kΩ resistor (BROWN RED BLACK ORANGE SPACE BROWN) from the base leg to the lower blue (-) rail and a 22µf capacitor with its negative (striped) leg to the lower blue rail and its unmarked positive leg to the wire link.

Step 7:

Insert a wire link from the right-hand leg (collector) of the first BC327 PNP transistor, the one closest to the IC, across the gap in the board. Install a red LED with its long positive (anode, +) leg to the wire link and its shorter negative (anode, -) leg in the next row to the left. Add a second LED with its anode to the wire link row but its cathode to the next row over from the previous LED. In other words, both LEDs have their anodes in the same row, but their cathodes in different rows. Place two 330Ω resistors, (ORANGE ORANGE BLACK BLACK SPACE BROWN), one from the upper blue (-) rail to the cathode of each LED.

Step 8:

Install a wire link from the right-hand leg (collector) of the first BC337 NPN transistor, across the gap in the board. Insert a red LED with its short negative (Cathode, -) leg to the wire link and its longer positive (anode, +) leg in the next row to the left. Add a second LED with its cathode to the wire link row but its anode to the next row over from the previous LED. In other words, both LEDs have their cathodes in the same row, but their anodes in different rows. Place two 330Ω resistors, (ORANGE ORANGE BLACK BLACK SPACE BROWN), one from the upper red (+) rail to the anode of each LED.

Step 9:

Place a wire link from the right-hand leg (collector) of the second BC327 PNP transistor, across the gap in the board. Install a red LED with its long positive (anode, +) leg to the wire link and its shorter negative (anode, -) leg in the next row to the left. Add a second LED with its anode to the wire link row but its cathode to the next row over from the previous LED. Place two 330Ω resistors, (ORANGE ORANGE BLACK BLACK SPACE BROWN), one from the upper blue (-) rail to the cathode of each LED.

Step 10:

Insert a wire link from the right-hand leg (collector) of the second BC337 NPN transistor, across the gap in the board. Install a red LED with its short negative (Cathode, -) leg to the wire link and its longer positive (anode, +) leg in the next row to the left. Add a second LED with its cathode to the wire link row but its anode to the next row over from the previous LED. Place two 330Ω resistors, (ORANGE ORANGE BLACK BLACK SPACE BROWN), one from the upper red (+) rail to the anode of each LED.

Step 11:

Connect the red wire from a 4 x AA battery holder to the unmarked anode end of the diode in the first row. Connect the black wire to the lower blue (-) rail. Add two wire links, one to join both red (+) rails together and another to join both blue (-) rails together. Insert batteries into the holder and adjust the trimpot until the flash rate allows the LEDs to fade at a rate that looks right to you. Experiment with the whole turning range of the trimpot before deciding.

HOW IT WORKS

The circuit, while appearing a bit cluttered at first, is actually five blocks. The first is based around IC1, an NE555 connected in Astable mode to produce a rectangular wave. When power is first applied, the output pin 3 is high. Pin 7 is the discharge pin, and it has an internal transistor between itself and ground that is off at first. Current flows from Vcc through R17 and R18 to charge capacitor C5. As the voltage across the capacitor rises, pin 2, the trigger pin, and pin 6, the threshold pin, monitor it. When the voltage reaches two thirds Vcc, the IC's stage changes.

Pin 3 goes low, and the internal discharge transistor between pin 7 and ground turns on. Now, the current through R17 goes straight to ground, and the capacitor discharges to ground via R18 and pin 7. When the voltage has fallen to one third Vcc, pin 2 senses this and switches the IC's state, repeating the process.

The output is fed to a network of stages, all made up of two resistors, a capacitor, and a transistor. Each block is the same except for the fact that two are built with NPN transistors and two with PNP transistors. PNP transistors need a current to be able to flow from the emitter, through the base and out, in order to work. Current will only flow if the voltage at the base is lower than the voltage at the emitter. The base does not have to go to ground, just a lower voltage, but ground is common.

In this case, when IC1's pin 3 output is high, Q4's base is at the same voltage as the emitter. The capacitor also charges, but it charges from R15, too. However, when pin 3 goes low, current can flow from Q4's base, to ground via R16. The capacitor discharges slowly, so the voltage at the base falls slowly, and the current through Q4's base therefore increases slowly.

In any transistor, the current across the emitter and collector is a given number of times greater than the base-emitter current. In a PNP transistor, current flows from emitter to collector when a current flows from emitter to base. As the base current increases, a larger current increases from emitter to collector of Q4.

When pin 4 goes high again, C4 slowly charges, again reducing the current. The collector of Q4 is connected to LEDs 7 and 8, so they increase and decrease in brightness as the current changes. However, the collector of Q4 also feeds R13 and R14, C2, and Q3's base. Q3 is an NPN transistor.

They need current to flow from base to emitter in order to pass a greater emitter-collector current, so the polarity is opposite that of a PNP transistor. Additionally, current flows from collector to emitter in an NPN transistor, which is also opposite a PNP. The emitter must be at a lower voltage than the base, and we usually use ground for this.

The same resistor/capacitor charging happens for the network of R13, R14, and C3 as it did for R15, R16, and C4 above. However, because it happens after Q4 has turned on, there is a delay between them. If you look at the diagram carefully, you will see that all four transistors are cascaded one after another, so there is a delay in each turning on and off.

We use alternating PNP and NPN transistors so that the first PNP can be turned on when IC1's pin 3 is low, but the current that then passes can turn on the base of the next transistor, an NPN, which can in turn ground the base of the next one, a PNP again, which can then feed the base of the last one, an NPN. The numbers in the diagrams, Q1 to Q4 (and every other component) are based on their position within the drawing from left to right, top to bottom, rather than their electrical sequence. This is why Q4 turns on first.

WHERE TO NEXT

There is a challenge to getting this circuit working: While in theory each stage is independent because the transistor switches from the supply rail to power the next stage, in practice there can be difficulty getting each stage to propagate along the change to full brightness. Every LED is different, but so is every transistor. We had the circuit working well on the prototype but when we built it for photography, it did not work so well.

When we took a closer look, we had two different batches of transistors, even though they were nominally BC337s and BC327s, they were different brands with very different internal characteristics. We had to reduce the 150kΩ LEDs down to 82kΩ and the 120kΩ down to 75kΩ to get the circuit to work well! So, if it doesn't work first go, feel free to fiddle with the component values a bit, or even try different types of transistors.

You could add more stages of two resistors, capacitor, and transistors, with LEDs for each stage, to increase the number of LEDs in the display. You would need to change the timing of IC1 to suit, but it would look cool. You could also arrange the pairs of LEDs opposite ways when you take them off board, so that the two rows of LEDs light from opposite sides of whatever decoration you put them in.

Circuit #12: Music Light

Parts Required:IDJaycarAltronics
1 x Solderless Breadboard-PB8815P1009A
1 Packet Wire Links-PB8850P1014A
4 x Plug-to-plug Jumper Wires-WC6024P1022
1 x 240Ω ResistorR1RR0557R7543
1 x 300Ω ResistorR2RR0559R7545
1 x 360Ω ResistorR3RR0561R7547
3 x 10kΩ ResistorsR4, R5, R7RR0596R7582
1 x 1MΩ ResistorR6RR0644R7630
1 x 1µF Electrolytic CapacitorC1RE6032R5018
1 x 1N4004 General Purpose DiodeD1ZR1004Z0109
9 x 1N4148/1N914 Small Signal DiodesD2 to D10ZR1100Z0101
2 x BC547 NPN TransistorsQ1, Q2ZT2152Z1040
1 x 4017 Decade CounterIC1ZC4017Z4017
1 x Common Cathode RGB LEDLED1ZD0270Z0999
1 x Electret Microphone Insert-AM4011C0171
1 x 4AA Battery Holder-PH9200S5031 + P0455
4 x AA Batteries-SB2425S4955B

Parts Required:

This LED project is a variation of one we have already built, with a few changes to make it musically activated. You can add more LEDs because it has a transistor output stage for each colour in the RGB LED, so that you can drive a group of LEDs to increase the brightness. Before you start, you will need to identify the active and ground pins of the microphone module. The ground pin has three (usually) small tracks on the PCB connecting it to the metal case of the microphone. The active pin is isolated. In this image, the active pin is on the left and the ground on the right, but bear in mind that when you turn the microphone upside down to plug it into the board, these will flip.

Step 1:

Place the breadboard with the outer red (+) rail away from you and the outer blue (-) rail closest to you. Insert a 1N4004 diode with its striped cathode (-) end in the upper red (+) rail and its unmarked end in the first row of the board. Plug the microphone into the board with the ground to the left and the active pin to the right. Add a wire link between the ground pin and the upper blue (-) rail, and a 10kΩ resistor (BROWN BLACK BLACK RED SPACE BROWN) between the upper red () rail and the active pin. Also insert a 1µF capacitor with its striped negative lead to the resistor and microphone, and the unmarked positive to the right.

Step 2:

Insert a BC547 NPN transistor so that its flat side faces you and its middle (base) leg is in the same row as the positive leg of the capacitor. Add a 1MΩ resistor (BROWN BLACK BLACK YELLOW SPACE BROWN) between the upper red (+) rail and the base of the transistor, a wire link between

the upper blue (-) rail and the right-hand (emitter) leg of the transistor, and another wire link from the left-hand (collector) leg of the transistor, across the gap in the board.

Step 3:

Install another BC547 NPN transistor, with its middle (base) leg to the wire link across the gap in the board. Add another wire link from the right-hand (emitter) leg to the lower blue (-) rail. Place two 10kΩ resistors (BROWN BLACK BLACK RED SPACE BROWN), one from the lower red (+) rail to the base of the transistor, and one from the lower red(+) rail to the left-hand (collector) leg of the transistor. Finally, place a wire link from the collector, off to the right.

Step 4:

Insert a 4017 decade counter IC into the board. Use wire links to connect pin 8 to the lower blue (-) rail, pin 16 to the upper red (+) rail and pin 13 to the upper blue (-) rail. Two wire links are needed to join pin 14 over to the wire link from step 3. Three more are needed to join pin 5 around the IC to pin 15.

Step 5:

Place nine 1N4148 or 1N914 diodes. They are in groups of three, with the striped cathodes (negative, -) of each group in the same row, but the unmarked anodes (positive, +) each in a different row. Check the photo very carefully before installing.

Step 6:

Install a wire link between pin 10 of the IC and the anode of the second diode in the upper group, the yellow link in the picture. Place a wire link between the anode of the third diode in the upper group and the first diode of the lower left group, the orange link in the image. Insert a wire link between pin 7 of the IC and the first diode of the lower left group (green in the image), and one more between pin 4 of the IC and the second diode of the lower left group (purple in the image). Finally, add one long wire link, white in the image, between pin 1 of the IC and the third diode of the lower left group.

Step 7:

Insert a common cathode RGB LED with its cathode, the longest leg, third from the left. Install a wire link between this leg and the upper blue (-) rail. Install a 240Ω resistor (RED YELLOW BLACK BLACK SPACE BROWN) between the cathodes of the diodes in the upper group, and the blue pin of the LED. This was the left-hand pin of our LED. Insert a 300Ω resistor (ORANGE BLACK BLACK BLACK SPACE BROWN) between the green LED pin (the second from left on ours) and the cathodes of the lower left diode group. You will need a wire link to complete this, the green one in the image. Finally, add a 360Ω resistor (ORANGE BLUE BLACK BLACK SPACE BROWN) between the red LED pin, the right-hand one on ours, and the cathodes of the lower right diode group.

Note that our resistor colours do not match the image. That is because we used a really unusual, higher-than-normal voltage LED that we had in stock. The resistor values we list in the steps are for the LEDs you will be able to commonly buy. The positions of the LEDs are correct, though, for our LED pinout. However, some RGB LEDs are different, in the colour order of the pins. The longest pin is always the common, so place the wire link to the upper blue (-) rail first. Then, take the 360Ω resistor (ORANGE BLUE BLACK BLACK SPACE BROWN) and connect it between the upper red (+) rail and any of the other LED pins, to see which colour is which.

Step 8:

Use a plug-to-plug jumper wire to connect the anode of the third diode down in the lower left group to the anode of the uppermost diode in the lower right group.

Step 9:

Use a plug-to-plug jumper wire to connect the anode of the middle diode in the lower right group to pin 12 of the IC, the red wire in the image.

Step 10:

Use a plug-to-plug jumper wire to connect the anode of the third diode down in the lower right group, to the anode of the first diode in the upper group, the blue wire in the image.

Step 11:

Use a plug-to-plug jumper wire to connect the anode of the uppermost diode in the upper group, and the end of the blue jumper wire, to pin 1 of the IC, the black wire in the image.

Step 12:

Connect the red wire from a 4 x AA battery holder to the unmarked anode end of the diode in the first row. Connect the black wire to the lower blue (-) rail. Add two wire links, one to join both red (+) rails together and another to join both blue (-) rails together. Insert batteries into the holder, and the LED should light. Clap your hands firmly, and the LED should change colour.

HOW IT WORKS

There are three main sections to this circuit: The microphone and amplifier, the decade counter, and the LED and diode distributor network. The 4017 decade counter has ten output stages, three inputs, a carry out, and two power connections. The first output stage is 0 rather than 1, which confuses some newcomers. So, the ten outputs are 0 to 9. The other output is the carry out, which sends a high pulse after every ten cycles is complete, and is used for cascading decade counters together.

The five inputs are a reset pin (which is normally low but will clear the counter if a high is detected here); a clock pin, which is the business end of things; and a clock inhibit, which stops the counter where it is when this pin is taken high. The other two are the obligatory Vcc and ground connections. Every time the level at the clock input goes from low to high, the counter turns off the current output and simultaneously turns on the next one. That is the next numbered output, not the next pin along! It does not matter how long the clock pulse is high or low for, it is the change from low to high that matters. After ten clock pulses, the counter resets automatically and starts from the beginning.

In this circuit, however, rather than a regular square or rectangle wave clock pulse, the decade counter is driven by random highs and lows from a microphone and amplifier circuit. The microphone is a complex electrostatic device called an 'Electret' but older models were just a capacitor, whose value varied due to sound pressure. This means sometimes these microphones are called çondenser microphones' because condenser is an old name for a capacitor. However, the only condenser microphones available now are studio style microphones and never these small inserts.

The microphone has its own internal transistor driver (A Field Effect Transistor, or FET) which needs a current to work. That current comes from R16, a 10kΩ resistor. The junction of the microphone and R16 is connected to one side of capacitor C1. Capacitors store a charge and do not pass DC current. Rather, changing charge on one side causes a changing charge on the other side. So, as the microphone causes current change in the resistor, that is passed across the capacitor but the DC from the resistor is blocked.

The 1MΩ resistor R15 feeds a tiny current into the other side of the capacitor C1 and the base of Q2. Q1 and Q2 are both BC547 NPN transistors. When current flows from the base of an NPN transistor to its emitter, (which means the emitter has to be at a lower voltage than the base), a larger current flows from the collector to the emitter. As the capacitor charges and discharges, the current at the base goes up and down, too. This causes a larger changing current at the collector of Q1.

Q2's collector is connected to 10kΩ resistor R14 and the base of Q4. This stronger current change is amplified again by Q1 to produce a usable signal at Q1's collector. When music causes the microphone to operate, the amplified signal means Q1 is conducting all of the current from R13 to ground, causing the voltage at pin 14 of IC to fall to almost 0V. When that particular beat or loud bit of music is over, the amplifier stops conducting, so the voltage at pin 14 rises. As noted above, when the voltage at pin 14 of IC1 rises from high to low, the counter advances to the next output. However, only outputs 0 to 5 are used. Output 6 (pin 5 of IC1) is connected back to the reset pin, so that the count is only six stages.

Each output is connected to the network of nine diodes, D2 to D10. These 1N4148 small signal diodes allow a form of matrix mixing. Current from the decade counter output can go through them to the LEDs but it cannot flow from the LED side back to the counter. So, by careful connection, we can make one output turn on one, two, or three LEDs. It flows through the diode or diodes, to one of the connections on the other side, which has its own set of connections to the LEDs. in this way, there can be no feedback to the other side of the mixing network.

The 4017 has a 10mA output limit. The LEDs need to be limited to this current to be safe for the IC. That is why we chose the resistor values we did, for the most commonly available RGB LEDs. On the subject of the LEDs, this LED is a common cathode RGB LED, with three separate dies (the actual LED on the silicon wafer inside the package) made close together and with all their connections in one LED package. One power connection goes to all three cathodes, which is the negative (-) side, hence 'common cathode': Because the cathode connection is common to all three. The anodes, or positive (+) side of each die have their own pin so that the red, green, and blue can be individually controlled. The anodes are controlled by having power applied from the outputs of the decade counters through the LED network.

WHERE TO NEXT

This project would benefit from being placed in a small cardboard box with the microphone and LED mounted and glued into holes in the lid. It would also benefit a lot from more LEDs. However, that means using transistors and that is very hard to fit neatly on the breadboard. We suggest using this breadboard to mount the transistor drivers, then another breadboard to mount several LEDs and all their resistors, and the wire links to join all the ends of the relevant resistors together so that one diode and transistor group drives all the LED pins of one colour.

You will need a PNP transistor like a BC327. This will need to be driven by an NPN transistor like a BC547. The high-going output of the 4017 will then switch the high-side-connected BC327 so that current is switched to the anodes of the LEDs. Have a look at part 1 of this series for some details, or browse the previous circuits. By the way, using this system with even one LED will gain much more light, because you can run the LED at its full rated current and not the 10mA the 4017 can handle.

MAKING IT BETTER

Many of these projects will end up built on a solderless breadboard for a few hours or days, then pulled apart for everything to be reused. However, some would benefit from being made permanent. That requires soldering skills but there are great options around for solder versions of the same breadboards. They are hole-for-hole copies of the layout of the solderless version used in these projects, although there are differences between brands and suppliers. Check carefully before you buy but in most cases, you will be able to transfer the design straight from solderless breadboard to solder breadboard, with even the same wire link spacing and arrangement!