As we all know, LEDs are dimmed by altering the current flowing through them, not the voltage. We achieve this effect in this circuit by using an AVR microcontroller (2313 from Atmel) operating in the comparator
mode (Figure 1).
PWM LED Driver Operation
In this configuration, a nominal value is set on comparator input AC1, which is then compared with the voltage (proportional to LED current) at AC2. Upon power-up, the microcontroller initiates conduction by setting the gate of the MOSFET (connected to output B.4) to 0. Consequently, a linearly rising current flows through the choke and LED. The voltage drop across the 0.1-Ω shunt resistor corresponds to this current. Once the nominal voltage is achieved, the microcontroller disables the MOSFET and pauses briefly. During this interval, a linearly decaying current traverses the choke, LED, shunt, and recovery diode. This cycle repeats, producing a direct current voltage with a superimposed triangular waveform. The Bascom program for the microcontroller, provided in the listing, is concise and easy to comprehend. The source code and hex file can be freely downloaded from www.elektor.com.
Power Supply and Component Selection
A 6-V lead-acid gel cell battery serves as the power source, chosen for its reliability and ease of charging despite its weight. The 56-Ω resistor and diode work in tandem to limit and stabilize the microcontroller’s supply voltage, also functioning as a reference voltage for the voltage divider set with P1. The selected LED is a Luxeon LXHL-LW3C, boasting nominal specifications: 3 watts, ULED = 3.7 V, ILED = 0.7 A. A 100-nF capacitor, placed parallel to the LED and shunt, is directly connected to the PCB to mitigate potential interference effects from cable capacity. The 100-μF electrolytic capacitor plays a crucial role in smoothing the 6 V operating voltage, preventing undesirable voltage fluctuations.
Component Considerations and Precautions
To prevent false current values due to square-wave effects, it’s essential to use a carbon film type shunt resistor instead of a wire-wound one. Additionally, the choke should match the load current without saturating at maximum current levels. This configuration offers significant advantages for cave exploration. Being both reliable and efficient in terms of battery usage compared to traditional halogen lamps.
Addressing Overheating and Potential Issues
A challenge encountered in operation was excessive LED heating. This problem arose because the current cut-off value was not consistently observed, possibly due to microcontroller failure or a malfunctioning trimpot. A potential solution involves installing a watchdog timer to promptly restart the microcontroller if needed, along with incorporating a pulldown resistor from the comparator input to ground. These precautions can enhance the system’s reliability and ensure consistent performance.