Silicon ChipA Useless Box - December 2018 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Love or hate Google, the massive EU fine is a joke
  4. Feature: "The Grand Tour": the incredible Voyager missions by Dr David Maddison
  5. Project: An incredibly sensitive Magnetometer to build by Rev. Thomas Scarborough
  6. Project: Amazing light display from our LED Christmas tree... by Tim Blythman
  7. Feature: The Arduino Uno’s cousins: the Nano and Mega by Jim Rowe
  8. Subscriptions
  9. Serviceman's Log: Travelling makes me go cuckoo by Dave Thompson
  10. Christmas Showcase
  11. Project: A Useless Box by Les Kerr & Ross Tester
  12. Feature: El cheapo modules, part 21: stamp-sized audio player by Jim Rowe
  13. PartShop
  14. Project: Low voltage DC Motor and Pump Controller (Part 2) by Nicholas Vinen
  15. Vintage Radio: 1948 AWA compact portable Model 450P by Associate Professor Graham Parslow
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: Tinnitus & Insomnia Killer, November 2018; LED Tachometer, October-November 2006
  19. Outer Back Cover: Hare & Forbes Machineryhouse

This is only a preview of the December 2018 issue of Silicon Chip.

You can view 37 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "An incredibly sensitive Magnetometer to build":
  • Extremely Sensitive Magnetometer PCB [04101011] (AUD $12.50)
  • Extremely Sensitive Magnetometer PCB pattern (PDF download) [04101011] (Free)
  • Drilling template for the High-Sensitivity Magnetometer (PDF download) (Panel Artwork, Free)
Items relevant to "Amazing light display from our LED Christmas tree...":
  • Software for Amazing Light Patterns for the LED Christmas Tree (Free)
Articles in this series:
  • Oh Christmas tree, oh Christmas tree... (November 2018)
  • Oh Christmas tree, oh Christmas tree... (November 2018)
  • Amazing light display from our LED Christmas tree... (December 2018)
  • Amazing light display from our LED Christmas tree... (December 2018)
Items relevant to "A Useless Box":
  • Useless Box PCB [08111181] (AUD $7.50)
  • Pair of programmed micros for the Useless Box [0811118A/B.HEX] (Programmed Microcontroller, AUD $20.00)
  • Software for the Useless Box (Free)
  • Useless Box PCB pattern (PDF download) [08111181] (Free)
  • Useless Box panel label (Panel Artwork, Free)
Items relevant to "El cheapo modules, part 21: stamp-sized audio player":
  • DFPlayer Mini audio player module (Component, AUD $6.00)
  • Sample BASIC source code for interfacing a Micromite with the DFPlayer Mini module (Software, Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
Items relevant to "Low voltage DC Motor and Pump Controller (Part 2)":
  • Four-channel High-current DC Fan and Pump Controller PCB [05108181] (AUD $5.00)
  • PIC16F1459-I/SO programmed for the Four-channel High-current DC Fan & Pump Controller (0510818A.HEX) (Programmed Microcontroller, AUD $10.00)
  • Firmware for the Four-channel High-current DC Fan & Pump Controller (0510818A.HEX) (Software, Free)
  • Four-channel High-current DC Fan and Pump Controller PCB pattern (PDF download) [05108181] (Free)
Articles in this series:
  • Low-voltage, high-current DC Motor Speed Controller (October 2018)
  • Low-voltage, high-current DC Motor Speed Controller (October 2018)
  • Low voltage DC Motor and Pump Controller (Part 2) (December 2018)
  • Low voltage DC Motor and Pump Controller (Part 2) (December 2018)

Purchase a printed copy of this issue for $10.00.

Des Design by Les Kerrr Article by Les Kerr & Ross Tester A Christmas project that will keep the grandkids entertained well into the (2020?) New Year! SILICON CHIP projects don’t all have to be serious, nor solve one of mankind’s greatest needs, nor even be all that practical. Some of them are whimsical; others – like this one – can be downright useless! Nevertheless, it’s all good fun! Y ou’d remember the Pet Rock craze from a few years ago? The ultimate Useless Box would be just like one of those – that does absolutely nothing. But we wouldn’t mind betting that kids would get sick of a box that does 66 Silicon Chip Froggy just sits there, minding his own business . . . nothing even faster than a pet rock! This Useless Box doesn’t lose any of its “uselessness” but it actually does something: if you disobey the instruction on the front and turn it on, it turns itself off again! Now you’d have to agree that this Australia’s electronics magazine Uh-oh, someone has operated the switch! The lid flies open . . . is close to, but not quite, totally useless . . . The Useless Box has one switch on it with a simple label: Don’t Operate The Switch – which, of course, becomes overwhelmingly tempting for just about anyone – especially young children. siliconchip.com.au The light comes on and Froggy’s hand (foot!?) comes up out of the box . . . But why don’t we start at the start – the Useless Box obviously needs a box! The Useless Box box! Something chirping inside the box adds to the intrigue and eventually curiosity gets the better of them – and they give in and flick the switch. The box whirrs, its lid opens, a light comes on, a frog (yes, a green one!) pops out and his “hand” reaches out to turn the switch back off again, with a warning not to touch it again. “GO AWAY!” it says. (The frog’s mouth moves in time with its “speech”). After which, the frog goes back inside the box, the lid closes . . . and that’s it – until next time the switch is operated (which, of course, it will be before long!). After this, the frog even gets a little aggro, throwing the lid open a couple of times and closing it, with a final “I TOLD YOU TO GO AWAY!” siliconchip.com.au And reaches over, pushes down on the switch to turn it off . . . So that’s the Useless Box – a great gimmick to build for a Christmas present, particularly for the grandkids. (In fact, that is why the Useless Box came into being). It will keep enquiring young minds amused for hours, wondering how Froggy knows that they’ve disobeyed his warning and how he pops out and turns the switch off again! Just in case you’re still wondering about the hows/whens/wheres/ whys of the Useless Box, we’ve    made a small video of it so you can see for yourself. You’ll find it at siliconchip.com.au/Videos/ Useless+Box Australia’s electronics magazine He utters a few words while the light turns off and he slinks back inside . . . We used a hinged jewellery box which we obtained at a local bargain shop – ours measures 200mm x 150mm x 110mm but the dimensions aren’t particularly important, just as long as it can house the internal workings. You may find one slightly different – or, indeed, you may put your handyman skills to work and build your own. Box material is also unimportant – any lightweight timber will do, as long as its made strong enough to handle many openings and closings. A lot of the commercial ones appear to be made from bamboo or craftwood. It’s nice if the top and bottom of the box are a tight fit when closed, too – you don’t want to give any clue about what’s inside box before inquisitiveness gets the better of them and the switch is flipped! For all the above reasons, we haven’t shown any drawings of the box. What we have shown is several photos of the frog and the box internals, which you can follow when crafting your own. We’ll get back to these shortly. The frog’s arm The most important part of the mechanical design is the frog’s arm. It is U-shaped and attached to a servo so that when rotated through 180°, it extends over the front edge of the box and presses down on the power switch, toggling it. You can see the arm both in its resting position and reaching out to turn the switch off in the photos of the box internals. The photos also show an aluminium bracket on the lid which holds the lid closed when the frog is chirping. This is so that the children can’t December 2018  67 And waits for the next person to ignore the warning and operate the switch . . . +12V D1 1N5405 A REG1 7805 100 F 0V +5V (FOR SERVOS ONLY) OUT IN K GND REG2 LP29 5 0-5.0 IN OUT +5V (FOR FROG CIRCUITRY) GND 100nF 100nF 100 F 4.7k 4 REG3 7805 IN 470 F 100nF OUT 3 +5V (FOR SFX & AUDIO) GND 100nF 2 1000 F 18 17 16 MODIFICATIONS FOR THE MG959 ARM SERVO (ONLY) x Locate 50k pot within the servo body. Unsolder (or cut) two outer x wires as shown here (red x). 2.7k Solder in two 2.7k 1/4W (or 1/8W) resistors in series between the wires removed and the outer pot terminals 15 13 USELESS BOX RB0 RA4 RB1 RA3 RB2 IC1 PIC1 6F8 8 PIC16F88 RA1 RB3 RA0 RB4 OSC1 RB6 OSC2 RA2 RB5 RB7 CTRL 6 CTRL ARM SERVO 7 LID SERVO MOUTH SERVO ARM SERVO: TURNIGY MG959 (MODIFIED – SEE BELOW LEFT) LID SERVO: TURNIGY MG959 MOUTH: HOBBY TECH YM2763 8 9 FROG SOUND 3 10 FROG SOUND 2 12 FROG SOUND 1 1 MOUTH INHIBIT D3-5 1N4148 11 680 A 10k BOX  ILLUMINATION K LED1 2.7k +5V 1N5405 K K K A E 7805 GND B A A LP2950 BC547 LEDS C IN OUT GND IN GND OUT Fig.1: it’s essentially a project in two halves – IC1, 2 and 3 provide the servo control and trigger the voice unit, which is the Digital Sound Effects Generator from August 2018. This has an inbuilt audio amplifier to drive a speaker. open the lid easily – they have to operate the switch instead.When the box is closed, the bracket hooks onto the end of the servo arm which is later used to open the lid. Whether you want to go to this extreme is entirely up to you – just remember, kids are inquisitive and will try to open the box if you make it easy! servos, which provide all the movement in the UseOPEN/CLOSE less Box. BRACKET WHITE There is one servo to raise and LED lower the lid, while another moves the frog’s arm to provide the switching action. Both of these are Turnigy MG959 25kg/ LID SERVO cm units, purchased from Hobby King but one, that controlling the arm, needs FROG LIPS ATTACH TO to be modified slightly (we’ll look at SMALLER SERVO this in a moment). The component parts The third servo is a smaller, less There are three parts to the powerful model which moves the ARM design : frog’s mouth in time with the FROG ARM ATTACHES SERVO TO LARGE SERVO • the mechanical part, which words. provides the movement of It is a Hobby Tech 13kg/cm the frog and its arm AND model and came from Jaycar, Cat opens and closes the box; YM-2763. • the electrical part, which If you have some spare servos provides the timing for the in your junk box, you might be mechanical actions; and able to press them into service but • the sound part, which al- This internal photo shows how the frog body is conkeep in mind the 25kg/cm rating lows the frog’s chirping nected to the lid but the arm is removed and attaches of the two larger types – the lid is and voice to be both re- to one of the larger servos which turns the switch off. not heavy but does require some The rear servo opens and closes the lid via the alumcorded and played. force to open and close it. And inium bracket (not connected in this photo). This also Froggy’s “hand” must strike the prevents the lid being opened by inquisitive fingers! The servos Note also the white LED attached to the lid and its con- toggle switch with enough presThe major part of the me- cealed wiring. You could copy this directly, or perhaps sure to turn it off. chanical side is the three come up with your own mechanical arrangement. Ordinary “hobby” servos such 68 Silicon Chip CTRL 0V 0V 0V 5 1N4148 SC Vdd RA5/MCLR S1 +5V +5V +5V “DO NOT OPERATE” 14 Vss THE MG959 LID SERVO IS NOT MODIFIED 20 1 8 470 F 100nF Australia’s electronics magazine siliconchip.com.au +5V 10F 100nF 5 ENVELOPE DETECTOR IC2: OPA2340 OR MCP6022 7 IC2b 6 A 10 F 4 100k 8.2k 4 8 2 VR1 10k D2 1N4148 1 IC2a 3 7 GP2 1 F MULTILAYER CERAMIC GP5 IC3 PIC12F675 MCLR/GP3 GP4 GP0 GP1 2 3 6 Vss 470k 1.8k 56nF K 4.7k 8.2k VR1: MOUTH THRESHOLD ADJUST 5 1 Vdd 100nF 8 100k C 22k Q1 BC547 10k B E 12k PART SUPER DIGITAL SOUNDS EFFECTS GENERATOR (SILICON CHIP AUGUST 2018) +5V REG4 MCP1700-3.3  Link LK2 is permanently closed (the header can be replaced with a wire link). OUT IN 1 F +3.3V MCP1700 1k ICSP Vin Vout 1 3 MICRO-SD CARD SOCKET 4 PGD 4 5 PGC 5 +3.3V 1 F 28 AVDD/VDD 1 2 1 2 3 4 5 6 7 8 26 SDO1 18 SCK1 17 SDI1 25 1 F AN4/RB2 RB0/AN2/PGED1 VREF+/AN0/RA0 RB1/AN3/PGEC1 AN5/RB3 24 7x 1k 22 7 SW6 21 FROG SOUND 3 6 SW5 11 FROG SOUND 2 5 SW4 10 FROG SOUND 1 4 SW3 19 3 SW2 16 2 1 S1 siliconchip.com.au CON4 6 SDO2 1 2 SCK2 2 7 CS2 3 3 MCLK 4 VA SDATA AOUTL SW1 15 8 SCLK/DEM IC2 CS4334 LRCK AOUTR MCLK AGND 270k 5 6 9 10 F RB 8/TDK RB14/RB16/AN9 +5V 22k RB13/AN8 1 5 RB11/D+ PGED3/RB5 RB 10/D– 8 3 IC1 PIC32MM0256GPM028-I/SS SW7 8 7 23 CLK1/RA2 RB9/TD0 CON1 TRIGGERS +5V VUSB3V3 RB15/RP17 1 F 1 F 13 VDD VREF–/AN0/RA1 CS1 CD 1 F MCLR CON3 S2 +5V +5V LK2 GND GND 10 F 14 1 F IN– IN+ Vcc IC3 Out+ IS31AP4991 BYPASS Gnd SDB 4 Out– 7 6 2 8 SPEAKER RB4/RP10/SOSCI RA3/RP4/CLKO RC9/RP19 SOSCO/RP5/RA4 RB 7/TDI VCAP RB 6/PGEC 3 AVSS 27 VSS 8 12 20 330pF 47k 22k A 10 F  LED1 100pF K Australia’s electronics magazine December 2018  69 + GND 470µF +5V OUT GND 100µF D3-D5 3 2 1 TERMINALS 6 No. Value 1 470kΩ 2 100kΩ 1 22kΩ 2 12kΩ 2 10kΩ 2 8.2kΩ 2 4.7kΩ 1 1.8kΩ 1 680Ω 2 2.7kΩ* 4-Band Code (1%) yellow violet yellow brown brown black yellow brown red red orange brown brown red orange brown brown black orange brown grey red red brown yellow violet red brown brown grey red brown blue grey brown brown red violet red brown 5-Band Code (1%) yellow violet black orange brown brown black black orange brown red red black red brown brown red black red brown brown black black red brown grey red black brown brown yellow violet black brown brown brown grey black brown brown blue grey black black brown red violet black brown brown Resistors for the Sound Card are all SMD – refer to the article in August/September. Silicon Chip 5 diode and the resultant DC voltage charges a 1µF capacitor. The time constant of this capacitor and the parallel 100k resistor is set so that the voltage applied to the negative input of the second OPA2340 (IC2a) follows the envelope of the audio signal. IC2a is wired as an inverting Schmitt trigger whose output will be low if the voltage on its negative input exceeds the voltage on its positive input. If the mouth inhibit signal is high, ie, BC547 transistor (Q1) is on, then the voltage on the positive input is set by the 10k potentiometer. PIC12F675(IC3) operates the mouth servo, opening the mouth if its input is low and shutting it if its input is high. In other words, if the envelope voltage is high then the mouth is open and if it is low the mouth is closed. * required for modifying one servo for 180° operation. Preferably 1/8W; 1/4W should fit 70 CON3 A K LED2 4.7kΩ 8.2kΩ 8.2kΩ 100nF AUDIO IN 470kΩ 10kΩ + 10µF 100nF 100kΩ 4148 D2 IC2 MCP6022 56nF 10µF NP 100kΩ 10kΩ © 2018 USELESS BOX 08111181 RevA 3x 1N4148 etc 4 ON CON4* TO SPEAKER OUT (PIN 2, CON2)* Fig.2: the control PCB component overlay, which matches the photo at right. Power for the Sound Effects/Audio amplifier board is taken from the pair of terminals indicated, with other connections to that board shown in red. Other connections were provided “just in case”! Resistor Colour Codes (Controller only)           CON4 SOUNDS S1 * CONNECTIONS IN RED ARE TO THE DIGITAL SOUND EFFECTS PCB (SILICON CHIP AUGUST 2018) Q1 BC547 100nF CON5 CON6 CON2 10kΩ 1000µF + 1µF IC3 VR1 IC1 PIC16F88-I/P LP2950-5.0 680Ω GND 12kΩ + REG3 7805 +100nF x 2 LID MOUTH PIC12F675-I/P 1.8kΩ + 100nF x 2 11.4V OUT ARM 470µF 22kΩ GND REG1 7805 D1 4.7kΩ +12V CON1 IN REG2 +5V TO SOUND CARD CARD* + 5404 12V DC IN FROM INPUT SOCKET + 4148 The frog’s mouth moves in concert with the audio. The mouth itself is made from two half circles of brass wire. One is fixed in the horizontal plane adjacent to the servo shaft and the other is connected to the servo shaft itself. To move the frog’s mouth in sequence with him (her? it?) speaking, the audio signal is envelope-detected then this voltage is applied to a Schmitt trigger so that we get a mouth open/mouth closed signal to operate the mouth servo pretty much in time with the voice. The first stage of the OPA2340 (IC2b) is wired as a non-inverting audio amplifier with a voltage gain of 11. Its output is rectified by a 1N4148 SERVOS 4148 Did someone mention mouth? 5V C 0V 5V C 0V 5V C 0V 100µF + 4148 as those used for model aircraft, etc will probably not have enough force to achieve this. The mouth movement is not quite as difficult, so a typical model servo should be quite adequate. OK, back to the arm servo. As supplied, like most servos it only operates through 90° but we need it to operate through 180°. The easiest way to achieve this is to open up the servo (it’s not difficult) and locate the two ends of the 5k position potentiometer. Disconnect the wires from each end of the pot and add in a 2.7k, 1/4W resistor (or even 1/8W if you can get them) in series with the wire ends and the pot terminals. Close the servo back up again and it will now work through 180°. There’s a YouTube video which shows how to do this if the description isn’t clear: http://youtu.be/F0k9CklRE0 Australia’s electronics magazine The 10k potentiometer provides an adjustment so that the mouth moves in time with the audio. The voice recorder/amplifier When Les Kerr originally submitted this project to SILICON CHIP, he used the Voice Recorder published back in our December 2007 for the sound effects, along with a separate “Champion” audio amplifier. There was a major problem with this: the HK828 chip is now obsolete and becoming very hard to get (it’s even been discontinued by Jaycar Electronics, who developed that project). So we revised the Useless Box using the Super Digital Sound Effects Module we published just last August/September. This will ensure that it will be current for many years. It reads its messages from an SD card and uses a PIC micro to select them and the appropriate message to send to its inbuilt audio amplifier. There’s another reason to use the August module: the separate audio amplifier in the original Useless Box is no longer required – the IS31AP4991 can provide up to 1.2W into an 8-ohm speaker. All you need to do with the new sound effects module is connect a speaker – and this can be just about anything that will fit in the box. Chances are you have a suitable speaker in your junk box! You can record whatever messages siliconchip.com.au Here’s a photo of the control PCB at left, reproduced same size. Many readers will be delighted to know that it’s all “through hole” components – no 40/20 vision required for this one! No photo nor overlay is shown for the Sound Effects board: see August 2018 issue. Note that some servos will have different pinouts and will need to be modified to suit. in whatever voices you want – the August/September 2018 tell you how to do that. If you need an authentic frog sound, you’ll find a recording of the Per tree frog at www.anbg.gov.au/sounds/ Software Each of the three PIC microcontrollers in the Useless Box require different firmware. If you purchase the PICs from SILICON CHIP they will come preprogrammed; otherwise you will need to download the hex files from siliconchip.com.au and program them yourself. We’re assuming that you have the necessary knowledge and equipment to do this! You will need 0811118A.hex for the PIC16F88-I/P and 0811118B. hex for the PIC12F675-I/P. The firmware for the Sound Effects Module pic (PIC32MM0256GPM028-I/SS) is 0110718A. So what does it do? Not much . . . it’s pretty useless! We’ve covered a lot of this earlier in the description of the various sections but in a nutshell, the Useless Box IC1 (PIC16F88) lies dormant, waiting for an input from S1, the “Do Not Operate” switch on the RB0 input (pin 6). This input is normally held low by a 10kresistor to 0V but goes high (ie, to 5V) when the switch is operated. This switch operates “upside down” to what you might expect – “up” is on and “down” is off. This is so Froggy’s hand can turn the switch back to “off” by pressing down on it. (It’s a lot harder to go the other way!). The miscreant who disobeys the warning sign pushes it up to operate it. Each time the switch is turned on there is a different reaction. The first time, it does not play any sounds – the frog switches S1 off in silence. The second time, it drives RB4 high (pin 10 – frog sound 2; “Go away!”) and the next time, RB3 (pin 9 – frog sound 3; “I told you to go away!”), which in turn trigger the Sound Effects Module IC1 inputs on CON4. First is pin 19; (RC9/RCP19), then pin 10, RB4; and finally pin 11 (RB4). At the same time (and in the same sequence) the RB1 and RB2 outputs (pins 7 and 8) send the appropriate signals to their respective servos – RB1 activates the arm servo and RB2 activates the lid servo. The mouth servo operates slightly differently as it has to work (roughly!) in time with Froggy’s voice. We won’t try to reinvent wheels by describing the Sound Effects Module here – if you want to fully understand how it operates (including how you record your voice messages on the SD card), please refer to the articles in August and September 2018 (siliconchip. com.au/Series/325). Of course, the three “frog sound” messages can be anything you wish to record on the SD card. Power Supply The Useless Box is powered from a 12V DC, 1A plug pack, connected to the box via a suitable DC socket . Power connects from this socket to the +12V in and GND terminals at the top left of the PCB, thence via a 1N5404 reverse-polarity protection diode. At 3A, this diode is arguably higher rated than might appear necessary but a typical 1N4xxx diode (rated at ROUTINES There are three different routines of operation that follow each other. They are started when the toggle switch on the front of the box is operated. The first: 1 Inhibit mouth movement 2 Chirping sound (1) off 3 Open the box lid 4 Switch the light on 5 Frog arm moves out, closing the switch 6 Arm retracts 7 Switch light off 8 Box lid closed siliconchip.com.au The second: 1 Start frog sound 2 “go away” 2 Enable frog mouth movement 3 Open the box lid 4 Switch the light on 5 Frog arm moves out closing the switch 6 Move frog arm back a few degrees 7 Mute off 8 Pause 1.8 seconds to allow time for frog’s voice to play 9 Retract frog arm 10 Switch off light 11 Close box lid Australia’s electronics magazine The third: 1 Open and close box lid twice. Switch light on when lid is open and   off when closed. Open lid 2 Switch the light on 3 Start frog sound 3 4 Frog arm moves out, closing the switch 5 Move frog’s arm back a few degrees 6 Pause 2.5 seconds to allow time for frog’s voice to play 7 Retract frog’s arm 8 Close lid 9 Switch initial frog chirping sound on (1) December 2018  71 1A maximum) may not have sufficient margin for error, particularly when more than one servo is operating. So a 3A diode it is. They’re not that much more expensive than lower-rated diodes. You will note on the circuit diagram that there are actually three 5V power supplies – one to power the servos, one to power the control microprocessor and other ICs and one to power the audio amplifier. The latter is further reduced to 3.3V for the SFX module. It might appear that having three separate 5V supplies is a bit wasteful. But it was done to avoid any power supply noise/feedback caused by the servos operating (they can be fairly noisy electrically!) and affecting the microprocessor circuits and/ or the audio. Besides, 5V regulators are quite cheap! Construction Once again, there are two parts to the project: the control PCB along with its hardware and the sound PCB, most of which is mounted on a second board. For detail of the sound PCB, refer to the articles in the August and September 2018 issues (siliconchip.com. au/Series/325). Most of the construction techniques can be seen from our photographs. While this seemed a sensible approach, no doubt there are many others! We’ve already mentioned the servos and their functions. The rest is basically the electronics assembly, which is quite straightforward, and the dressing of the project. The frog itself We originally purchased a toy frog from a $2 shop but found it too difficult to modify. So instead we made one. (OK, I lie: Mrs Kerr made one – she’s much more adept at the sewing machine than I!). The photos give a good idea of our Froggy – it’s basically a tube of soft green stretch cloth for the body (he needs to be quite flexible when lifted up and down) and a completely separate arm, stiffened by some heavy wire attached to the servo. This arm needs to be quite stiff in order to stay in place and also positively hit that switch. You don’t really 72 Silicon Chip Parts list – Useless Box 1 hinged “jewellery” box, size approximately 200mm x 150mm x 110mm (see text) Control Board 1 double-sided PCB, 96 x 67mm, code 08111181 (from siliconchip.com.au/shop) 1 fabric toy frog (see text) 1 SPDT toggle switch (S1) 2 large servos, ~25kg/cm [eg Turnigy MG959 (Hobby King)] 1 small servo, ~13kg/cm [eg Hobby Tech (Jaycar) YM-2763] 7 2-way PCB mounting terminal blocks 1 3-way PCB mounting terminal blocks 3 3-pin male polarised headers for servos 1 TO-220 mini heatsink [Jaycar HH8502] with M3 6mm screw and nut 1 chassis-mounting DC socket Aluminium brackets (see text) Stiff wire (for mouth - see text) Semiconductors 1 PIC16F88-I/P, programmed with 0811118A.hex (IC1) 1 PIC12F675-I/P, programmed with 0811118B.hex (IC3) 1 OPA2340 or MCP6022 rail-to-rail CMOS op amp (IC2) 2 7805 5V 1A positive voltage regulators (REG1, REG3) 1 LP2950-5.0 5V positive voltage regulator (REG2) 1 BC547 NPN transistor (Q1) 1 1N5404 3A power diode (D1) 4 1N4148 signal diode (D2-D5) 1 5mm high brightness white LED (LED1) NOTE: Where there is a clash of part nos between the control board and the sound board (eg, LED1, IC1, etc), each refers to the part no on its respective PCB. Capacitors 1 1000µF 16V electrolytic 2 470µF 16V electrolytc 2 100µF 16V electrolytic 1 10µF 16V electrolytic 1 10µF 16V NP electrolytic 1 1µF 16V electrolytic 1 1µF 16V multi-layer ceramic 6 100nF MKT or ceramic 1 56nF MKT Resistors (all 1/4W, 1% unless stated otherwise) 1 470k 2 100k 1 22k 2 12k 2 8.2k 2 4.7k 1 1.8k 1 680 1 10k mini horizontal trimpot (VR1) 2 10k 2 2.7k 1/8W if possible Sound Board* (Note: component IDs are from original August 2018 project) 1 double-sided PCB, coded 01107181, 55 x 23.5mm 1 SMD microSD card socket (CON1) [Altronics P5717 or similar] 2 mini SMD two-pin tactile pushbutton switches (S1,S2) (optional) [eg, Switchtech 1107G] 1 5-pin header (CON3) (optional, to program IC1) 1 speaker, size to suit (8 or greater) Semiconductors 1 PIC32MM0256GPM028-I/SS programmed with 0110718A.hex, SSOP-28 (IC1) 1 CS4334 16-bit stereo DAC, SOIC-8 (IC2) * The Sound Board is avail1 IS31AP4991 mono bridged audio amplifier, SOIC-8 (IC3) able as a complete kit (Super Digital SFX Module), 1 MCP1700-3.3 LDO linear regulator, SOT-23 (REG1) containing all parts listed 1 blue SMD LED, 3216/1206 package (LED1) Capacitors (all SMD X7R ceramic, 6V, 2012/0805 size) 3 10µF 7 1µF 16V 1 330pF 1 100pF Resistors (all SMD 1%, 2012/0805 size) 1 270k 1 47k 2 22k 8 1k 1 0 (LK2) here, including pre-programmed IC1 and PCB, but NOT the speaker) from the SILICON CHIP online shop – see www.siliconchip.com. au/shop/20/4658 for more details). SC Australia’s electronics magazine siliconchip.com.au notice that Froggy only has one arm and that it’s not actually attached to the body! Froggy has a separately-made head, made from the same material as the body but is filled with cotton wool to help it keep its shape. The red mouth is sewn in and it holds its shape with two wires. One of these is fixed but the other attaches to the mouth servo so he talks in time with the voice. A pinched nose (“nostrils” sewn together) and a pair of black button eyes fastened through some white discs finish off the design. You’d have to agree that Froggy looks quite . . . froggy! By the way, if you (or the grandkids!) have an aversion to frogs, there are obviously many other cloth toys out there that could be used, or made. Just follow the same principles. Finally, we needed to ensure that the lid stayed closed when the lid servo was not being actuated – and couldn’t be simply lifted up “for a look”! So we made a small bracket to attach the lid to the servo arm to ensure it worked as we wanted it to. Again, this can be clearly seen in the photos. Mounting the PCBs Basically, it’s just a matter of choosing a location which doesn’t interfere with any of the mechanical “works” – the servos which open the lid, operate Froggy’s arm and his mouth. You can get some idea of the way we did it from the photos. Your method may of needs differ depending on any “extras” inside your case – such as a jewel drawer, for instance. We’ll leave that entirely up to you but a bit of experimenting might be needed to find the right positions. E-BIKE BATTERIES can assist you with batteries for e-Bikes – New and Reconditioned For 500W, 1000W & 2000W models. We are specialists in e-Bike battery refurbishment. We can supply new or recell e-Bike batteries with high quality cells – often with higher capacities than the original! Contact Premier Batteries today to find out more. LITHIUM ION AND LITHIUM PHOSPHATE BATTERIES Connecting the PCBs Simply follow the labels on the PCB connectors – they’re quite self-explanatory with one exception: There are two “+5V OUT” terminals (with associated grounds). To avoid any interference between the servos and ICs/audio module, use the upper pair of +5V and GND terminals for the 5V supply to the sound effects PCB. You can ignore the lower 5V and GND terminals along with the 11.4V and its GND terminals – they was provided “just in case” they were needed. There are four other connections to be made between the control board and the Sound Effects board – the “audio in” which feeds the mouth movement circuitry (envelope detector and servo control), along with three diodes. The former is self-explanatory – it is just a suitable length of hookup wire linking the two boards. With any luck, (depending how you mount the two boards) the three diodes can make the connections between the two – otherwise short lengths of hookup wire may be required as well. LED2 on the control board is an ultra-bright white type (the brighter the better). We found this one diode was enough to illuminate the internals when Froggy did his thing. It can be attached to the inside of the lid with glue and the wires hidden in a hole drilled through the case lid. Just remember to leave plenty of slack in the connecting wires (to CON4) to allow the lid to open and close. Light gauge wire should be used so it can easily flex. SC siliconchip.com.au LITHIUM ION PHOSPHATE BATTERIES – ideal for golf carts/buggies and high rate deep cycle applications. With less than half the weight and up to 7 times more charge/discharge cycles than sealed lead acid, lithium ion phosphate natteries offer many advantages including their ability to fast charge and give high rate output without damage! Custom Manufacturer of Battery Packs Made to your specifications Unit 9, 15 Childs Rd, Chipping Norton NSW 2170 Tel: 02 9755 1845 www.premierbatteries.com.au email: malcolmw<at>premierbatteries.com.au Australia’s electronics magazine December 2018  73