Hacking a flashlight - MOSFET instead of a switch. Is there a nice way to do it? - Page 1
Forum section: electronics / projects

author: aluck
author_rank: Regular Contributor
timestamp: November 27, 2012, 07:48:54 pm
content: I have a nice hi-power LED flashlight with an optional external push button on a cable, which can be mounted instead of original button. You simply remove the original cap with a button, and mount a new cap with cable and a button.Recently I've noticed that when using the external button the flashlight is a lot dimmer. I measured the resistance of that system (cap + cable + button), and it was a whopping 0.3 Ohm! At the usual 1.4 Amps it's 0.42 V drop! No wonder it is much dimmer. (see original.png)Using a good MOSFET I could get down to 0.008 Ohms, which is much better. I want to place that MOSFET inside the cap. MOSFET should be turned on when I press the button and turned off when I release it.Normally the flashlight is turned off, the Gate is pulled down by a resistor. When the button is pressed, the Gate is shorted to + 4.3 V (not a battery plus terminal! it's just a potential on the lower side of LED driver), MOSFET opens, flashlight lights. (See hacked.png)Here is the problem. IT DOESN'T BLOODY WORK as it supposed to. MOSFET never fully opens, because as the charge on it's gate builds up, it goes into triode region, then VDS drops down. As VGS = VDS, it goes down too.Long story short, it reaches equilibrium and stays in triode forever, never reaching saturation region.YES, I KNOW, that I should place that goddamn switch between Battery (+) terminal and Gate. I wish I could - the flashlight is waterproof, and there is no chance I could get to the Battery (+) without breaking everything else.Placing an additional small battery isn't an option. Getting to Battery (+) is not an option too.Any ideas?

author: Psi
author_rank: Super Contributor
timestamp: November 27, 2012, 08:38:32 pm
content: It doesn't work because if the fet turns on it pulls the gate to GND and turns off again.You might be able to rig up something using a diode and capacitor but you would need an additional pushbutton to turn off.

author: aluck
author_rank: Regular Contributor
timestamp: November 27, 2012, 09:03:21 pm
content: Quote from: Psi on November 27, 2012, 08:38:32 pm...and it will work just until the capacitor discharges; then it will switch off again.And, two buttons are not convenient at all.

author: Psi
author_rank: Super Contributor
timestamp: November 27, 2012, 09:39:34 pm
content: Quote from: aluck on November 27, 2012, 09:03:21 pm1) Yes, but the gate impedance is high and a flashlight is often not used for very long continously. So it may not matter.You can spec the capacitor and gate pulldown so it stays on for quite long.2) Well, maybe not two separate ones, could be a SPDT.I tried it out in LTspice and this does seem to work

author: aluck
author_rank: Regular Contributor
timestamp: November 27, 2012, 11:19:58 pm
content: Thanks for trying to help, but it I cannot replace the switch. It's waterproof and it fits nicely.I wonder if there's some other kind of a device - like "a switch with memory"... nothing comes to mind.

author: perfect_disturbance
author_rank: Regular Contributor
timestamp: November 27, 2012, 11:24:50 pm
content: Would you run into the same problem with a bjt?

author: Shuggsy
author_rank: Regular Contributor
timestamp: November 28, 2012, 12:33:54 am
content: If you can manage to find the space in the cap, you could try Dave's "World's Simplest Soft Latching Power Switch Circuit"Uses 5 passive components, 2 bjts, and 1 mosfet. Only part that may need to be semi-large is the mosfet as you need it to pass 1.4A continuously. Sounds like you already have the mosfet though. Everything else can be rather small (or surface mount if you want to make a simple PCB or enjoy challenging soldering tasks).

author: Psi
author_rank: Super Contributor
timestamp: November 28, 2012, 02:16:35 am
content: The problem is he doesn't have access to VCC, it makes things almost impossible.

author: aluck
author_rank: Regular Contributor
timestamp: November 28, 2012, 12:48:20 pm
content: Quote from: AcHmed99 on November 27, 2012, 11:56:58 pmThat kind of a flashlight goes for about $70-100. There is just one LED soldered directly to the driver board with a huge heatsinks all over the place. Battery (18650 type) is connected by it's (+) terminal to the driver. The flashlight's aluminum body serves as a connection between the driver and the switch. Switch is connected between battery (-) and the driver.LED --- LED driver ---- Flashlight Body ------- SWITCH| |----------- (+) BATTERY 18650 (-) ----------No wires and no place to put a wire without ruining the flashlight's aluminum body.Even a good switch will have quite a significant resistance, nothing even near mOhm range.

author: T4P
author_rank: Super Contributor
timestamp: November 28, 2012, 12:59:06 pm
content: Well they don't go for 100$ though, i bought my flashlight that hardly heats up for about 21$http://dx.com/p/cree-xm-l-t6-700lm-5-mode-white-led-zoom-flashlight-2-x-18650-128845It's pretty high quality

author: Jeff1946
author_rank: Regular Contributor
timestamp: November 28, 2012, 03:16:47 pm
content: Try putting a diode between the capacitor and the switch. Looking at the spec sheet for a 1n4148 for example, the capacitor would charge to about 0.6 V of the battery voltage. The leakage when the light is on should be less than 10 nA. With your 220 ufd cap, I calculate it would take about 3 hrs to significantly drain the cap, so I assume self discharge would be more or there may be some leakage with the low voltage FET as well. Easy enough to try.Or better yet, use some small batteries to drive the FET gate.

author: DarkPrince
author_rank: Regular Contributor
timestamp: November 28, 2012, 03:36:38 pm
content: This is an interesting conundrum. I am wondering if a thin PCB would be able to be inserted and interfaced between the switch and where the switch would normally go. Even just a plated pad on the pcb which would make contact with the battery terminal (just imagining my $5 flashlight at the moment, not sure what a better one looks like. guessing). I'm thinking that a microcontroller would be smaller than an analog counter-part. The 10F200 is quite cheap and small, exactly for something like this. Using a diode+cap you could get a charge (possibly distributed over several caps to reduce board height). That powers the uC, and that senses the switch and shorts between "ground" and the other switch terminal to turn flashlight on. As others said, there will be a maximum duration before the stored charge is dissipated, but the maximum ON duration could be calculated and thus, you now have a flashlight with automatic power-off. Based on the fact it actually sorta worked already I suppose there is enough leakage or trickery to get the cap charged up through the LED driver circuit. On battery installation and the cap being discharged the light may flash once during charge. Interesting idea though. Sorta temped on a cheap flashlight. Programming those 6-pin devices ought to be fun though.

author: aluck
author_rank: Regular Contributor
timestamp: November 28, 2012, 04:43:39 pm
content: Quote from: T4P on November 28, 2012, 12:59:06 pmWould you bet your life on it when searching in a dark forest for a wounded wild boar?

author: aluck
author_rank: Regular Contributor
timestamp: November 28, 2012, 04:52:42 pm
content: Quote from: Jeff1946 on November 28, 2012, 03:16:47 pmHow do you suggest turning it OFF? You can't pull the gate down, as it will drain the cap much faster.Quote from: Jeff1946 on November 28, 2012, 03:16:47 pmNo way. That small battery will die at the most inappropriate situation. What is worse, it will do it suddenly - it will turn off and never turn on again.

author: perfect_disturbance
author_rank: Regular Contributor
timestamp: November 28, 2012, 05:12:41 pm
content: Quote from: aluck on November 28, 2012, 04:52:42 pmI thought the battery idea was a good one. If all your doing is turning on a transistor or some sort of small ssr a coin cell will probably dramatically outlast the batteries powering the main LED. And yes it will die at some point with little or no warning... but wait isn't that the case with all flashlights?

author: dr_p
author_rank: Frequent Contributor
timestamp: November 28, 2012, 08:37:36 pm
content: How about 2 cells of 2032 (3V), a logic MOSFET and a 100K pull down on the gate. When on it draws 60uA and considering a 180mAh capacity on a coin cell that means 3000h=4 months (of ON time). So change them once a year and they're ok.Or mod the flashlight by routing a flat flex cable through the battery compartment thus supplying Vcc to the MOSFET.

author: aluck
author_rank: Regular Contributor
timestamp: November 29, 2012, 12:13:14 am
content: Quote from: perfect_disturbance on November 28, 2012, 05:12:41 pmNope. Usually you can rely on a graceful degradation of a battery. It becomes dimmer, clearly indicating that battery is going to die and needs recharge.What bothers me with a second battery - it will die suddenly, without degrading.

author: aluck
author_rank: Regular Contributor
timestamp: November 29, 2012, 12:22:09 am
content: Quote from: dr_p on November 28, 2012, 08:37:36 pm2x2032 wouldn't fit the cap. 2xLR44 - may be, but I have no idea on it's capacity.Flat flex would be nice, but it's mechanically impossible. Back cap screws on with about a dozen turns. It will twist a flex a dozen times.So far, I have no ideas other than just replacing wires and switch. Even if I could manage to go down from 0.3 Ohm to 0.1 Ohm, it is still 0.135 V, or 5% voltage drop on wires. Not good.

author: perfect_disturbance
author_rank: Regular Contributor
timestamp: November 29, 2012, 12:32:48 am
content: Quote from: aluck on November 29, 2012, 12:13:14 amwhy would the secondary battery degrade any less gracefully than the primary battery?

author: Psi
author_rank: Super Contributor
timestamp: November 29, 2012, 12:46:13 am
content: Quote from: aluck on November 28, 2012, 04:52:42 pmIf you pull the gate down with a 10meg resistor and use the switch to connect the cap to the gate the discharge will be ultra small but enough to turn the fet off when the switch is off.

author: aluck
author_rank: Regular Contributor
timestamp: November 29, 2012, 02:42:55 am
content: Quote from: perfect_disturbance on November 29, 2012, 12:32:48 ambecause the main battery will work from 3-4.7 V.and I expect MOSFET triode region, in which it is degrading, to be much smaller than 1.7 V. am I wrong?

author: aluck
author_rank: Regular Contributor
timestamp: November 29, 2012, 02:49:48 am
content: Quote from: Psi on November 29, 2012, 12:46:13 amIt seems that you are right. Will give it a go and report results.

author: Jeff1946
author_rank: Regular Contributor
timestamp: November 29, 2012, 05:16:54 am
content: After more thought think battery is the way to go. Looking athttp://data.energizer.com/PDFs/344-350z.pdfspec sheet for a 344/350 battery, two of these or three if you need more than 3 volts, would bias the FET gate for about 30,000 hours on time assuming a 1M resistor from the gate to ground. Also note battery has 80% power left after 8 years at 20C. If you use a single pole double throw switch to connect gate to either battery or source potential, I would assume battery would last easily 10 plus years. Note a transistor like STP60N3LH5has a gate leakage current of 100 nA with 20V source to drain voltage, so this can be neglected.

author: nukie
author_rank: Frequent Contributor
timestamp: November 30, 2012, 04:21:34 am
content: You are actually searching in the wrong place but there are many electronic guru here which will get you there eventually, luckily there's a fulltime flashlight nuthere to guide you express... Over the years I have witness many amazing custom made parts these are the two that might help you with your designThis button cell powered mosfet switch claims to have 13 years life span ( I believe most Lithium coin cells have expiry date of 7-9 years when fresh from factory)http://www.candlepowerforums.com/vb/showthread.php?324929-The-Ultimate-Tailcap-Switch-the-FETtie-for-Z41-and-variants&highlight=switchThis is a soft start switch that works with Incandescence filament bulbs, the filament acts as a path for the positive supply to feed the mosfet, might not be very useful for you but it's an idea...http://www.candlepowerforums.com/vb/showthread.php?213751-Softstart-3-level-Incan-Driver-Switch-For-SF-P-C-M-series-Tail-Cap&highlight=switch

author: aluck
author_rank: Regular Contributor
timestamp: December 03, 2012, 10:29:33 pm
content: Quote from: aluck on November 29, 2012, 02:49:48 amI've successfully finished this project. The winner is 0.44F supercap + Schottky diode. The only problem is it takes about half an hour to fully charge the supercap to it's full extent. After that it works like a charm.Thanks to everyone!

author: TerraHertz
author_rank: Super Contributor
timestamp: December 06, 2012, 02:50:20 am
content: Is this one of those annoying torches, where the 'LED driver module' has 2 or 3 different modes, and you select them by quickly turning the torch-rear button on and off? For instance I have a Cree Ultrafire with three modes: full power, half power, and strobe. Another one - LED Lenser - cycles between off/full/half power. That's even more annoying because you can't turn it off with one click.Anyway, I have an idea for how to solve your problem, but it would result in the LED-driver module receiving very brief loss of power at regular intervals. Probably too brief to notice the light 'blink', but would be no good if that makes the module switch modes.Incidentally, is your 18650 battery 'bare' or does it include the small over-discharge protection pcb on the negative end that most such batteries in LED torches do? These make the battery about 3mm longer than a bare battery. But since discharging a Li-ion battery below the knee of it's voltage curve permanently damages the battery, it's worth it.My problem is I have about 50 bare 18650 batteries, but till I come up with an over-discharge protection circuit I don't dare use them for anything.

author: aluck
author_rank: Regular Contributor
timestamp: December 06, 2012, 09:39:05 am
content: Yes, itwasannoying 5-mode flashlight. I successfully hacked it to be one-mode.I use 18650 pulled out from a new laptop battery - it doesn't have any circuit protection. Couldn't care less about overdischarging - while discharging it will become so dim that I would notice it anyway. And all those circuit protection also very successfully work as current limiters with a noticeable difference in flashlight brightness.