Silicon ChipMusical bicycle horn - February 2022 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Be wary of devices that require apps to work
  4. Mailbag
  5. Subscriptions
  6. Review: Radio Girl by Nicholas Vinen
  7. Feature: All About Batteries – Part 2 by Dr David Maddison
  8. Project: Dual Hybrid Power Supply – Pt1 by Phil Prosser
  9. Feature: Low-noise HF-UHF Amplifiers by Jim Rowe
  10. Project: Fan Controller & Loudspeaker Protector by John Clarke
  11. Product Showcase
  12. Project: Solid-State Tesla Coil by Flavio Spedalieri
  13. Review: TL866II Universal Programmer by Tim Blythman
  14. Project: Remote Gate Controller by Dr Hugo Holden
  15. Serviceman's Log: The accordion job by Dave Thompson
  16. Vintage Radio: Tasma 305 'rat radio' by Fred Lever
  17. PartShop
  18. Circuit Notebook: Resistor-Mite auto-ranging ohmmeter by Gianni Pallotti
  19. Circuit Notebook: Using a capacitive soil moisture meter by Kenneth Horton
  20. Circuit Notebook: Musical bicycle horn by Jotham Gates
  21. Ask Silicon Chip
  22. Market Centre
  23. Advertising Index
  24. Outer Back Cover

This is only a preview of the February 2022 issue of Silicon Chip.

You can view 0 of the 112 pages in the full issue.

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

Articles in this series:
  • All About Batteries - Part 1 (January 2022)
  • All About Batteries – Part 2 (February 2022)
  • All About Batteries, part three (March 2022)
Items relevant to "Dual Hybrid Power Supply – Pt1":
  • Intelligent Dual Hybrid Power Supply PCB set (AUD $25.00)
  • Intelligent Dual Hybrid Power Supply regulator PCB [18107211] (AUD $7.50)
  • Intelligent Dual Hybrid Power Supply front panel control PCB [18107212] (AUD $2.50)
  • PIC32MZ2048EFH064-250I/PT programmed for the Intelligent Dual Hybrid Power Supply [0110619A.HEX] (Programmed Microcontroller, AUD $30.00)
  • 128x64 Blue LCD screen with KS0108-compatible controller (Component, AUD $30.00)
  • Hard-to-get parts for the Intelligent Dual Hybrid Power Supply regulator board (Component, AUD $125.00)
  • Hard-to-get parts for the Intelligent Dual Hybrid Power Supply CPU board (Component, AUD $60.00)
  • LCD panel bezel for the Dual Intelligent Hybrid Power Supply (PCB, AUD $5.00)
  • Intelligent Dual Hybrid Power Supply firmware [0110619A.HEX] (Software, Free)
  • Intelligent Dual Hybrid Power Supply PCB patterns [18107211/2] (Free)
  • DSP Active Crossover/DDS/Reflow Oven PCB patterns (PDF download) [01106191-6] (AUD $3.00)
Articles in this series:
  • Dual Hybrid Power Supply – Pt1 (February 2022)
  • Dual Hybrid Power Supply, part two (March 2022)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 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 4 (February 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 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 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 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 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: 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, Part 2 (June 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: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
Items relevant to "Fan Controller & Loudspeaker Protector":
  • 500W Amplifier Module PCB [01107021 RevD] (AUD $25.00)
  • Hard-to-get parts for the 500W Amplifier (Component, AUD $200.00)
  • 500W Amplifier Module PCB pattern (PDF download) [01107021] (Free)
  • Cooling Fan Controller & Loudspeaker Protector PCB [01102221] (AUD $5.00)
  • PIC16F1459-I/P programmed for the Cooling Fan Controller & Loudspeaker Protector [0110222A.HEX] (Programmed Microcontroller, AUD $10.00)
  • 4-pin PWM fan header (Component, AUD $1.00)
  • Cooling Fan Controller & Loudspeaker Protector firmware [0110222A.HEX] (Software, Free)
  • Cooling Fan Controller & Loudspeaker Protector PCB pattern (PDF download) [01111211] (Free)
Articles in this series:
  • Fan Controller & Loudspeaker Protector (February 2022)
  • Amplifier Clipping Indicator (March 2022)
  • 500W Power Amplifier, Part 1 (April 2022)
  • 500W Power Amplifier, Part Two (May 2022)
Items relevant to "Solid-State Tesla Coil":
  • Solid State Tesla Coil driver PCBs [26102221-2] (AUD $7.50)
  • Solid State Tesla Coil driver PCB patterns (PDF download) [26102221-2] (Free)
  • Solid State Tesla Coil main driver PCB [26102221] (Source component, AUD $5.00)
Items relevant to "Remote Gate Controller":
  • Driveway Gate Controller PCB [11009121] (AUD $20.00)
  • Remote Gate Controller PCB pattern (PDF download) [11009121] (Free)
Items relevant to "Resistor-Mite auto-ranging ohmmeter":
  • Firmware and Gerber files for the Resistor-Mite ohmmeter (Software, Free)
Items relevant to "Using a capacitive soil moisture meter":
  • Firmware and 3D models for the capacitive soil moisture meter (Software, Free)
Items relevant to "Musical bicycle horn":
  • Firmware, PCB design and 3D models for the musical bike horn (Software, Free)
Videos relevant to "Musical bicycle horn":
  • Bike Horn

Purchase a printed copy of this issue for $11.50.

100-120W resistor. The backlight takes a significant proportion of the overall current, thus this range of values is a compromise between display readability and battery life. In an indoor setting, this value could be increased significantly. To fit the probe into the 3D printed case, I desoldered the plug and soldered wires directly to the probe. I then fixed it to the case using hot melt glue. On the first prototype (pictured), the probe was mounted component side down, but the case is now designed for the opposite orientation. On the two prototypes, the start pushbutton was protected from moisture by repurposing a section of the rubber overlay from a multi-button keypad. Software & calibration The ST7735 LCD display driver was written and is maintained by Peter Mather on The Back Shed forum. This must be loaded into the Micromite first, then saved as a library. To do this, load “moisturelib.bas” into Musical bicycle horn Human powered vehicle racing in Australia generally requires an “electronic warning device” to be fitted to each vehicle to be used when overtaking. Usually, a piezo siren is used, but those are boring! This design uses a piezo siren to play simple tunes, and with the right software, it can also act as a very loud MIDI synthesiser. The horn is powered by two AAA cells and is controlled by an Arduino Nano. Its circuit is shown in Fig.1. Sound is generated by a piezo transducer salvaged from an old smoke alarm. In general, the older the smoke alarm, the larger the piezo diameter siliconchip.com.au the Micromite and then type “library save”. Next, load “moisture.bas”. The Micromite will need to be reset before the first time it is run so the display driver is initialised. After that, the software will run automatically. Calibration is straightforward. Short the pins of CON5, then press the start button until the display says “Reset”, then release it. Remove the short from CON5, then power the unit up with a completely dry probe. Wait until the display switches off, then submerge the probe in water and power it back up again. Keep it submerged until it switches off. The prototype is housed in a custom 3D-printed case. The STL files and Micromite BASIC software code are available to download: siliconchip. com.au/Shop/6/6232 Editor’s note: a BC547 can be used for Q1 and a BC639 for Q2 if you have trouble finding the recommended ones. Kenneth Horton, Woolston, UK. ($120) The moisture meter in its 3D-printed case. Once calibrated, the unit displays the moisture content of the soil that the probe is inserted into as soon as the start button (on top) is pressed. It will then automatically switch off after eight seconds. and thus lower the resonant frequency, hence better performance for lower notes. The best transducers are separate from the smoke alarm case so that a separate resonance chamber does not need to be created. To generate a high voltage for the piezo to be loud enough, a two-stage system is used. One stage boosts the battery voltage to an intermediate level, and the second stage drives the transducer. This is inspired by but implemented differently from the Hornit bike horn. The first stage uses a PWM signal generated by the Arduino to switch Q1 on and off at 62.5kHz, drawing current through L1 so that when Q1 is switched off, the voltage across Q1 rises above the supply voltage. This forward-biases diode D1 and charges the 47μF capacitor. As there is no feedback, zener diode ZD1 clamps the maximum voltage to 22V for safety. The second stage consists of autotransformer L2, designed for piezo sirens and some smoke alarms, pulsed by Q2 to generate each note. The autotransformer has an approximate inductance of 3mH on the primary and 90mH on the secondary, and produces over 100V peak-to-peak for driving the transducer depending on the frequency. The autotransformer is the hardest part to source. I found the easiest Australia's electronics magazine February 2022  105 Fig.1 method of obtaining one was to buy a small piezo siren such as Jaycar LA5141 and disassemble it. The smoke alarm the piezo transducer was salvaged from may also have one. Two buttons are connected to header CON2, one for making the horn go off and one for changing the tune that is played. A double-throw momentary centre-off switch could also be used. LED1 indicates the status. The microcontroller spends most of its time in power-down mode, using virtually no power, waking only when a button triggers an interrupt or the chip is reset. A couple of modifications need to be made to the Arduino Nano to reduce the power requirements and avoid charging the batteries when plugged into a computer. Fig.2 shows the changes on the circuit of a standard Nano. 106 Silicon Chip The modifications involve disconnecting the positive USB power rail from the ATmega328P and removing unnecessary components that use power. This means removing the diode between the USB +5V rail and the 5V rail, cutting a track to disconnect the 5V pin of the CH340 USB to serial converter, adding a wire to connect the 5V pin of the CH340 to the USB +5V rail and removing the RX, TX and power LEDs. I also removed the built-in voltage regulator for good measure. The brownout detection fuses on the ATmega328P need to be changed to reset the microcontroller at 1.8V instead of the default 2.7V, so that it will operate reliably with partially discharged cells. To do this, the extended fuse needs to be set to 0xFE from its default value of 0xFD. You need an external Atmel programmer to do this, Australia's electronics magazine although you can use another Arduino. See these links: siliconchip.com.au/link/abb2 siliconchip.com.au/link/abb3 siliconchip.com.au/link/abaw I have designed a PCB for the horn. It is single-sided and has fairly generous tolerances for home manufacturing, although wire links are needed if two layers aren’t available. I also designed a 3D-printed case to house the unit. It might need to be modified to suit your piezo siren. The software, PCB patterns and 3D printer STL files can be downloaded from the GitHub link below. The battery and PCB are screwed to a tray that can be slid in and out of the housing for access when the front is removed. The USB connector of the Arduino, LED and button connector are accessible from the back. As the unit isn’t fully waterproof, I siliconchip.com.au Fig.2 recommend that the circuit board be conformally coated to protect against moisture. Large components such as the autotransformer and capacitors should be glued down for vibration resistance. Optimising the volume I noticed that the volume was unpredictable for each note. To get the best performance, I wrote a Python script and corresponding Arduino sketch to try many different duty cycles. When left with a computer with a microphone in a quiet room, the computer will measure which parameters give the loudest results. After a bit of cleaning up, the program will produce code that can be pasted into the main BikeHorn sketch. See the Tuning subfolder in the source siliconchip.com.au code for more information on this. Generating & uploading tunes I wrote a plugin for the sheet music editing software Musescore3 that can take suitable sheet music and MIDI files and generate an array that can be copied and pasted into the sketch. Note that the “Loop endlessly” checkbox should be ticked and musical rests at the start and end of the tune removed for continuous operation. See the Musescore Plugin page, which can be found at https://github. com/jgOhYeah/TunePlayer Tunes need to be pasted into tunes.h in the main BikeHorn sketch and the tune’s name included in the array at the bottom of the file. The Arduino IDE can be used to upload the sketch to the Arduino. Australia's electronics magazine If the ‘change tune’ button is pressed on resetting the microcontroller, the Arduino will go into MIDI synthesiser mode. This listens for MIDI messages on the serial port and attempts to play them. It can only play one note at a time, though, and by default, it listens on MIDI channel 1. On the computer side, a program such as Hairless MIDI Serial is suitable. Turning the MIDI to serial bridge on in Hairless MIDI Serial is enough to reset the microcontroller without taking the siren apart. You can find source code and related files for this project at https://github. com/jgOhYeah/BikeHorn and a video of it in operation at siliconchip.com. au/Videos/Bike+Horn Jotham Gates, Notting Hill, Vic. ($150) February 2022  107