Silicon ChipTwo Micropower LED Flasher Modules - October 2016 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: El cheapo electronics modules - the new standard components
  4. Order Form
  5. Feature: China's Gigantic Telescope: Scanning Deepest Space by Ross Tester
  6. Feature: Implantable Medical Devices by Dr David Maddison
  7. Feature: El Cheapo Modules From Asia - Part 1 by Jim Rowe
  8. Project: Lure & Liquidate Lovelorn Zika Virus Mozzies by John Clarke
  9. Subscriptions
  10. Project: A New Transformer For The Currawong Valve Amplifier by Leo Simpson
  11. Project: Touchscreen Appliance Energy Meter, Pt.3 by Jim Rowe & Nicholas Vinen
  12. Project: Two Micropower LED Flasher Modules by John Clarke
  13. Serviceman's Log: How I got trapped inside my MG by Dave Thompson
  14. Project: Voltage/Current Reference With Touchscreen, Pt.1 by Nicholas Vinen
  15. Project: Micromite Plus Explore 100 Module, Pt.2 by Geoff Graham
  16. Vintage Radio: The valve mantel’s last hurrah: Astor’s DLP 2-valve receiver by Ian Batty
  17. Product Showcase
  18. Market Centre
  19. Notes & Errata: Stereo LED Audio Level/VU Meter (June & July 2016); Touchscreen Appliance Energy Meter (August - October 2016)
  20. Advertising Index
  21. Outer Back Cover

This is only a preview of the October 2016 issue of Silicon Chip.

You can view 39 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 "El Cheapo Modules From Asia - Part 1":
  • DS3231-based Real Time Clock & Calendar module with mounting hardware (Component, AUD $6.00)
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 "Lure & Liquidate Lovelorn Zika Virus Mozzies":
  • Mosquito Lure PCB [25110161] (AUD $5.00)
  • PIC12F675-I/P programmed for the Mosquito Lure [2511016A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Mosquito Lure SMD parts: TPA2005D1DGNR (MSOP-8) Class-D 1.45W amplifier IC and microUSB socket (Component, AUD $7.50)
  • Firmware (ASM and HEX) files for the Mosquito Lure [2511016A.HEX] (Software, Free)
  • Mosquito Lure PCB pattern (PDF download) [25110161] (Free)
  • Mosquito Lure trap details, cutting diagrams and panels (PDF download) (Panel Artwork, Free)
Items relevant to "A New Transformer For The Currawong Valve Amplifier":
  • Currawong 2 x 10W Stereo Valve Amplifier main PCB [01111141] (AUD $55.00)
  • Currawong Remote Control PCB [01111144] (AUD $5.00)
  • PIC16F88-I/P programmed for the Currawong Remote Volume Control [0111114A.HEX] (Programmed Microcontroller, AUD $15.00)
  • Front & rear panels for the Currawong 2 x 10W Stereo Valve Amplifier [01111142/3] (PCB, AUD $30.00)
  • Currawong 2 x 10W Stereo Valve Amplifier acrylic top cover (PCB, AUD $30.00)
  • Currawong 2 x 10W Stereo Valve Amplifier top cover cutting diagram (Software, Free)
  • Firmware and source code for the Currawong Remote Volume Control [0111114A.HEX] (Software, Free)
  • Currawong 2 x 10W Stereo Valve Amplifier main PCB pattern [01111141] (Free)
  • Currawong 2 x 10W Stereo Valve Amplifier panel artwork (PDF download) (Free)
Articles in this series:
  • Currawong Stereo Valve Amplifier: A Preview (October 2014)
  • Currawong Stereo Valve Amplifier: A Preview (October 2014)
  • Currawong 2 x 10W Stereo Valve Amplifier, Pt.1 (November 2014)
  • Currawong 2 x 10W Stereo Valve Amplifier, Pt.1 (November 2014)
  • Currawong 2 x 10W Stereo Valve Amplifier, Pt.2 (December 2014)
  • Currawong 2 x 10W Stereo Valve Amplifier, Pt.2 (December 2014)
  • The Currawong 2 x 10W Stereo Valve Amplifier, Pt.3 (January 2015)
  • The Currawong 2 x 10W Stereo Valve Amplifier, Pt.3 (January 2015)
  • Modifying the Currawong Amplifier: Is It Worthwhile? (March 2015)
  • Modifying the Currawong Amplifier: Is It Worthwhile? (March 2015)
  • A New Transformer For The Currawong Valve Amplifier (October 2016)
  • A New Transformer For The Currawong Valve Amplifier (October 2016)
Items relevant to "Touchscreen Appliance Energy Meter, Pt.3":
  • Touchscreen Appliance Energy Meter PCB [04116061 RevI] (AUD $15.00)
  • PIC32MX170F256B-50I/SP programmed for the Micromite-based Touchscreen Energy Meter v1.01 [0411606A.hex] (Programmed Microcontroller, AUD $15.00)
  • CP2102-based USB/TTL serial converter with microUSB socket and 6-pin right-angle header (Component, AUD $5.00)
  • CP2102-based USB/TTL serial converter with microUSB socket and 6-pin right-angle header (clone version) (Component, AUD $3.00)
  • DS3231-based Real Time Clock & Calendar module with mounting hardware (Component, AUD $6.00)
  • ACS718 20A isolated current monitor (Component, AUD $15.00)
  • Firmware (HEX) file and BASIC source code for the Micromite-based Touchscreen Appliance Energy Meter [v1.01] (Software, Free)
  • Touchscreen Appliance Energy Meter PCB pettern (PDF download) [04116061 RevG] (PCB Pattern, Free)
  • Touchscreen Appliance Energy Meter lid panel artwork (PDF download) (Free)
Articles in this series:
  • Touchscreen-Controlled Energy Meter, Pt.1 (August 2016)
  • Touchscreen-Controlled Energy Meter, Pt.1 (August 2016)
  • Touchscreen Appliance Energy Meter, Pt.2 (September 2016)
  • Touchscreen Appliance Energy Meter, Pt.2 (September 2016)
  • Touchscreen Appliance Energy Meter, Pt.3 (October 2016)
  • Touchscreen Appliance Energy Meter, Pt.3 (October 2016)
Items relevant to "Two Micropower LED Flasher Modules":
  • Micropower LED Flasher PCB [16109161] (AUD $5.00)
  • Mini Micropower LED Flasher PCB [16109162] (AUD $2.50)
  • PIC12F675-I/P programmed for the Micropower LED Flasher [1610916A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware (ASM and HEX) files for the Micropower LED Flasher [1610916A.HEX] (Software, Free)
  • Micropower LED Flasher PCB patterns (PDF download) [16109161/2] (Free)
Items relevant to "Voltage/Current Reference With Touchscreen, Pt.1":
  • Touchscreen Voltage/Current Reference PCB [04110161] (AUD $12.50)
  • PIC32MX170F256B-50I/SP programmed for the Micromite-based Touchscreen Voltage/Current Reference v1.00 [0411016A.HEX] (Programmed Microcontroller, AUD $15.00)
  • Short Form Kit for the Touchscreen Voltage/Current Reference (Component, AUD $120.00)
  • Translucent Blue UB1 Lid for the Precision Voltage & Current Reference with Touchscreen Control (PCB, AUD $10.00)
  • Firmware (HEX) file and BASIC source code for the Micromite-based Touchscreen Voltage/Current Reference v1.00 [0411016A.HEX] (Software, Free)
  • Touchscreen Voltage/Current Reference PCB pattern (PDF download) [04110161] (Free)
Articles in this series:
  • Voltage/Current Reference With Touchscreen, Pt.1 (October 2016)
  • Voltage/Current Reference With Touchscreen, Pt.1 (October 2016)
  • Voltage/Current Reference With Touchscreen, Pt.2 (December 2016)
  • Voltage/Current Reference With Touchscreen, Pt.2 (December 2016)
Items relevant to "Micromite Plus Explore 100 Module, Pt.2":
  • Micromite Plus Explore 100 PCB [07109161 RevC] (AUD $15.00)
  • PIC32MX470F512L-120/PF programmed for the Micromite Plus (Programmed Microcontroller, AUD $25.00)
  • CP2102-based USB/TTL serial converter with microUSB socket and 6-pin right-angle header (Component, AUD $5.00)
  • CP2102-based USB/TTL serial converter with microUSB socket and 6-pin right-angle header (clone version) (Component, AUD $3.00)
  • DS3231-based Real Time Clock & Calendar module with mounting hardware (Component, AUD $6.00)
  • MCP120-270GI/TO Supply Supervisor IC (TO-92) (Component, AUD $2.00)
  • Short Form Kit for the Micromite Plus Explore 100 (Component, AUD $75.00)
  • Firmware (HEX) file and documents for the Micromite Mk.2 and Micromite Plus (Software, Free)
  • Micromite Plus Explore 100 PCB pattern (PDF download) [07109161 RevC] (Free)
Articles in this series:
  • Micromite Plus Explore 100 With Touchscreen, Pt.1 (September 2016)
  • Micromite Plus Explore 100 With Touchscreen, Pt.1 (September 2016)
  • Micromite Plus Explore 100 Module, Pt.2 (October 2016)
  • Micromite Plus Explore 100 Module, Pt.2 (October 2016)

Purchase a printed copy of this issue for $10.00.

MICROPOWER LE L ED FLA LASH SHER ER We’ve used flashing LEDs for decades – but alas, the LM3909 Flashing LED IC is no longer available. What to do? By JOHN CLARKE N ow we know that that there are lots of LED flashers available and that you can also obtain LEDs with inbuilt flashing. But we still get regular requests for a LED flasher, to provide similar functions to the now obsolete National Semiconductor LM3909 flasher/oscillator. This new module provides similar functions to the LM3909 but also includes daylight detection with an LDR (light-dependent resistor). Since the LM3909 is no longer available, we have employed a low-cost microcontroller and it drives the LED in a similar way to the National Semiconductor device. To be specific, it charges a capacitor, then “jacks it up” and dumps the charge through the LED to give a much brighter flash than would be possible with the otherwise limited supply voltage. In fact, you cannot normally drive a blue or white LED reliably with a 3V supply – you need to boost the voltage. By the way, this module does not have to be battery powered. You can run it from any fixed supply from 3 to 5V, so you can eliminate the button cell and just connect it to any 5V USB source. Alternatively, you can run it from a much higher DC voltage if you connect a suitable resistor in series with the input. Circuit details The circuit is shown in Fig.1 and uses a PIC12F675 microcontroller, two diodes and several resistors and capacitors. It runs from a lithium button cell, or you could run it from two alkaline AAA cells or a 5V USB supply. LDR1 is used to detect whether the LED Flasher is in daylight or in darkness. This is connected in series with a 470kΩ resistor. In darkness, the LDR resistance is typically well over 1MΩ. When the GP4 output is high (ie, at the positive supply voltage), the 470kΩ resistor pulls the GP2 input sufficiently high for IC1 to detect this as a high level. In daylight, the resistance of LDR1 is around 10kΩ and so GP2’s input is held near to 0V. IC1 detects this as a low and then goes to sleep to conserve power. If the GP2 input is high, indicating Features & Specifications • • • • • • • • • Flashes any colour LED Flash rate set by resistor & capacitor values Optional LDR to disable flash with high ambient light Two PCB versions to suit different applications Small and easy to build Supply voltage range: 3-5.5V or higher with modifications (see text) Fixed flash time: 65ms Standby current: 10µA <at> 5V, 2µA <at> 3V Operating current: typically 0.7-1.6mA (0.5-2Hz) (see Table 1) 62  Silicon Chip that the module is in darkness, the micro provides the LED flasher function, which we will come to in a moment. If the LDR is omitted, this input will always be high and so the flasher will run as long as it has power. The micro has an internal “watchdog” timer and this is used to wake it up every 2.3 seconds so that it can check the voltage level at the GP2 input pin. If it is low, the microcontroller goes back into sleep mode. If it is high, LED flashing is enabled. The Flasher section of the circuit comprises diode D1, capacitor C1, resistors R1 & R2 and LED1. We show its operation in Fig.2 which depicts the two modes of the circuit: charging the capacitor and then jacking it up while dumping its charge through the LED. In the first part of the cycle, the GP5 output (pin 2) is taken high while the GP0 output (pin 7) is held low. In this state, capacitor C1 charges via R1 (6.2kΩ) and diode D1. The charge current path is shown in Fig.2 in green. No current flows through the LED and R2 because this process reverse-biases the LED, as its cathode terminal (labelled K) is held high while the capacitor is charging. During this process, the voltage across C1 is monitored by input pin GP1 (pin 6). The software compensates for the fact that the voltage at this pin is higher than that at the capacitor’s positive terminal due to the forward voltage drop of diode D1. Once the capacitor has charged to the maximum possible level of about 2.2V, the comparator senses this and switches the GP5 output (pin 2) low siliconchip.com.au Fig.1: complete circuit for the LED Flasher. IC1 charges capacitor C1 via pins 2 and 7 and diode D1. C1 is then discharged through LED1 and R2, with a total flash voltage of about 5V when the circuit is powered from a 3V button cell. This is sufficient to allow blue or white LEDs to be used. and the GP0 output (pin 7) high (up towards +3V). This has the effect of “jacking up” the negative side of the charged capacitor by about 2.6V or so, which means that the positive terminal will be at around 5V. This is fed to the LED to give a brief and very bright flash. The LED current path is shown in red in Fig.2. The cycle then restarts, with GP5 and GP0 swapping polarity, so that capacitor C1 can charge up again. Since the timing of this cycle is controlled by the component values, the flash rate is set mainly by the values of C1 and R1 but to a lesser extent, the type of LED and the supply voltage. Table 1 shows typical flash rates and the corresponding component values required for various different LED types. Note that green LEDs require values which are somewhere between those specified for red and blue (depending on the exact construction). To further demonstrate how this process works, see the scope grab, Fig.3, which shows four traces. The top blue trace is the voltage at GP0, pin 7, which is zero most of the time and switches high for about 65 milliseconds. The green trace below is the voltage at GP5, pin 2, which is high most of the time and then drops low during the same 65 millisecond period. The yellow trace shows the voltage at the positive side of capacitor C1. V+ 1 I discharging D1 INTERNAL COMPARATOR 6 A K GP1 C1 100 F (0.718Vcc) IC1 PIC12F675 GP0 7 A + LED1 – K R1 6.2k GP5 2 + I charging As you can see, each time GP5 (green trace) goes high, the capacitor voltage starts to ramp up and after slightly less than one second, when GP5 goes low (stopping the charge) and GP0 flicks high, the capacitor voltage takes a sudden jump up. The capacitor voltage then drops over a period of 65ms as it discharges through the LED and the cycle repeats. The mauve trace is the difference between the voltages at the positive terminal of the capacitor (yellow) and GP5 (green) and it shows a maximum value of 3.6V. This is the effective peak voltage applied to the LED and current limiting resistor R2. Referring back to Table 1, note that the peak current is higher with a lower voltage drop LED (eg, red) compared to a higher voltage drop LED (blue or white). Also be aware that electrolytic capacitors typically have a wide tolerance range of -20% to +100%, so the flash rate may vary from the calcu- R2 100 – 8 Fig.2: the charge and discharge currents for timing/boost capacitor C1. The charge current path is shown in green while the discharge current path is shown in red. Output pins 2 and 7 reverse polarity to switch current flow between the two paths while pin 6 monitors C1’s charge status to determine when to switch between charging and discharging. siliconchip.com.au October 2016  63 Fig.3: scope grab showing the critical voltages. The blue trace is pin 7 (GP0), green trace is pin 2 (GP5), yellow trace is the positive terminal of capacitor C1 while the mauve trace is the voltage across LED1 and R2. This shows a peak value of 3.6V, despite the 3V supply. lated rate, depending on the actual capacitance. Flash brightness can be increased by reducing the value of R2 or using a larger capacitor (up to 470µF) and scaling down R1’s value proportionally. The minimum recommended value for R2 is 100Ω. For example, to flash a blue LED at 1Hz, you could increase C1 to 220µF and reduce R1 to 33kΩ and this will roughly double the LED current (as well as increasing the supply current drawn). Note that the flash rate is inversely proportional to the supply voltage and is about 50% faster at 2V and 22% slower at 5V, compared to 3V. Zener diode ZD1, across IC1’s supply, protects IC1 from reverse supply polarity as it will be forward-biased under this condition. Its typical leak- age current during normal operation with a 3V cell is around 10nA. JP1 functions as an off/switch. ZD1 also provides protection against over-voltage to the microcontroller and it limits the supply to around 5.5V if you are using a much higher DC input voltage together with a series dropping resistor. In that case, the dropping resistor could be installed on the PCB in the place of JP1 (see “Higher supply voltages”). But we are getting a little ahead of ourselves. PCB assembly The LED Flasher is constructed on a PCB coded 16109161, measuring 45 x 47mm. If you wish, the PCB can be clipped into a small UB5 case (83 x 54 x 31mm), although most constructors probably will not bother. Before you start assembling the PCB, you need to select the components required for R1, R2, C1 and the LED colour, eg, red, yellow, blue or white. Table 1 shows typical component values. Fig.4 shows the PCB overlay. Begin construction by installing the resistors, using a multimeter to check the value of each before inserting it into the PCB. Diodes D1 and ZD1 can now be installed, taking care to orient these correctly. The socket for IC1 is then fitted, with the notch towards the top of the board. Install the capacitors and if using a polarised electrolytic for C1, then this must be fitted with the shown polarity, ie, the longer lead inserted through the pad towards the top of the board. Then solder in the 2-way pin header for JP1. The 4-way header is optional and it can provide convenient test points if you want to check the module’s operation or display the various waveforms on a scope. Install the cell holder, if using the 3V lithium cell as the supply. The positive side of the holder must be oriented as shown, to the top of the PCB. If you are not going to use the cell holder, you can install two PC stakes for supply connections instead. Note that there are two 3mm diameter holes in the PCB located where the cell holder would otherwise sit. These are for looping the connecting wires through for stress relief. That’s so the wires do not break off where they connect to the power PC stakes. Alternatively, you can elect to install an SMD mini-USB type B socket on the underside of the PCB (ie, instead of installing the cell holder) for convenient connection to a USB source. LED1 is mounted with the anode “A” oriented as shown and LDR1 can Fig.4 (left): the larger of the two flasher boards. Use this as a guide during assembly and take care with the polarity of IC1, C1, D1 and ZD1. 64  Silicon Chip IC1 PIC12F675 1k POWER ZD1 1F JP1 + Fig.5 (right): fit the components to the smaller flasher board in this manner. Taller passive components such as C1 can be fitted to the bottom of the board and laid over to save space. 5.6V 4148 D1 1nF (R2) (R1) 470k C1 A K LDR1 LED1 siliconchip.com.au Parts List Table 1: LED Flasher Component Selection for 3V Supply LED Colour Supply Current <at>3V Supply Peak LED Flash Current C1 R1 R2 Flash Rate Blue/white 680µA 3.6mA 100µF 15kΩ 330Ω 0.5Hz Blue/white 760µA 3.6mA 100µF 10kΩ 330Ω 0.75Hz Blue/white 830µA 3.6mA 100µF 7.5kΩ 330Ω 1Hz Blue/white 1.0mA 6mA 100µF 7.5kΩ 100Ω 1Hz Blue/white 1.1mA 3.6mA 100µF 3.9kΩ 330Ω 2Hz Red/orange/yellow 750µA 6mA 100µF 12kΩ 330Ω 0.5Hz Red/orange/yellow 860µA 6mA 100µF 8.2kΩ 330Ω 0.75Hz Red/orange/yellow 950µA 6mA 100µF 6.2kΩ 330Ω 1Hz Red/orange/yellow 1.1mA 10mA 100µF 6.2kΩ 100Ω 1Hz Red/orange/yellow 1.6mA 6mA 100µF 2.7kΩ 330Ω 2Hz be installed now as well. Note that if you do not want the circuit to switch off in the day, omit LDR1. If required, the PCB can be used fitted with four 9mm tapped spacers at each corner of the PCB, attached with short M3 machine screws. A pre-programmed PIC12F675-I/P can be purchased from our Online Shop. Alternatively, if you intend to program the PIC yourself, the firmware file (1610916A.HEX) can be downloaded from the SILICON CHIP website. Powering it up Insert IC1 into the socket, making sure it is oriented correctly. Watch out that you don’t bend any pins under the IC. Now install the CR2032 cell in its holder (or apply 3-5V DC) and place the jumper link onto the 2-way header (JPI). If all is well, LED1 will begin to flash. Version 2: a tiny PCB For some applications where you want a tiny flasher module, the PCB with its on-board cell holder will be too large. For example, you might want to install the LED flasher inside an HO/OO model diesel locomotive or inside an HO/OO wagon at the end of a train as a BOG (battery operated guard). For these other applications requir- ing a tiny module, we have produced an alternative PCB which measures only 36 x 13mm and this board is coded 16109162. We could have made it even smaller if we had designed it to use surface-mount devices, but we know that some readers, and particularly model railway enthusiasts, are not keen on soldering SMDs. The same components are installed on the smaller PCB, except that it does not have provision for the button cell holder or optional 4-way pin header. Refer to Fig.5 when building this version. Note that some components could be installed laid over on their side on the bottom of the PCB, to reduce the overall size of the package (eg, C1). Higher supply voltages If you want to run the PCB from more than 5V, you will need to install a suitable dropping resistor across the input link, JP1. For a 12V supply, we suggest a value of 1kΩ with a rating of 1/4W. If you want to run the tiny module in a model railway locomotive or freight wagon as an end-of-train device, you will need to take account of the track polarity. To do this, use a small bridge rectifier from the track (eg, type W01). Its two AC connections go to the track connections inside the loco or wagon and the DC wires go to the appropriate RESISTOR COLOUR CODES No. Value 4-Band Code (1%) 5-Band Code (1%)  1 470kΩ yellow violet yellow brown yellow violet black orange brown  1 1kΩ brown black red brown brown black black brown brown siliconchip.com.au 1 PCB coded 16109161 (45 x 47mm) OR 1 PCB coded 16109162 (36 x 13mm) 1 20mm button cell holder** (Jaycar PH-9238, Altronics S 5056) 1 CR2032 Lithium cell** (3V) 1 SMD mini-USB socket* (CON1) 1 10kΩ light-dependent resistor* (Altronics Z 1621; Jaycar RD-3480) (LDR1) 1 DIL8 IC socket* 4 M3 x 9mm spacers* 4 M3 x 6mm machine screws* 1 2-way pin header, 2.54mm pitch (JP1) 1 jumper shunt for JP1 1 4-way pin header, 2.54mm pitch* 2 PC stakes* * optional component ** not fitted to smaller PCB Semiconductors 1 PIC12F675-I/P programmed with 1610916A.HEX (IC1) 1 1N4148 diode (D1) 1 5.1V or 5.6V zener diode (ZD1) (see text) 1 3mm or 5mm high-brightness LED (LED1) Capacitors 1 100µF 16V electrolytic capacitor^ (C1) 1 1µF multi-layer ceramic 1 1nF 63V or 100V MKT polyester Resistors (0.25W, 1%) 1 470kΩ 1 1kΩ 1 6.2kΩ# 1 330Ω# # change values to vary flash rate and brightness; see text and Table 1 DC input wires on the PCB. Furthermore, to provide for operation when the track is not energised, you could substitute a .047F or 1F 5.5V supercap for the 1µF MMC capacitor on the board. You will likely need to connect it via insulated flying leads. In this case, change ZD1 to a 5.1V type to ensure the supercapacitor can not be charged beyond SC its 5.5V rating. CAPACITOR CODES Value 1µF 1nF µF Value IEC Code EIA Code 1µF 1u0 105 0.001µF 1n 102 October 2016  65