Make some noise and learn about oscillators and amplifiers with this sound-maker project.
BUILD TIME: 2 HOURS
DIFFICULTY RATING: BEGINNER
Whether or not you built the cardboard castle in Kids Basics Issue 25, you can still have some fun with this project, and modify it to sound like other sources of noise. It is designed to sound something like the kind of horns that were used to warn the population in the land around a castle that an attack was near, but could be made to sound like a truck or train horn, among other things.
A SHORT HISTORY LESSON
Most castle owners also owned all the land around them, and those living on it were effectively renting the land, at best. The lives of all but the wealthiest in the area were ruled by the lord of the castle (this is where we get the modern term landlord for the owner of a rental property), who was often not a king or queen but rather someone with political and social standing, and wealth. That meant that all of the male population who were old enough and fit enough (and by the standards of the day, that was nearly every male) were also obliged to serve in the defence of the castle.
To call the people to arms, some sort of signal was needed. Text messages were not an option yet, nor was a huge speaker system. The answer was a horn, and not like the one on the family car. The word ‘horn’ for something that makes noise comes from the use of animal horns. Long before castles were around, horns were taken from animals that had been hunted for food. Despite their hard appearance, horns are actually soft inside and can easily be hollowed. With the end cut off, the user would blow through closed lips, like “blowing a raspberry” or playing a trumpet.
The sound made would travel along the horn, and as the diameter of the horn increased, so did the volume of the sound. You can do the same thing with a cone rolled from a sheet of paper. By the middle ages when castles were the primary form of both government and defence, these horns were made of metal, and much larger. Think of the shape of a trumpet or even a tuba. In addition, while many horns still required the user to use their lips to produce an actual sound, some were made with reeds if thin wood, leather, or bone, and as such, gave a defined sound just by the passage of air from the user’s lungs. These were less common but are among the forerunners of modern woodwind instruments.
Lord of the Rings fans will be familiar with the scene in the battle of Hornburg at Helm’s Deep. In the film adaption, Gimli is shown climbing to where the Horn of Helm Hammerhand is placed. It is a huge metal horn that produces a very deep sound indeed. Being fictional, it is unknown whether this horn used reeds or if the sound was from the user’s lips, but Gimli uses it to send forth a very deep and very loud war cry just as Théoden, Aragorn, and Legolas make their last-stand charge through the broken doors of the keep.
If you haven’t seen this film, you might like to look up the clip, because this is the inspiration for our horn circuit. However, you can change it to suit your own interests. It can sound like a trumpet, a smaller horn, or, if you didn’t build the castle (or have already packed it away), a car, truck, or train horn. We’ll show you how to play with the sound to make it your own.
The circuit consists of two sections. The first is an LM358 Dual Operational Amplifier (Op-amp) set up as two square wave oscillators. Each half is independent, and can have a different frequency. This is sent to the second section, an amplifier made from a complementary pair of transistors. To make our horn louder, we cut a hole in the bottom of a disposable cup, and mounted the speaker in that.
Below, we will guide you step-by-step on how to wire up the electronics for the Signal Generator and Amplifier. If you are unsure about any of the connections, you can refer back to the Fritzing diagrams. This diagram shows you the holes the components and wires need to be plugged in to. We should also point out that it doesn’t matter what colour wires you use, but the most common wire kits come in set lengths where the colour indicates the length. So if you have one of these kits, the wire colours we used are a guide to the right sized wire.
If this is your first project, you may also like to read Breadboard Basics in Issue 15, to familiarise yourself with the breadboard before getting started.
|ELECTRONIC PARTS REQUIRED:||Jaycar||Altronics||Core Electronics|
|2 × Small Breadboards||PB8820||P1002||CE05102|
|1 × Pack of Wire Links||PB8850||P1014A||CE05631|
|3 × Plug to Plug Jumper Wires||WC6027||P1016||PRT-12795|
|8 × 100kΩ ¼W Resistors||RR0620||R7606||COM-05092|
|3 × 10kΩ ¼W Resistors||RR0596||R7582||COM-05092|
|1 × 1.8kΩ ¼W Resistor||RR0578||R7564||COM-05092|
|1 × 1kΩ ¼W Resistor||RR0572||R7558||COM-05092|
|1 × 470Ω ¼W Resistor#||RR0564||R7550||COM-05092|
|1 × 150Ω ¼W Resistor||RR0552||R7538||COM-05092|
|1 × 10nF MKT Capacitor*||RM7065||R3013B||FIT0118|
|1 × 39nF or 33nF MKT Capacitor*||RM7100||R3019B||FIT0118|
|1 × 33μF Electrolytic Capacitor**||RE6095||R5094||CE05130|
|1 × 100μF Electrolytic Capacitor**||RE6130||R5123||CE05130|
|1 × 1N419 or 1N4148 Diode||ZR1100||Z0101||CE05129|
|1 × LM358 Dual Op-amp||ZL3358||Z2540||COM-09456|
|1 × BC327 PNP Transistor||ZT2110||Z1030||-|
|1 × BC337 NPN Transistor||ZT2115||Z1035||-|
|1 × BC547 NPN Transistor||ZT2152||Z1040||-|
|1 × LED#||ZD0150||Z0800||COM-09856|
|1 × Small Speaker||AS3000||C0600A||ADA1890|
|1 × 9V Battery Snap||PH9230||P0455||CE05205|
|1 × 9V Battery||SB2423||S4970B||CE05337|
|1 × Pushbutton Switch||SP0710||S1060B||CE05249|
* Quantity shown, may be sold in packs.
** Vaules used in the instructions, you may wish to buy different values to experiment, or consider a prototyping pack
# For testing purposes only
Note: While we used MKT capacitors, other types with the same value will work too.
We will start by wiring up the signal generator (Steps 1 to 16) and then wire up the Amplifier (Steps 17 to 35). Take your time and refer back to the Fritzing diagrams if if you are unsure of a connection.
Pay close attention to how you insert the LM358 IC, electrolytic capacitors, transistors, LED and the diode because these only work in one direction.
BUILD The Signal Generator
Place the breadboard in front of you with the blue (-) rail closest to you and the red (+) furthest away.
Insert the LM358 IC in the centre of the board. Make sure this goes in with the notch cutout facing the same way as our photo.
Insert a wire link between the upper red (+) rail and pin 8 of the IC, and one between the lower blue (-) rail and pin 4.
Insert two 100kΩ resistors (brown-black-yellow or brown-black-black-orange), one from pin 7, and one from pin 6. Count the holes to make sure the other ends go in the right places.
Insert the two wire links shown, noting the different lengths.
Insert the two 100kΩ resistors (brown-black-yellow or brown-black-black-orange), noting that they start in the same column but end in different columns.
Insert two wire links, one to the upper blue (-) rail, the other to the upper red (+) rail.
Insert the 39nF (393 or 0.039µF) capacitor between pin 6 and the upper blue (-) rail.
Insert two 100kΩ resistors (brown-black-yellow or brown-black-black-orange) from pin 3, to the right as shown. Note the different lengths.
Insert two wire links, one from the lower blue (-) rail, and one from the lower red (+) rail.
Insert two 100kΩ resistors (brown-black-yellow or brown-black-black-orange), one from pin 3 and one from pin 2, to the left as shown.
Insert the wire link, from pin 1 of the IC to the left.
Insert the 10nF (103 or 0.01µF) capacitor from pin 2 of the IC to the lower blue (-) rail.
Insert the two 10kΩ resistors (brown-black-orange or brown-black-black-red) and wire link to the left of the IC.
Insert two wire links, one to join the two red (+) rails, one for the blue (-) rails. Note that we cut ours to length as the standard sizes do not fit.
Unfortunately, without an oscilloscope, it is rather hard to test the circuit at this point. You can get an idea by connecting an LED and 470Ω resistor (yellow-purple-brown or yellow-purple-black-black) as shown, and temporarily connecting the 9V battery. The LED should glow but not as brightly as if it were connected (with its resistor) to 9V. Remove the LED and resistor when you have finished the test, and disconnect the battery.
Now we have a circuit that produces two square waves and resistively mixes them together. This is the most practical, but far from perfect, way to mix the signals for our project. Now, it is time to build an amplifier so that you can hear what’s going on.
BUILD The AMPLIFIER
Place the second breadboard in front of you with the blue (-) rail closest to you and the red (+) furthest away.
Insert the BC337 as shown with the flat side toward you.
Insert the BC327 so that the emitter is in the same row of holes as the emitter of the BC337. Note the orientation of the two transistors, the BC337 with the flat side toward you, the BC327 with the flat side away from you.
Insert two wire links, one from the upper red (+) rail to the collector of the BC337, the other from the upper blue (-) rail to the collector of the BC327.
Insert the 150Ω resistor (brown-green-brown or brown-green-black-black) from the base of the BC327 to the left, and the 1N419/1N4148 from the base of the BC337 to the far end of the 150Ω resistor, being careful to make sure the striped end of the diode is furthest away from the transistors.
Insert two wire links and the 1kΩ resistor (brown-black-red or brown-black-black-brown). The right-hand wire link lines up with the emitters of the BC337 and BC327, while the right-hand end of the resistor as shown lines up with the base of the BC337.
Insert the 100μF capacitor, noting its polarity. The negative (marked with a stripe) goes to the left as shown.
Insert two wire links, one beside another that has already been placed.
Insert the BC547 with the flat side facing you, and its collector lining up with the end of the wire link.
Insert the 10kΩ resistor (brown-black-orange or brown-black-black-red) so that it lines up on the right hand side with the base of the BC547. Insert the 1.8kΩ resistor (brown-grey-red or brown-grey-black-brown) so that one end lines up with the base of the BC547, and the other is in the lower blue (-) rail.
Insert the 33μF capacitor so that its positive side lines up with the base of the BC547. Insert a wire link from the emitter of the BC547 to the lower blue (-) rail.
Cut a plug to plug jumper wire in half, and bare the ends. Twist one half through each of the speaker terminals as shown. It is best to tape the bare wires afterwards. If you built the siren from Issue 22, you already have this speaker assembled.
Insert one speaker wire into the upper red (+) rail, and the other to line up with the negative side of the 100μF capacitor.
Cut another plug to plug jumper wire, bare the ends, and twist one wire through each terminal of the pushbutton switch, as shown. Again, use tape afterwards to cover the exposed metal.
Insert two wire links, one to join the two red (+) rails and one for the two blue (-) rails.
CONNECTING YOUR BUILDS
Now lay the amplifier board next to the first circuit you built, the signal generator. You may use the tabs on the boards to join them together, but we have not. Use wire links to join the power rails between the two boards.
Insert one wire from the pushbutton switch into the upper red (+) rail of the amplifier board. Insert the other as shown in an unused row.
Insert the negative (black) wire of the battery snap into the lower blue (-) rail of the amplifier board. Insert the red (+) wire into the same row as the wire from the pushbutton switch, as shown.
Insert one end of a plug to plug jumper wire into the signal generator board as shown, where the 10kΩ resistors meet. Plug the other end into the negative (striped) side of the 33μF capacitor.
Now, when you press the pushbutton, both circuits receive power, and you should hear a noise coming from the speaker. If you don’t, stop and recheck all of your connections.
IS IT PERFECT?
Far from it. The sound in real horns of this type is made up of far more frequencies, although car horns are usually one, and truck horns two. Most train horns in Australia use five frequencies, with one air horn for each. When a person using a manual horn makes the appropriate noise with their lips, a large spectrum of noise is created, with some dominant frequencies that are louder. Those are the ones we can recreate electronically with ease. The rest of the frequencies, called harmonics, are varied and complex. In addition, there is some white noise generated from moving air, either through lips or reeds. Although not loud with lips and even less so with reeds, this sound still contributes to the overall effect.
Finally, the sound does not start sharply in a historic horn, as there is a short time when pressure is building up as the user begins to blow. This is hard to notice but it softens the beginning of the sound. You can replicate this electronically with a capacitor, a few resistors, and a transistor, but that’s for another time. However, as presented, this circuit still should allow you to have some fun.
If you really want to expand your possibilities, you can do some internet research of your own. There is a way to connect an NPN transistor, often a BC547/8/9 as a white noise generator. This involves connecting the base to ground and the emitter, via a resistor, to supply. This reverse-biased junction creates white noise, which will need to be amplified by an op-amp.
How Do These Circuits Work?
THE SIGNAL GENERATOR
The LM358 op-amp is actually two op-amps in one package, with common power connections. It was chosen, among other reasons, because it is designed to operate from a single rail power supply, which is what we have from a battery.
Most manufacturers’ datasheets for the LM358 include an application circuit for a square wave generator. Our circuit is little different from this open-source information, however, we changed the capacitor values to give different frequencies. Looking at the schematic, you can see IC1a and IC1b. These are the two op-amps within the package. The two 100kΩ resistors R3 and R4 near IC1a form a voltage divider from the power rail, keeping the non-inverting input (+) of IC1a fed with a reference voltage of half the supply voltage.
To begin, the output of IC1a is low. This means that the voltage at the inverting (-) input is lower than the reference voltage, because there is nothing happening to provide any input - the 100kΩ resistor R2 is connected to the low output, and the other side of the capacitor C1 connects to ground. When the voltage at the inverting input (-) of an op-amp is lower than the voltage at the non-inverting input (+), the output swings to high. Now almost the full supply voltage appears at the output, which flows through R1 to charge C1. As the capacitor charges slowly via R1, the voltage at the inverting input (-) rises, until it reaches the reference voltage.
When the voltage at the inverting input (-) is higher than the reference voltage at the non-inverting input (+), the output swings low. Now, the capacitor can discharge via R2 until the voltage at the inverting input once again falls below the reference voltage at the non-inverting input, and the cycle repeats.
It would repeat very fast indeed if it were not for the presence of the 100kΩ resistor R1. This resistor feeds back some of the output, enough to add to the voltage at the junction of R3, R4, R2, and the non-inverting input. When the output is high, current arrives via R2, raising the voltage at the non-inverting input. When the output is low, the voltage here is less than half the supply, because R2 is effectively in parrallel with R3, because the output is almost at ground when low. The effect of this is that the reference voltage has a range between its upper and lower values, something called hysteresis.
This means that the voltage the capacitor has to discharge to before the output changes to high again is lower than the reference from just the R3/R4 voltage divider alone, and the voltage it has to charge to in order to trigger the output to go low, is higher than the voltage divider alone. This is the timing period of the square wave and determines its frequency in conjunction with the value of C1.
You may notice that the value of R1 pays a role here, but we stuck with the value on 100kΩ all round as in the datasheet, for simplicity’s sake. Changing the value of capacitor C1 provides more than enough variation in frequency, so if it’s not broken, don’t fix it.
What about IC1b? It is identical, except for a different capacitor value at C2, and different pin numbers on the IC. The reason that the physical construction on the breadboard is not just mirrored on both sides of the IC, is that the pin assignments differ between the two sides.
The amplifier circuit was needed because the output from the op-amp based signal generator is too low on power (high on voltage but low on current) to drive the speaker directly. A full explanation of the amplifier works is beyond the scope of this article, however, here is a summary.
The input is an AC signal, coupled by the 33µf capacitor to the base of the BC547 transistor, which is biased by R3 and R4. This increases the initial level of the signal to a usable voltage but still a low current. The BC547 acts as a low-side switch to control the bases of both the BC337 and BC327. R2 and D1 create a small difference between the bases of the two transistors in the complementary pair, which keeps both slightly biased but not quite 'on'.
Note that the current for the bases must flow through the speaker coil - there is no other connection from the power rail to the bases of the transistors in the pair.
The other end of the speaker is connected via the 100µf capacitor C2, to the emitters of the BC327 and BC337. These transistors work together to provide the current amplification necessary to operate the speaker. They are both rated to 800mA, far more than the BC547/8/9 and BC557/8/9 we often use (rated to only 100mA).
This is the very condensed explanation, but hopefully, it gives an idea of what's going on. Keep an eye out for a more powerful amplifier project in the near future, which will fully explain the complementary pair.
WHERE TO NEXT?
You could change the sound by varying the value of C1 and C2 in the signal generator circuit, which are currently 10nF and 39nF. Try values between 3.3nF and 180nF to start with.
Additional changes in sound can be gained by changing the values of the capacitors in the amplifier circuit.
Currently, C1 is 100μF. Try values between 1μF and 470μF. For capacitor C2, currently 33μF, try values between 4.7μF and 220μF.
In terms of physical construction, try cutting a hole in a paper or plastic cup to form a cone over the speaker, or roll up paper or cardboard to make an even bigger one. You could even experiment with resonant chambers made from different lengths of PVC pipe, although you definitely need an adult to help you cut this, and use a dust mask to avoid the dust produced.
You may like to mount the electronics in a cardboard box or plastic container with a small hole for the pushbutton and somewhere to attach the speaker, maybe with a cone attached, or maybe with longer wires to a speaker in a bigger housing or cone. This way, you can have your war horn somewhere high up in your castle’s lookout tower, and just press the button when you see the enemy approaching.