Hop
Newly Enlightened
Earlier this year, someone posted in another electronics forum a problem he was having inserting a push-button controlled MOSFET switch in series with the negative (return) lead of a programmable constant-current LED controller. A high-power 10W LED (with its controller board) is located at one end of the flashlight atop a LiIon cell, with one wire connected to the positive terminal of the cell. The other wire on the controller is connected to the metal flashlight case. To complete the circuit, a push-button switch on the other end of the flashlight connects the negative terminal of the LiIon cell to the metal flashlight case.
The problem was to replace the mechanical push-button switch with a small dome-switch controlling a power MOSFET. There were other operational considerations that would be handled by programming a Microchip PIC10F200 microprocessor. Basically, the dome switch provides an input to the microprocessor and the microprocessor provides a gate drive signal to the MOSFET. All of this would be powered through the LED controller by placing a 330 ohm resistor across the two controller wires. This resistor provides a current path from the positive terminal of the LiIon cell to the metal flashlight case when the LED is off.
The purpose of all this was to replace a low-current capability mechanical switch with a MOSFET that could easily switch six or more amperes. The entire circuit has to fit on a 14mm diameter circuit board using surface-mount components attached to only to one side of the board. The other side of the board is reserved for a spring contact to the negative end of the LiIon cell.
Several weeks into this project the original poster noticed that when the MOSFET was conducting (LED in the flashlight is on), there would be no power to operate the PIC since the MOSFET effectively connects the negative terminal of the LiIon cell to the flashlight case, which is serving as the positive supply terminal for the PIC. Prior to turning the MOSFET on, power to operate the PIC is supplied by the voltage between the negative terminal of the LiIOn cell and the flashlight case. In this case, the negative terminal of the LiIon cell served as the negative or ground rail (Vss) and the flashlight case as the positive rail (Vdd). Thus, the PIC is powered as long at the MOSFET is off.
The easiest "solution" to this problem of power going away when the flashlight is on would be a wire from the positive LiIon battery terminal to the push-button circuit board on the other end of the flashlight. Alas, this would be a mechanical nightmare for the OP. A slot would need to be milled inside the body (which is sized for AA cells), an insulated wire inserted in the slot, and somehow the whole thing fixed in place with something... epoxy perhaps. Or, if the ID could be enlarged slightly, a plastic liner could perhaps be fitted and the wire embedded in the liner. For whatever reasons, the additional wire was deemed impossible to add. So someone proposed an alternative solution: an energy storage capacitor that is re-charged when the MOSFET is off and provides power to the PIC when the MOSFET is on. With the MOSFET on, it would be turned off for one millisecond approximately every one hundred milliseconds to keep the capacitor charged through the 330 ohm resistor. The human eye would not notice a one millisecond flicker every tenth of a second. Voila! Problem solved, just add some code.
From the get-go I was worried that interrupting power to the programmable LED mode controller, even for one millisecond, would have the effect of telling it to re-program. It is, after all, controlled by a microprocessor and those puppys respond quickly. I haven't heard from the OP for quite some time, so I don't know how his "Flashlight Project" turned out. I am tempted to order an LED controller board and see how it responds to millisecond interruptions of power. Perhaps the on-board microprocessor could be programmed to ignore such "glitches" or perhaps it already does ignore brief power interruptions by means of its own "hold-up" capacitor.
I am a newbie to this forum, but I would appreciate some advice on where to go from here. The PIC10F200 works as intended, sleeping most of the time, waking up for one millisecond every 135 milliseconds to recharge a one microfared energy storage capacitor. I am a retired electrical engineer with an electronics hobby. This will likely be my one and only adventure with flashlights.
73 de AC8NS
Hop
The problem was to replace the mechanical push-button switch with a small dome-switch controlling a power MOSFET. There were other operational considerations that would be handled by programming a Microchip PIC10F200 microprocessor. Basically, the dome switch provides an input to the microprocessor and the microprocessor provides a gate drive signal to the MOSFET. All of this would be powered through the LED controller by placing a 330 ohm resistor across the two controller wires. This resistor provides a current path from the positive terminal of the LiIon cell to the metal flashlight case when the LED is off.
The purpose of all this was to replace a low-current capability mechanical switch with a MOSFET that could easily switch six or more amperes. The entire circuit has to fit on a 14mm diameter circuit board using surface-mount components attached to only to one side of the board. The other side of the board is reserved for a spring contact to the negative end of the LiIon cell.
Several weeks into this project the original poster noticed that when the MOSFET was conducting (LED in the flashlight is on), there would be no power to operate the PIC since the MOSFET effectively connects the negative terminal of the LiIon cell to the flashlight case, which is serving as the positive supply terminal for the PIC. Prior to turning the MOSFET on, power to operate the PIC is supplied by the voltage between the negative terminal of the LiIOn cell and the flashlight case. In this case, the negative terminal of the LiIon cell served as the negative or ground rail (Vss) and the flashlight case as the positive rail (Vdd). Thus, the PIC is powered as long at the MOSFET is off.
The easiest "solution" to this problem of power going away when the flashlight is on would be a wire from the positive LiIon battery terminal to the push-button circuit board on the other end of the flashlight. Alas, this would be a mechanical nightmare for the OP. A slot would need to be milled inside the body (which is sized for AA cells), an insulated wire inserted in the slot, and somehow the whole thing fixed in place with something... epoxy perhaps. Or, if the ID could be enlarged slightly, a plastic liner could perhaps be fitted and the wire embedded in the liner. For whatever reasons, the additional wire was deemed impossible to add. So someone proposed an alternative solution: an energy storage capacitor that is re-charged when the MOSFET is off and provides power to the PIC when the MOSFET is on. With the MOSFET on, it would be turned off for one millisecond approximately every one hundred milliseconds to keep the capacitor charged through the 330 ohm resistor. The human eye would not notice a one millisecond flicker every tenth of a second. Voila! Problem solved, just add some code.
From the get-go I was worried that interrupting power to the programmable LED mode controller, even for one millisecond, would have the effect of telling it to re-program. It is, after all, controlled by a microprocessor and those puppys respond quickly. I haven't heard from the OP for quite some time, so I don't know how his "Flashlight Project" turned out. I am tempted to order an LED controller board and see how it responds to millisecond interruptions of power. Perhaps the on-board microprocessor could be programmed to ignore such "glitches" or perhaps it already does ignore brief power interruptions by means of its own "hold-up" capacitor.
I am a newbie to this forum, but I would appreciate some advice on where to go from here. The PIC10F200 works as intended, sleeping most of the time, waking up for one millisecond every 135 milliseconds to recharge a one microfared energy storage capacitor. I am a retired electrical engineer with an electronics hobby. This will likely be my one and only adventure with flashlights.
73 de AC8NS
Hop
Last edited by a moderator: