How do multi-mode flashlights work?

Paul

Newly Enlightened
Joined
Dec 27, 2007
Messages
41
I'm kind of new to DIY-flashlights and I think I'm going to start making one. My plan is to use a drop-in module from DX as light source as those seem to be just as cheap as buying each compunent and putting it together. Before I get started I'd like to know a bit about how things work. About every drop-in module has the ability to be set to different modes. How does this work? I suppose I need some kind of switch to change between the modes, but what kind? Will the clicky switches on DX (for instance this) do the job?
 
I see, but most switches on DX seems to have three solder points and as far as I can see the drop-ins just have two. Where should the third go?
 
I see, but most switches on DX seems to have three solder points and as far as I can see the drop-ins just have two. Where should the third go?


Those style buttons usually have three states they can be in (and the order could be slightly different than what I list). Click once and terminal A connects to terminal C. Click a second time and the switch is off. Click a third time and terminal B connects to terminal C. The cycle then starts again.

It is simply a single pole dual throw (SPDT) switch that latches in each position.
 
Those style buttons usually have three states they can be in (and the order could be slightly different than what I list). Click once and terminal A connects to terminal C. Click a second time and the switch is off. Click a third time and terminal B connects to terminal C. The cycle then starts again.

It is simply a single pole dual throw (SPDT) switch that latches in each position.
But that wouldn't work with a module that senses interuption in power because it would just turn it off. Am i right?
 
Effectively, it would give you two 'off' positions, so it would take three presses to change modes.

Even when it comes to single-pole pushbutton switches, there are two kinds, known as forward and reverse clicky.

With a forward clicky, if turning it on when it is off, the electrical connection is made before the switch mechanically latches - that means that it's possible to give very brief flashes by partially pushing the button from the 'off' position, but once it is turned on, to interrupt the electrical connection, the switch needs to be turned fully off and then on again

With a reverse clicky, the electrical connection is made after the switch mechanically latches on, so if you press the switch far enough to get light, when you release it, the light will stay on.
With this kind of switch, a partial depression of the switch when the light is on will disconnect the power, but power will reconnect when the switch is released - that makes mode changing by power disconnection simpler.
 
Thanks! That was really making things more clear. I would need a reverse clicky then. Would anybody happen to know where I can get some cheap? Don't know what kind those at DX is...
 
Paul:

Mode switching in most multimode flashlight is done by software running in a microcontroller which is in the flashlight driver.

usually every different mode is done by PWM with different duties.

Almost all microcontrollers have something called brown-out (the power is below the normal operating voltage for the microcontroller) detection or BOD mechanism. During BOD the microcontroller is not completely powered off. When the BOD is exited and the microcontroller resumes at a valid voltage then there is a bit (flag) in one of the microcontroller's registers that states that condition.

In some flashlights drivers there is an small capacitor that keeps the microcontroller in the BOD region without letting it turn off completely when you do a fast turn off - turn off cycle.

When you do a fast power on - power off cycle then the software programmed into the microcontroller detects the BOD condition and changes the PWM duty. When some time has elapsed after turning on (without turning off) then the program stores the last PWM duty value into an EEPROM memory so the driver can remember the last mode.

Some flashlight don't have a PWM driver but use two on positions switches. Some are on (high)-off-on (low)-off others are on(high)-on(low)-off. The on(low) position uses a current limiting resistor. The on(high) does not use any resistor.

I wrote some software to be run in a PICAXE which is a microchip microcontroller. You coud read the source code to get an idea about how to control modes. In Driver microcontroller hacking thread you can find the source code.
 

Latest posts

Top