Silicon ChipUltra-low-voltage Versatile LED Flasher - February 2017 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Where does innovation come from?
  4. Feature: Autonomous Flying Cars: your next mode of transport? by Ross Tester
  5. Feature: Getting Started with the Micromite by Geoff Graham
  6. PartShop
  7. Project: GPS-synchronised Analog Clock Driver by John Clarke
  8. Project: Ultra-low-voltage Versatile LED Flasher by Nicholas Vinen
  9. Subscriptions
  10. Project: El Cheapo Modules from Asia - Part 4 by Jim Rowe
  11. Serviceman's Log: Snoring through the night by Dave Thompson
  12. Project: High Power DC Motor Speed Control – Part 2 by Design by John Clarke
  13. Project: New SC200 Audio Amplifier – Part 2 by Nicholas Vinen
  14. Feature: First look: Aussie-made battery soldering iron by Ross Tester
  15. Vintage Radio: Hotpoint Model P64MEX 4-valve by Associate Professor Graham Parslow
  16. Feature: First look: Icom’s VE-PG3 Radio over IP Gateway by Ross Tester
  17. Market Centre
  18. Advertising Index
  19. Notes & Errata: High Power DC Motor Speed Control, Jan-Feb 2017
  20. Outer Back Cover

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

You can view 44 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.

Articles in this series:
  • Getting Started with the Micromite (February 2017)
  • Getting Started with the Micromite (February 2017)
  • Getting Started with the Micromite, Part Two (March 2017)
  • Getting Started with the Micromite, Part Two (March 2017)
  • Micromite Tutorial, Part 3: strings and arrays (May 2017)
  • Micromite Tutorial, Part 3: strings and arrays (May 2017)
  • Getting Started with the Micromite, Part 4 (June 2017)
  • Getting Started with the Micromite, Part 4 (June 2017)
Items relevant to "GPS-synchronised Analog Clock Driver":
  • GPS-synchronised Analog Clock Driver PCB [04202171] (AUD $10.00)
  • PIC16LF88-I/P programmed for the GPS-Synchronised Analog Clock for movements with stepping hands [04120217A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16LF88-I/P programmed for the GPS-Synchronised Analog Clock for movements with sweep hands [04130217A.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)
  • VK2828U7G5LF TTL GPS/GLONASS/GALILEO module with antenna and cable (Component, AUD $25.00)
  • CP2102-based USB/TTL serial converter with microUSB socket and 6-pin right-angle header (clone version) (Component, AUD $3.00)
  • Firmware (C and HEX) files for the GPS-synchronised Analog Clock [04120217A.HEX/04130217A.HEX] (Software, Free)
  • GPS-synchronised Analog Clock Driver PCB pattern (PDF download) [04202171] (Free)
Items relevant to "Ultra-low-voltage Versatile LED Flasher":
  • Ultra-low-voltage Versatile LED Flasher PCB [16110161] (AUD $2.50)
  • Ultra Low Voltage Bright LED flasher kit (Component, AUD $17.50)
  • Ultra-low-voltage Versatile LED Flasher PCB pattern (PDF download) [16110161] (Free)
Items relevant to "El Cheapo Modules from Asia - Part 4":
  • DHT22/AM2302 Compatible Temperature and Humidity sensor module (Component, AUD $9.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 "High Power DC Motor Speed Control – Part 2":
  • High Power DC Motor Speed Control main PCB [11112161] (AUD $10.00)
  • High Power DC Motor Speed Control Mosfet PCB [11112162] (AUD $12.50)
  • PIC16F88-I/P programmed for the High Power DC Motor Speed Controller [1111216A.HEX] (Programmed Microcontroller, AUD $15.00)
  • Hard-to-get parts for the High Power DC Motor Speed Controller (Component, AUD $50.00)
  • Firmware (ASM and HEX) files for the High Power DC Motor Speed Control [1111216A.HEX] (Software, Free)
  • High Power DC Motor Speed Control PCB patterns (PDF download) [11112161/2] (Free)
Articles in this series:
  • High Power DC Motor Speed Control (January 2017)
  • High Power DC Motor Speed Control (January 2017)
  • High Power DC Motor Speed Control – Part 2 (February 2017)
  • High Power DC Motor Speed Control – Part 2 (February 2017)
Items relevant to "New SC200 Audio Amplifier – Part 2":
  • Ultra-LD Mk3/Mk4 Amplifier Power Supply PCB [01109111] (AUD $15.00)
  • New SC200 Audio Amplifier PCB [01108161] (AUD $10.00)
  • Hard-to-get parts for the SC200 Audio Amplifier Module (Component, AUD $50.00)
  • New SC200 Audio Amplifier PCB pattern (PDF download) [01108161] (Free)
Articles in this series:
  • New SC200 Audio Amplifier (January 2017)
  • New SC200 Audio Amplifier (January 2017)
  • New SC200 Audio Amplifier – Part 2 (February 2017)
  • New SC200 Audio Amplifier – Part 2 (February 2017)
  • New SC200 Audio Amplifier - Part 3 (March 2017)
  • New SC200 Audio Amplifier - Part 3 (March 2017)

Purchase a printed copy of this issue for $10.00.

Ultra Low Voltage Mini LED Flasher by NICHOLAS VINEN This versatile design uses just a handful of components to flash any colour LED brightly and it can be powered from a single Alkaline cell. In fact, it will run off any supply from 0.8V to 3.3V and consumes very little power when the LED is off. It’s built on a tiny board, so it will fit just about anywhere and incorporates ambient light monitoring to switch the LED off during the day. W e have presented simple LED flashers in the past but this one is a little different. While it uses just a handful of parts, it’s able to drive the LED with a current of up to 50mA, to provide a very bright flash, even when running from a 1.5V cell. The complete module is just 15 x 19 x 4mm, so it can fit inside toy cars, model railway locomotives and other tight spots. The LED current is set by a resistor and the maximum setting produces an almost blinding flash when used with a high-brightness LED. But it consumes just a few microamps the rest of the time for a low average current draw and thus excellent battery life. It also incorporates a feature we previously introduced in a recent LED flasher design, an optional light-dependent resistor (LDR) which turns the flasher off during the day or when bright indoor lighting is switched on, to avoid wasting energy and thus further extend battery life. While this design does rely on a few small SMDs to build such a compact module, they are not especially difficult to solder and do not require any special tools. You just need a temperature-controlled soldering iron, flux paste, solder wick, magnifying lamp (or equivalent) and reasonably steady hands. And although the ICs are relatively Features & Specifications Supply voltage: 0.8 – 3.3V LED current: 12mA as presented; can be set to 1-50mA Supply current: 4mA average as presented, 50mA peak (8% duty cycle) Standby current: ~20µA average when not flashing Battery life: ~10 days with button cell; ~25 days with alkaline AAA; 50+ days with alkaline AA (10 hours flashing per day) LED driving efficiency: ~60% LED forward voltage: 1-3.6V LED flash rate: 0.1-10Hz, as set by C1; increases by up to 50% with reduced supply voltage LED duty cycle: 8% as presented; can be set to 1%-25% by changing R2 Size and weight (not including cell/battery): 15 x 19 x 4mm, <5g 40  Silicon Chip specialised, they are not expensive nor difficult to get. We will be offering a kit for this project which includes the PCB and most of the parts, to save readers the hassle of gathering them. But before we get into the construction, let’s look at how it works. Circuit description The complete circuit is shown in Fig.1 and consists of two main parts, an oscillator which determines the LED flash frequency and duty cycle (at lower left) and the switchmode regulator in the middle, which boosts the supply voltage up to that required to run the LED, and regulates the current through it. Let’s look at the oscillator first. This is based around IC1, an SN74AUP1G14DBVR schmitt trigger inverter. The part number is a mouthful but you may notice the 74 and the 14 in there, indicating that it’s similar to a 74HC14 IC, but with just a single inverter instead of six. It’s designed to run from between 0.8V and 3.6V and has a static current drain of less than 1µA, although its dynamic power consumption in this circuit is higher with the current at around 10µA. This needs to be relatively low as the oscillator is constantly powered from the unregulated supply (typically a single cell at around 1-1.5V). siliconchip.com.au POWER L1 4.7µH K 2 4.7µF 6 Vin SW Vout 5 A C1 1µF 2 IC1 SN74AUP1G14 5 330kΩ 4 REG1 MCP1640 3 3 100kΩ R2 10MΩ D1 BAT54 LDR1 λ EN GND K A A 1 CON1 ZD1 LED CATHODE BAND 1 K ZD1 λ LED1 VFB 5.6V K 4 2 A 4.7µF R1 100Ω BAT54 K A K NC A MCP1640 SN74AUP1G14 5 SC  2017 MICROPOWER LED FLASHER 1 2 3 6 5 4 1 4 2 3 Fig.1: complete circuit for the Micropower LED Flasher. The circuit is based around an SN74 schmitt trigger inverter (IC1) and an MCP1640 low voltage boost regulator (REG1) with an integrated load disconnect switch. It oscillates due to positive feedback from its output to its input, mainly via the 10MW resistor and the rate of oscillation is determined by this in combination with C1, which forms an RC low-pass filter. When IC1’s output is high, C1 discharges (ie, the voltage at pin 2 increases) until the voltage at pin 2 reaches its positive-going threshold and output pin 4 goes low. C1 then charges through the 10MW resistor until the pin 2 voltage reaches the negativegoing threshold and the output at pin 4 switches high again. The difference between the two thresholds is known as the hysteresis voltage and for IC1 this can be calculated as 70mV + (VCC – 0.8) ÷ 3. Unfortunately, since the hysteresis varies with VCC, the frequency will increase as the supply voltage drops (eg, due to the cell discharging). To give an idea of the magnitude of the effect, if the flash rate is 1Hz at 1.5V, it will be around 1.5Hz at 1V. Schottky diode D1 and its series 100kW resistor (R2) change the duty cycle of the square wave at pin 4 of IC1. Normally it would be close to 50% but this would result in visibly long LED flashes and waste power. When pin 4 goes high, D1 is forward-biased, so C1 discharges via R2, speeding up its discharge rate and thus reducing the time that pin 4 is high. The values shown set the duty cycle to around 8%. You might think it would be 1% but remember that D1’s forward voltage is a significant fraction siliconchip.com.au of the supply voltage. Despite this low duty cycle, the LED flashes appear very bright on our prototype. The opposite end of timing capacitor C1 is connected to the positive power rail so that input pin 2 of IC1 is initially high and thus its output is low and the boost regulator (REG1) and LED1 are disabled. C1 needs a couple of seconds to charge before the oscillator begins to operate and it’s best for REG1 to be off during this time. The oscillator output at pin 4 of IC1 goes through a voltage divider consisting of a 330kW fixed resistor and the LDR, which has a dark resistance in excess of 1MW and a light resistance below 50kW. Thus, in the dark, when the output of IC1 is high, the voltage applied to pin 3 of REG1 is close to VCC, since the resistance in the bottom leg of the divider is so high. But in relatively bright light, the ~50kW resistance of the LDR shunts most of the current from the output of IC1, reducing the voltage at pin 3 of REG1 by 0.3V and this is insufficient to switch REG1 on. So if the ambient light level is high, REG1 is off and the LED won’t flash. The only power consumption in this condition is that of IC1, the current required to charge/discharge C1 and the current through the 330kW/ LDR divider, which only flows when the output of IC1 is high. This averages to around 20µA (see Fig.6). Note that if you want the LED to flash constantly, all you need to do is omit the LDR so that the output of IC1 reaches REG1 without attenuation. When pin 3 of REG1 is high, the IC is enabled. REG1 is a somewhat unusual boost regulator in that when it is disabled, the current path from input to output is cut off entirely. This is very useful since otherwise the supply voltage may be high enough to cause the LED to light even when it should be off. But REG1’s internal switch ensures that there is no path for current to flow even so. Fig.2 shows the internal block diagram of the MCP1640 boost regulator. In brief, what it does is pulse pin VOUT (PIN 5) VIN (PIN 6) Direction Control SW (PIN 1) EN (PIN 3) Fig.2: internal block diagram of the MCP1640 boost regulator (REG1). Once the voltage at pin 1 (SW) rises above that at pin 5 (VOUT), the top transistor in REG1 switches on to allow current to flow from pin 1 to 5. This charges the external capacitor at pin 5. The other internal transistor (an N-channel Mosfet) pulls pin 1 low, in order to charge the external inductor which provides the voltage boost. Internal Bias IZERO ILIMIT Gate Drive and Shutdown Control Logic ISENSE GND (PIN 2) Oscillator Slope Compensation ∑ PWM/PFM Logic 1.21V VFB (PIN 4) February 2017  41 Fig.3: there is enough light on the LDR to attenuate the Fig.4: shows the same traces as Fig.3 except the LDR is output of pin 4 to a low voltage; thus REG1 is not triggering. shaded from light so that the enable pulses reach REG1. The The yellow trace is pin 2 of IC1 while green is at pin 4. blue trace is pin 1 of REG1 while pink is at LED1's anode. 1 (SW) low at a frequency of around 500kHz with a controlled duty cycle, so that the interruption of current through inductor L1 causes an increase in the voltage at this pin, compared to the input at pin 6. Current then flows from L1 through REG1 and out of pin 5, charging the 4.7µF output capacitor and also driving current through LED1. The current through LED1 and R1 rises until it reaches approximately 12mA, at which point the voltage across R1 reaches about 1.21V. At this point, REG1 throttles back the duty cycle of its internal switch to maintain this current level. This continues until the pin 3 enable (EN) input goes low and the 4.7µF output capacitor discharges through LED1 and R1. In more detail, when REG1’s internal transistor from pin 1 to pin 2 (ground) is switched on, current starts to flow through SMD inductor L1, increasing in a smooth manner. As the current increases, L1's magnetic field charges up. When this internal switch turns off, L1’s magnetic field continues to drive current from the supply at pin 6 through to pin 1. As a result, the voltage at pin 1 rises. Once the voltage at pin 1 rises above that at VOUT (pin 5), the other transistor in REG1 switches on to allow current to flow from pin 1 to pin 5. This charges up the 4.7µF capacitor from pin 5 to ground and, depending on whether the voltage is sufficient to cause LED1 to conduct, some or all of this current causes it to light up. Note that should the supply voltage be more than 1.21V above the forward voltage of LED1, the current flow will be higher than intended. However, R1 will still limit this current, albeit at a higher level. But even with a very low forward voltage for LED1 at around 1.8V, you would need a supply of over 3.01V (1.8V + 1.21V) for this to happen and then the increase in current would be minor; no more than a few milliamps. Because REG1's feedback is set up to regulate the current through LED1, the voltage supplied to LED1's anode pin Fig.5: is the same as Fig.4 except over a shorter timebase, letting you easily see the switching of REG1 (blue) in detail, which has a switching frequency of 485kHz in this case. 42  Silicon Chip will automatically be adjusted to take into account its forward operating voltage, which will depend on its colour. For example, blue LEDs normally have a forward voltage of at least 3V while red LEDs will often operate below 2V. REG1 will simply supply more voltage to a blue LED than a red one, in order to achieve the pre-set current flow. However, were LED1 to become disconnected (eg, due to an intermittent section of wire, a bad solder joint or if it fails), because no current could flow through R1, the output voltage could increase to an unsafe level, possibly damaging REG1 or other components. To avoid this, we've included zener diode ZD1. Should the output voltage exceed 6.81V (5.6V for ZD1 plus 1.21V at pin 4 of REG1), ZD1 will conduct and prevent REG1's output from rising any higher until the connection for LED1 is fixed. Operating waveforms The scope grabs of Figs.3-6 show the Fig.6: shows the measured current draw from one AAA cell while there was enough light on the LDR to prevent the LED from flashing. siliconchip.com.au operation of the flasher running from a single AAA cell. In each case, the yellow trace shows the voltage at pin 2 of IC1, depicting the charging and discharging of timing capacitor C1. The green trace shows the voltage at pin 4 of IC1, the pulses which enable REG1 when the LDR is in darkness and also determine the length of the LED flash. The blue trace shows the voltage at pin 1 of REG1, the switch terminal, while the pink trace shows the voltage at the anode of LED1. In Fig.3, there is enough light on the LDR to attenuate the output of pin 4 to a low voltage and thus REG1 is not being triggered. You can see the charge/ discharge sawtooth ramp of the timing capacitor at top and the resulting trigger pulses below. The frequency read-out is 900mHz, ie, just a little less than 1Hz (with a 1µF timing capacitor) and the amplitude of the sawtooth waveform can be seen to be 520mV, around ⅓ of the 1.5V supply voltage. Fig.4 shows the exact same traces but this time, the LDR is shaded so that the enable pulses reach REG1. You can see that the frequency has increased slightly, to 1.04Hz, due to the slight drop in cell voltage from the extra current drain and also, to some extent, due to the noise from REG1 affecting the operation of IC1. You can also now see some evidence of the switching output of the boost operator in the blue trace (although note that, due to the high frequency, the scope is underestimating its amplitude) and the 4.45V now being applied to the LED anode in ~60ms bursts. Fig.5 is similar to Fig.4 but with a shorter timebase so you can better see the operation of REG1 in detail. The switching frequency is 485kHz and you can see how pin 1 of REG1 is pulled to 0V briefly, after which it shoots up to over 4V, before dropping down to 0V as the energy in L1 is exhausted. It then sits at around 1.5V (ie, the supply voltage) while D1 is reverse-biased before being pulled low again for the next cycle. Fig.6 shows the measured current from the AAA cell while there was sufficient light on the LDR to prevent the LED from flashing. We connected a 1:1 scope probe across a 100W shunt resistor placed in series with the cell and set the scope to measure in microamps. We then used its measurement facility to average the result. Note that there’s a significant DC offset of 5.4µA in the measurement which you have to subtract to get an accurate reading and note also how the current draw changes during the oscillator cycle and spikes when the oscillator output is briefly high. Component value selection Using the values shown will give a flash rate of around 1Hz at 1.5V and a peak LED current of around 12mA. If you want a slower flash rate, simply increase the value of C1, eg, 2.2µF will result in around 2.2s between flashes (0.45Hz); 470nF will give around 0.5s between flashes (2Hz), etc. If you need a rate that’s between those that are easy to achieve with preferred values, you can quite easily parallel two SMD ceramic capacitors by soldering one on top of the other. It’s best to use X5R (±20%) or X7R (±10%) capacitors for C1 to avoid too much variation with temperature, but Fig.7 (right): overlay diagram for the LED Flasher which is built on a 15 x 19mm PCB. This makes it easy to fit in a model train or toy car. When building the Flasher, it's best to use an X5R (±20%) or X7R (±10%) capacitor for C1 as its value won't drift as much due to changes in temperature. TO BATTERY 0.85-3.3V NOTE: PCB IS SHOWN TWICE ACTUAL SIZE GND ZD1 R1 5.6V + 100Ω C1 100kΩ 1µF 10MΩ IC1 330kΩ siliconchip.com.au LED1 A K D1 BAT54 1 4.7µF 4.7µF L1 MCP1640 remember that regardless of the accuracy of C1, it will vary somewhat with supply voltage and you may need to experiment with capacitance if you want a particular rate. Setting the peak LED current is easy; simply select R1 = 1.21V ÷ (current in amps). So for example, if you want to set it at 5mA (which will still be quite bright), use 1.21 ÷ 0.005 = 242W or the nearest value, in this case, 240W. Keep in mind that the current drawn from the supply is substantially higher than this programmed current due to the fact that the supply voltage is normally considerably lower than that required to drive the LED, and due to limited efficiency. For example, on our prototype we measured a peak draw of around 50mA from the 1.5V (nominal) cell when LED1 was receiving 12mA, with its anode at around 4.6V. Of course, the battery only has to supply this 50mA for the 8% or so of the time that LED1 is lit. The average battery drain can be reduced by lowering the duty cycle. To do this, reduce the value of R2, to as low as 15kW which should give a duty cycle of around 1%. Likewise, the value of R2 can be increased, up to about 2.2MW, for a duty cycle of up to around 25%. Power supply You can use one or two AA or AAA cells, a 3V Lithium button cell or a 3.3V regulated supply. Keep in mind that the relatively high internal resistance of a button cells places an upper limit on how much current the circuit can reasonably draw, so we recommend increasing the value of R1 and possibly lowering the value of R2 for LDR1, which is optional, can either be soldered to the board as shown at the bottom of the PCB, or attached via flying leads. 1 4.7µH REG1 LDR1 February 2017  43 reasonable performance and battery life if using a button cell. Construction The LED Flasher is built on a tiny double-sided PCB measuring just 15 x 19mm. That makes it easy to fit inside something like a model railway carriage or toy car, especially since it can be run from a single AAA cell. The PCB is coded 16110161 and carries 12 SMD components plus the LED, optional LDR and power supply header/wires. The overlay diagram, shown twice actual size, is shown in Fig.7. None of the components are overly difficult to solder but IC1 and REG1 have the closest pin spacings. Start with REG1. This has six pins, three on each side, so you will have to examine it with a magnifying glass under good light to find the printed dot which indicates its pin 1. Orientate REG1 so that pin 1 is closest to L1, ie, on the side nearest to the LDR mounting pads. Melt a small amount of solder on one of the pads for REG1, then carefully slide it into place while heating the solder on that pad. Check its orientation with a magnifier and if necessary, re-melt that solder and gently nudge the component until all six leads are positioned properly above their pads. Now solder the pins on the opposite side of the one you tack-soldered, then go back and solder the three on the other side (refresh the solder on that initial pin). The solder will flow more easily if you spread a little flux paste over the pins of the IC. Since they are so close together, when you solder them, there is a high chance that the solder will bridge the pins. This can be cleaned up by adding a little flux paste and then applying some solder wick and a hot soldering iron. It should suck the excess solder right off the pins once it reaches the right temperature. You can then slide the solder wick away from the part and remove the soldering iron. Clean off with methylated spirits, isopropyl alcohol or flux cleaner and then check carefully with a magnifier that all the joints are good and there are no bridges. You can then move on to soldering IC1 using a similar technique. Its orientation should be obvious since it has two pins on one side and three on the other. You will find soldering 44  Silicon Chip Parts List 1 double-sided PCB, coded 16110161, 15 x 19mm 1 4.7µH 100mA+ inductor, size 3226/3216 (imperial 1210/1206) (eg, Taiyo Yuden CBC3225T4R7MR or BRL3225T4R7M) 1 LDR, dark resistance >1MW (eg, GL5528) (optional) 1 2-way pin header with plug or light duty twin lead 1 1.2-3.3V (nominal) battery or DC power supply Semiconductors 1 SN74AUP1G14DBVR schmitt trigger inverter, SOT-23-5 (IC1) 1 MCP1640T-I/CHY* synchronous boost regulator, SOT-23-6 (REG1) 1 high-brightness LED, size and colour to suit application; 3mm and 5mm through-hole types are suitable (LED1) 1 5.6V SMD zener diode, SOT-23 (ZD1) 1 BAT54 SMD schottky diode, SOT-23 (D1) Capacitors 2 4.7µF 10V X5R SMD size 2012/1608 (imperial 0805/0603) 1 1µF** 6.3V X5R/X7R SMD size 2012/1608 (imperial 0805/0603) (C1) Resistors (all 1% 1/4W SMD size 2012 or 1608 [imperial 0805/0603]) 1 10MW 1 330kW 1 100kW# 1 100W * do not use MCP1640B, MCP1640C or MCP1640D ** increase value for lower flash rate or reduce for faster rate # increase value for longer flash period or reduce for shorter period Note: a kit of parts is available for this project from the Silicon Chip Online Shop and that includes the PCB and all SMDs, including a few extras to allow you to alter the flash rate and duration. A blue high-brightness LED and a suitable LDR are also included but no battery or power supply connector/wiring. the side with the two pins easier due to the increased spacing. With that in place, soldering the remaining SMDs should be quite easy. Don’t get ZD1 and D1 mixed up as the packages look very similar. It will take a little more time to form the solder joints for L1 than the resistors and capacitors due to its larger size but the passive components can all be soldered using a similar technique as for the semiconductors. LED1 can either be mounted on the board or via flying leads, depending on what’s more convenient. Just make sure to get the anode and cathode the right way around. It can be a 3mm or 5mm LED or even a 2012/0805 SMD LED soldered directly across the pads, if that suits you. LDR1 can also be soldered to the board or attached via flying leads. It’s located at the opposite end of the board from LED1 to prevent optical feedback from causing LED1 to flicker, however, you can probably get away with mounting them in reasonable proxim- ity if necessary, as long as they don’t face each other. As mentioned earlier, if you don’t want the Flasher disabled by a high ambient light level, simply leave LDR1 off. There is no reversed supply protection on this board (to minimise size and voltage loss) so be very careful in wiring up the supply connections. Make sure to connect the negative end of your power supply to the corner pad (GND) of CON1 and it should be OK. A power switch can be wired in series with either supply wire should that be necessary, using either a twopin vertical or horizontal header or, as with our prototype, simply solder a pair of flying leads to these pads. Make sure they can’t move around too much, though, or the wires will eventually break due to metal fatigue. That’s it. Once you’ve applied power and LDR1 (if fitted) is in the dark, LED1 should start flashing after C1 has charged up to its normal voltage, which may take a few seconds. SC siliconchip.com.au