This is only a preview of the December 2013 issue of Silicon Chip.
You can view 23 of the 104 pages in the full issue, including the advertisments.
Items relevant to "Build An Electronic Bellbird":
Items relevant to "PortaPAL-D: A Powerful, Portable PA System, Pt.1":
Items relevant to ""Tiny Tim" 10W/Channel Stereo Amplifier, Pt.2":
Purchase a printed copy of this issue for $10.00.
Electronic By JOHN CLARKE Bellbird Photo by Sascha Wenninger – http://www.flickr.com/photos/sufw/9055617579/ Looking for a great school project or a really unique Christmas decoration? This electronic Bellbird mimics the musical bell-like sounds of a real Bellbird (or Bell Miner) and has a dynamic LED chaser display as well. Bellbirds And, softer than slumber, and sweeter than singing, The notes of the bell-birds are running and ringing. The silver-voiced bell-birds, the darlings of daytime! They sing in September their songs of the May-time; from “Bellbirds”, by Henry Kendall 26 Silicon Chip K NOWN FOR their characteristic tinkling bell sounds, the Bellbird (or more correctly the “Bell Miner”) lives amongst the eucalyptus tree canopies in South-Eastern Australia. But while the bell-like sounds they make are very musical, their presence is not always completely appreciated. Intrigued? – check out the “Bell Miners & Dieback In Native Trees” panel for more information on this. By contrast, the SILICON CHIP Bellbird, which mimics the sound of a real bellbird, will always be appreciated. It’s presented here as a stand-alone bell-shaped PCB with eye-catching LED lighting effects and a piezo transducer for the sound output. A 3V lithium cell powers the unit which can be hung on a hook or nail on a wall, or even attached to a Christmas tree. Like the real Bellbird, this electronic Bellbird only make sounds during the day or when there is sufficient ambient light. And like the real Bellbird, the sounds it produces are sets of bell sounds with randomised spacings and repetitions. This randomisation siliconchip.com.au S1 +3V POWER 10k 4 10k λ RB3/PWM RA1 FREQUENCY SET 10 RB4 RA0 RA2 S2 RB5 6 RB0 1 µF MMC MMC 3V BUTTON CELL 14 Vdd MCLR/RA5 LDR1 1 µF RA4/AN4 5 9 18 17 1 11 14 1 IC2: 74HC14 2 IC2a 3 240Ω 4 IC2e 11 IC2b 120Ω 13 62Ω IC2d 9 12 IC2f 10 PIEZO TRANSDUCER 56nF 1k 8 7 3 LED1 A LED2 A λ A K 12 Vss 6 470Ω IC1 PIC16LF88–I/P 470k IC2c λ K K LED8 RB6 13 RB7 16 RA7 15 RA6 2 RA3 7 RB1 8 RB2 LED3 A λ A λ K K LED9 LED5 A LED4 A λ A λ A λ K K LED10 λ K K LED11 LED7 A LED6 A λ A λ A λ K K LED12 λ A λ K K LED14 5 SC 2013 λ K LED13 LEDS K BELLBIRD A Fig.1: the circuit uses microcontroller IC1 to generate a PWM waveform at its pin 9 and this feeds Schmitt trigger inverters IC2a-IC2f which in turn provide complementary (push-pull) drive to a piezo transducer. IC1 also drives LEDs1-14 which are arranged in seven paralleled pairs to provide a chaser effect around the outside of the bell. prevents the bell tones from sounding as though they are electronically generated. A power switch at the top of the PCB allows the unit to be switched off if necessary. As well as producing realistic bell sounds, the unit drives 14 LEDs which are arranged around the periphery of the PCB. Whenever it produces a bell sound, these LEDs chase downwards on either side of the bell and then along the base to the centre. The six LEDs along the base then chase from the centre to either side and then back to the centre again, to simulate the final “ringing” of the bell. So unlike a real Bellbird which is difficult to spot amongst the forest canopy, our unit is highly visible. It makes a great novelty project and is ideal as a Christmas decoration. Circuit details Refer now to Fig.1 for the circuit of the Bellbird. There’s not much to it – just two ICs, 14 LEDs, an LDR and a few sundry bits. A piezo transducer siliconchip.com.au reproduces the Bellbird sounds. Inevitably, one of the ICs is a microcontroller (IC1). This is programmed to produce the Bellbird sounds via its pulse width modulation (PWM) output at pin 9. Twelve other outputs of IC1 are used to drive the LEDs. The PWM output is set to run at around 2.8kHz with some variation and its duty cycle is varied to alter the volume. With a 50% duty cycle, the volume is at its maximum and as the duty cycle is reduced, the volume falls. The duty cycle ranges from 50% down to zero, with the minimum volume set at 0.2%. Features & Specifications Features • • • • • Unit produces lifelike Bellbird sounds Bell-shaped PCB with LED chaser around outside; LEDs chase on bell sounds Constant LED brightness as cell voltage varies Bellbird sounds cease in darkness and low ambient light levels Low current drain plus power on/off switch Specifications Power supply: 3V lithium cell Current drain: zero when switched off, <1µA in darkness (100nA measured), typically 1.3mA average in light. Cell life: 180 days expected with one hour per day usage Bellbird tone: adjustable over a ±12% range in 0.375% steps December 2013 27 DRI BLLE B 1 µF 56nF 1 µF 10k A A NOTE: BUTTON CELL HOLDER IS UNDER PCB 62Ω LED11 PIEZO1 LDR1 120Ω LED4 240Ω 10k LED10 470Ω BUTTON CELL HOLDER LED3 IC2 74HC14 A A LED9 To Piezo + LED2 1k LED8 To Piezo S1 LED1 A A 08112131 BELLBIRD A IC1 PIC16LF88-I/P A S2 A LED6 1 3 1 2 1 1 8 0LED7 A LED5 470k A LED14 A LED13 A A LED12 Fig.2: follow this parts layout diagram to assemble the parts onto the bell-shaped PCB. The piezo transducer is mounted on M3 x 9mm Nylon spacers, while the button cell holder is mounted on the back of the PCB (see photo). Note that it’s a good idea to mount the LEDs 5mm proud of the board so that they aren’t obscured by other parts. The piezo transducer is driven via IC2, a CMOS hex Schmitt trigger. IC2c buffers and inverts the PWM output from IC1, while paralleled stages IC2a & IC2b re-invert the resulting signal to drive the top of the piezo transducer. IC2f also inverts the signal from IC2c. Its pin 12 output in turn drives IC2d & IC2e so that their outputs are inverted compared to those from IC2a & IC2b. This allows the piezo transducer to be driven in complementary fashion with a nominal 6V peak-to-peak. Basically, when IC2a & IC2b’s outputs are at 3V, IC2d & IC2e’s outputs are at 0V and vice versa. Because the two sets of outputs alternatively swing to 3V, this gives a 6V peak-to-peak drive (actually >5V peak-to-peak) for the piezo transducer. In effect, this doubles the output voltage drive compared to just using the PWM signal from IC1 as a single output, with the second terminal of the transducer connected to ground. That arrangement would provide a peak signal of less than 3V to the piezo transducer. Note that IC2d & IC2e drive the lower piezo transducer connection via a filter consisting of a 1kΩ resistor and 56nF capacitor. This filter rolls off the response above 2.8kHz and thus removes the harmonics from the square-wave outputs of the Schmitt triggers. In effect, it ensures that a “cleaner” sinewave signal is fed to the piezo transducer. while its paralleled twin LED8 is positioned at top right. As shown on Fig.1, the LED anodes are commoned and driven by IC1’s RA1, RA0, RA2 & RB5 outputs via resistors. By contrast, each LED pair is driven independently via the cathodes, with LED1 & LED8 lighting when IC1’s RB6 output goes low and switching off when this output goes high. Similarly, LED2 & LED9 light when RB7 is low, LED3 & LED10 light when RA7 is low and so on. The 470Ω, 240Ω, 120Ω & 62Ω resistors can be individually driven by IC1 LED chaser Table 2: Capacitor Codes LEDs 1-14 are driven by IC1 as seven sets of paralleled pairs. In practice, they are arranged on the bell-shaped PCB to give symmetrical lighting either side of centre. For example, LED1 is positioned at the top left of the PCB Value 1µF 56nF µF Value IEC Code EIA Code 1µF 1u0 105 0.056µF 56n 563 Table 1: Resistor Colour Codes o o o o o o o o No. 1 2 1 1 1 1 1 28 Silicon Chip Value 470kΩ 10kΩ 1kΩ 470Ω 240Ω 120Ω 62Ω 4-Band Code (1%) yellow violet yellow brown brown black orange brown brown black red brown yellow violet brown brown red yellow brown brown brown red brown brown blue red black brown 5-Band Code (1%) yellow violet black orange brown brown black black red brown brown black black brown brown yellow violet black black brown red yellow black black brown brown red black black brown blue red black gold brown siliconchip.com.au Bell Miners & Dieback In Native Trees Parts List The Bell Miner (Manorina melanophrys), commonly known as the Bellbird, is found in the eucalyptus forests of south-east Australia. The birds feed mainly on dome-shaped protective coverings made by a particular psyllid bug from its own secretions. These bugs themselves feed on the eucalyptus from the leaves of eucalyptus or gum trees. Colonies of Bell Miners allow large populations of the psyllid bug to exist in their territory by expelling other birds that also eat these bugs. They also maintain a sufficiently large territory so that they don’t over-feed. This maintains the population of psyllid bugs and can lead to ‘die back’ in the eucalyptus forest. 1 double-sided plated-through PCB, code 08112131, 91 x 73mm (bell shaped) 1 PCB-mount SPDT toggle switch (Altronics S1421 or equivalent) (S1) 1 SPST vertical mount micro switch with 6mm actuator (Jaycar SP-0603, Altronics S1421) (S2) 1 20mm button cell holder (Jaycar PH-9238, Altronics S5056) 1 CR2032 lithium cell 1 30mm diameter piezo transducer (Jaycar AB-2440, Altronics S 6140) 1 LDR 10kΩ light resistance (Jaycar RD-3480, Altronics Z1621) (LDR1) 2 M3 x 9mm tapped Nylon spacers 4 M3 x 5mm screws 1 70mm length of 1.25mm enamelled copper wire or driven in various parallel combinations to power the LEDs. This allows the LED current to be maintained at a relatively constant value as the supply voltage progressively drops from 3V when the cell is new down to 2V as cell discharges. The voltage across the lit LEDs always remains close to 1.8V which leaves 1.2V across the resistors when the button cell is at 3V and just 0.2V across the resistors when the cell is down to 2V. By selecting the appropriate resistance, we can set the LED current to about 5mA regardless of cell voltage. In operation, each resistor is effectively switched into circuit when its corresponding pin on microcontroller IC1 is set high. Alternatively, a pin can be set as an input to effectively disconnect its resistor and thus prevent it from contributing to the LED drive. For example, when RA1 is high, the LEDs can be driven via this 470Ω resistor. Alternatively, when RA1 is set as an input, this resistor does not contribute to any LED current. Similarly, when RA0 is high, it drives the LEDs via the 240Ω resistor and so on. If more than one output is set high, the corresponding resistors are driven in parallel. Taking them all high provides the lowest resistance possible (since that are effectively connected in parallel) and this is required when the cell voltage is down to 2V. When the cell voltage is 3.0V, just the 240Ω resistor drives the LEDs. For any voltage between 2V and 3V, a suitable combination of resistors is selected so that the LED current is always close to 5mA. Determining cell voltage So how does IC1 measure the cell voltage so that the appropriate resistors can be selected? It’s done by using the AN4 input to measure the voltage between the anodes of LEDs1 & 8 and the positive supply when these LEDs are driven via the 470Ω resistor at RA1. In practice, the voltage across the LEDs remains close to 1.8V regardless of the variation in LED current and so the measured voltage is proportional to the supply (ie the cell voltage). As previously stated, at 3.0V the voltage measurement is 3.0 - 1.8V = 1.2V. With a 2V supply, the voltage measurement is 2 - 1.8V = 0.2V, and so on. A look-up table in the software specifies which resistors should be selected for a given measured voltage. LDR1 is used to monitor the ambient light, so that the LEDs only come on during daylight or in high ambient light conditions. This is done to conserve the cell and works as follows. In darkness, the LDR’s resistance is very high at several megohms and so pin 6 of IC1 is held low (1V or less) via its associated 470kΩ resistor. When IC1 detects this low voltage, it goes to sleep, stopping all operation and thus minimising the current drain from the cell. Typically, the current drain in this sleep state will be less than 1µA but our prototype was measured at just 100nA. As soon as light is received by the LDR, its resistance falls to around Issues Getting Dog-Eared? Semiconductors 1 PIC16LF88-I/P microcontroller programmed with 0811213A.hex (IC1) 1 74HC14 DIP14 hex Schmitt trigger (IC2) 1 DIL14 IC socket 1 DIL18 IC socket 14 3mm green high brightness LEDs (LED1-14) Capacitors 2 1µF monolithic ceramic (MMC) 1 56nF or 47nF MKT polyester Resistors (0.25W 1%) 1 470kΩ 1 240Ω 2 10kΩ 1 120Ω 1 1kΩ 1 62Ω 1 470Ω 10kΩ and the voltage at pin 6 rises to almost the supply voltage. This causes the microcontroller to wake up and begin playing the Bellbird tones and driving the LEDs. Note that IC1 always checks the cell voltage each Keep your copies safe with these handy binders REAL VALUE AT $14.95 PLUS P & P Order now from www.siliconchip.com.au/Shop/4 or call (02) 9939 3295 and quote your credit card number or mail the handy order form in this issue. *See website for overseas prices. siliconchip.com.au December 2013 29 Can It Be Made Louder? Inevitably, some people will want to make it louder and will want to know what modifications are necessary to achieve this. Hence, after the circuit had been fine-tuned to give the most realistic Bellbird sounds, we looked at whether the low-pass filter in series with the piezoelectric transducer could be further tweaked to make it louder. To that end, we reduced the 1kΩ current-limiting resistor to 220Ω and increased the associated filter capacitor from 56nF to 220nF (the piezo transducer has a self-capacitance of 38nF). The result was that it was slightly louder but we judged that the sound was a little more “clicky” (because of the stepped modulation) and had also lost some of the subtle echo effects which make the Bellbird sound much more realistic. Another way of making the sound louder would be to increase the supply voltage to 4.5V by substituting a 3 x AAA cell (alkaline) battery instead of the 3V button cell. Note that this will increase the peak signal voltage to about 7.5V. Well, can the signal be fed to an external amplifier? The answer is yes but be aware that the signal has quite a wide dynamic range and the peak signal amplitude with a fresh 3V cell will be be in excess of 5V (or 7.5V peak with a 4.5V supply), so if the volume control is too advanced, the amplifier and perhaps the loudspeaker will be overloaded. time it wakes up or when the circuit is powered up (via S1), so that it can correctly set the LED current. Adjusting the tone Switch S2 is used to adjust the Bellbird frequency (or tone). This is included because IC1 utilises an internal oscillator that runs with an initial 2% tolerance. As a result, the oscillator frequency may need adjusting slightly to give the correct bellbird sound. When S2 is pressed, the resulting low on RB4 is detected by IC1 and the program then produces a series of bell tones, with each tone varying by a small amount (0.375%) for each step. The switch is simply released when the required tone is found. IC1 then stores this tone setting in its EEPROM so that the correct tone is used from then on, even if the power is switched off and on again. If necessary, you can return to the initial default tone by pressing and holding down S2 as the Bellbird is powered up with S1. Alternatively, you can cycle through the available tones by holding S2 down until the centre frequency is reached. Since there are 64 separate tones produced, the centre tone frequency occurs 32 tones after the transition from maximum to minimum, a tone step that’s readily noticed. S1 is the power on/off switch. The 3V supply is decoupled using a 1µF capacitor for IC1 and another 1µF capacitor for IC2. The MCLR-bar pin of IC1 is a power-on reset input and 30 Silicon Chip This view shows how the cell holder is mounted on the rear of the PCB. It must be installed before mounting the piezo transducer, so that you can solder its leads. pulling it high via a 10kΩ resistor ensures that the microcontroller starts correctly (ie, at the beginning of its program) when power is applied. Note that no reverse polarity protection is included to protect the ICs against incorrect supply polarity. That’s because the cell holder itself does not make a connection to the cell if the latter is inserted incorrectly. Provided the cell holder is installed on the PCB correctly and IC1 & IC2 are both orientated correctly, the circuit cannot be damaged by an incorrectly installed cell. That said, we recommend that the supply polarity delivered by the cell in its holder be checked before installing IC1 & IC2 into their sockets. This is detailed later under testing. Assembly Building this project is easy and should take you no more than 45 minutes. There are no surface-mount parts (SMDs) and all parts are installed on a PCB coded 08112131 and measuring 91 x 73mm overall. This is bell-shaped and will already be cut to shape if you ordered the PCB from the SILICON CHIP Online Shop or as part of a kit. Fig.2 shows the parts layout diagram. As can be seen, all parts mount on the top of the PCB except for the cell holder which mounts on the back. Begin the assembly by installing the resistors. Table 1 shows the colour codes but we also recommend using a digital multimeter to measure each resistor, just to make sure that each is placed in its correct position. The resistors must be pushed all the way down onto the PCB, with the leads soldered and trimmed short on the back. The IC sockets are next on the list but make sure they are orientated as shown on Fig.2 (ie, notched ends to the left). Don’t install the ICs at this stage though; that step comes later, after some initial testing. Follow with the capacitors and the two switches, again pushing these parts right down onto the PCB before soldering. Note that S2 will only mount with one orientation, as its pin spacings differ between adjacent sides. The LDR can now be installed (it can go in either way around), after which you can install the LEDs. The latter must all be orientated with their longer anode leads (A) towards the top of the PCB. You can push the LEDs all the way down onto the PCB if you like but we suggest mounting them about 5mm proud of the PCB so that they aren’t obscured by adjacent parts. The best way to go about this is to push each LED down onto a 5mm-high cardboard spacer (slid between its leads) before soldering it into position. To make this process easier, the leads can be soldered on the top of the PCB. Next on the list are two M3 x 9mm stand-offs which are used to mount the piezo transducer. Secure these to the siliconchip.com.au Fig.3: this scope grab shows part of a sequence of Bellbird “calls”. Note that each one differs in amplitude, modulation and duration. PCB using M3 x 6mm screws but don’t mount the piezo transducer at this stage. Once these are in place, install the cell holder on the rear of the PCB (ie, under IC2). A hanging loop can now be made using a 70mm-length of 1.25mm-diameter enamelled copper wire. Cut it to length, then scrape the enamel from the ends using a sharp hobby knife before bending the wire into a loop. The wire ends can then be bent at right angles and soldered to the holes on either side of switch S1, at the top of the PCB. Fig.4: this shows a 10-second sequence of Bellbird calls. The scope has been over-driven to more clearly demonstrate the dynamic range of the signal which has a peak voltage of just over 5V. Again, note that there are a variety of “calls”, to simulate a group of Bellbirds calling in a forest. Testing Now for some initial tests before installing the ICs and the piezo transducer. First, insert the cell into its holder, then switch the unit on using toggle switch S1. That done, check the voltage between pins 14 & 5 of IC1’s socket. You should get a reading of +3V (ie, the cell voltage) on pin 14. Similarly, pin 14 of IC2 should also be at +3V with respect to pin 7 of this socket. If this is correct, switch off and install the ICs. Make sure that both ICs are orientated correctly; ie, with the notch or pin 1 indentation at one end of each IC towards the notched end of its socket. The piezo transducer can now be installed. It mounts onto the stand-offs after first drilling out its mounting holes to 3mm and is secured using M3 x 6mm machine screws. Once it’s in position, trim its leads to about 35mm long, strip 3mm of insulation from the wire ends and solder the leads to the pads on the PCB marked ‘To Piezo’. It doesn’t matter which way around you connect these leads; they can go to either PCB pad. And that’s it! You should now be greeted by musical Bellbird sounds when the unit is switched on and the LEDs should chase down the outside of the bell and along the bottom. If necessary, you can now change the Bellbird tone by pressing and holding S2 to set the Bellbird cycling through its output frequency steps. Release the switch when the required tone is heard. If you want to return to the default frequency, switch the Bellbird off and wait a few seconds, then press and hold pushbutton switch S2 while you re-apply power. Finally, after a second or so, release S2 and the unit will again be SC at the default frequency. siliconchip.com.au Fig.6: the Bellbird signal is a heavily filtered sawtooth waveform which is modulated in steps. The low-pass filtering has a -3dB point at about 2kHz. Fig.5: this scope grab shows just one Bellbird call, taken at a sweep speed of 20ms/div to show more detail of the complicated modulation which is applied to each note. December 2013 31