Maker Pro
Maker Pro

Microcontroller controlled by pushbutton for LED flashlight

KrisBlueNZ

Sadly passed away in 2015
LOL yes it is, and yes I do, but at random times. I'm unemployed and my sleeping patterns are more like sleeping scribbles :-/
 
I would have included that info if I had thought of it. The switch will be used in high powered LED flashlights, mounted in the tail end. The board can only be populated on one side. The other side will have a spring that will be the (-) battery contact. Several different LED drivers will be used. The switch will connect in between the (-) battery terminal and the conductive flashlight body. The driver will connect in between the (+) battery terminal and the body.
 

KrisBlueNZ

Sadly passed away in 2015
I would have included that info if I had thought of it.
Obviously. My point is, how do you know you've now thought of everything we need to know?
The switch will be used in high powered LED flashlights, mounted in the tail end. The board can only be populated on one side. The other side will have a spring that will be the (-) battery contact. Several different LED drivers will be used. The switch will connect in between the (-) battery terminal and the conductive flashlight body. The driver will connect in between the (+) battery terminal and the body.
OK. How about pulsing the LED OFF for a very short time - too short to be visible - a millisecond, say - at regular intervals, for example once per second, to maintain the charge on a smallish capacitor used to power the micro and provide the MOSFET drive voltage.
 
Most of these LED drivers perform mode changes during brief "off" periods. I have no idea how much off time is needed to change modes.
 

KrisBlueNZ

Sadly passed away in 2015
OK, tell us about the LED drivers. Part numbers, data sheet references.

And what kind of batteries will you be using?

That's what I mean about telling us everything you can about the project - not just what you think is relevant - and giving us as much detail as possible.
 
This would be just one of the drivers that would be used. As far as I know, there are no datasheets available for any of them. The switch would need to work with incandescent also, but that would be the simplest to build around. Dominant battery choices are single Li-Ion and IMR cells.
 

KrisBlueNZ

Sadly passed away in 2015
OK, what does that LED "driver" actually do, apart from providing flashing modes and varying the brightness using PWM? It doesn't have any inductors, so it doesn't boost the voltage. Does it provide current limiting? What are you using it for?

What kind of LEDs do you intend to use with it?

What battery voltages do you intend to use?

You have not told us enough about the design.
 
TT, the group here has an amazing background and talent set. The reason they ask for the project in its entirety is because they can look at the project in unique and creative ways that you can't imagine. I don't exaggerate, the skill set is truly humbling... Retain some information that makes your device unique, but give transparency to the rest so that they can give you the best help.

From the simplistic side, why can you not give power to the pic portion of the circuit - I am thinking of a constant on to the pic from the batteries - the pic draws very few μA in its idle status.
 
OK, what does that LED "driver" actually do, apart from providing flashing modes and varying the brightness using PWM?

That is all it does.

It doesn't have any inductors, so it doesn't boost the voltage. Does it provide current limiting?

Yes, it provides current limiting. Some drivers have boost circuits, but with today's low Vf LED's and Li-Ion battery availability, they aren't used much any more.

What are you using it for?

Not sure what you are asking here. It's a flashlight. To provide light in darkness.

What battery voltages do you intend to use?

Useful Li-Ion and IMR range is 2.8 - 4.2 volts

You have not told us enough about the design.

Here is the problem. I want to build an electronic switch that mimics a mechanical push button operating withing the 2.5-5v range with at least 5a capacity. I want to be able to use it in flashlights that were made in the past, present and future by me or other manufacturers. If this can't be done, let's just focus on the current light project with the info given above.
 
From the simplistic side, why can you not give power to the pic portion of the circuit - I am thinking of a constant on to the pic from the batteries - the pic draws very few μA in its idle status.

Easier said than done. We are talking about a simple flashlight here. The current path is simply: bat(-), switch, metal flashlight tube, LED driver, bat(+). Bringing a separate constant (+) back down to the switch is an electronic piece of cake, but a mechanical nightmare to execute. I am a machinist, so it becomes my nightmare.
 

KrisBlueNZ

Sadly passed away in 2015
OK. Can you give us some detail on the LEDs. Data sheet references? Forward voltages? How many? All in parallel? Individual current limiting resistors? Total operating current 5A maximum, right?

I was asking what you're using the LED driver for because if it just provides current limiting, you should be able to do that with your switch board. I guess you would need to disable that feature when you're using it in flashlights that already have an LED driver board, but for new designs you should be able to avoid the LED driver boards.

Re pulsing the output OFF briefly. That would be fine if you're driving an LED directly - although you would still want a resistor in parallel with the LEDs to ensure a low-voltage-drop, low-current path for recharging the energy storage capacitor. But it sounds like pulsing the load could be a problem if there's an LED driver board present.

Also a minimum supply voltage of 2.8V is pretty low even for the MOSFETs I found. What is the minimum useful operating voltage of a 2.8V battery?

I'll have a think about this. I think a preliminary schematic might be the next step.
 
The LED driver is used for it's flexibility. It allows the customer to set up his light exactly the way they want. The LED driver would never be replaced by the switch alone, as all end user customization would be lost.
2.8v is the minimum useful voltage of a LI-Ion and IMR cell.

I see you were off-line for a few minutes... Did you have a nice nap? :)
 

KrisBlueNZ

Sadly passed away in 2015
I think Electronics Point says you're offline if you haven't accessed the site for a certain amount of time, not if you're disconnected from the net.

OK. I'm not happy with the amount of detail you're providing about the LEDs and drivers. I think you may have to restrict the application of your switch to cases where the load circuit is known.

Even if you use a supercap on your board, you have to be able to ensure that it will charge fully. When there is an unknown load circuit, you can't be sure of that. A simple resistive load will drop 0V when the current through it has fallen to zero, so the whole battery voltage will be available across the switch circuit to charge the supercap. But an LED driver won't necessarily do this. Even at 0 mA, it may still drop a volt or two.
 
Sorry I can't give more information. I know it would make your job easier. I was able to locate schematic of that driver. Looks like it might cause a .5v drop?

NANJG105Csch_zps8dbdeea1.jpg~original.jpg
 
I don't care if it works or not. I won't support counterfeiters. I have had my designs copied by Chinese manufacturers before. It might sound flattering, but it's financially devastating if you rely on it to make a living.
It's not counterfeit if it is open source.

Bob
 

KrisBlueNZ

Sadly passed away in 2015
I was able to locate schematic of that driver. Looks like it might cause a .5v drop?
OK, so that "driver" really does nothing except provide dimming and flashing options, and some poorly controlled current limiting.

The voltage vs. current graph won't be a simple 0.5V drop (I guess you assumed that from the presence of the diode) and you can't rely on it to provide enough current to charge a capacitor on your switch board to a reasonable voltage.

Here's a preliminary circuit design so you can see how I'm thinking. I don't think this will work with the LED driver you showed in post #55 but it shows the idea I've been working with so far, so you can confirm we're on the same "wavelength".

272661.001.GIF

C1 is the reservoir capacitor for the circuit and it's charged by D1 while Q1 is OFF. You need the load ("LED DRIVER" in the schematic) to be resistive, to the extent that it will conduct current even when there is almost no voltage across it, because the load circuit needs to provide the current to charge C1 almost all the way to the battery voltage. This is essential to provide enough voltage for the PIC to operate, and most importantly, to turn the MOSFET fully ON.

If the load can't do this, and you can't provide a separate feed from the positive terminal of the battery, and you don't want to put a small lithium cell on your board (which IMO would be a very bad idea), I don't think you can do what you want to do.
 
Kris,
Looks fantastic to me. We are definitely on the same wavelength. Yes, the driver operates exactly as you describe. Unfortunately, the market is flooded with junk like this and everyone accepts it due to the low cost. I have been trying to get some well designed drivers made for the past 8 months. For now, this is the best we have to work with. I have a few of those drivers here. Is there any test I can perform on one to see what kind of capacitor charge we can expect. Also, as a last resort, the drivers could be modified with a "drain" resistor across the inputs. The ideal resistance would be able to completely charge the cap in a reasonable time without sacrificing too much run time.
 

KrisBlueNZ

Sadly passed away in 2015
You could graph the voltage vs. current behaviour of a driver using two multimeters and a variable power supply. This will not show the dynamic behaviour due to the reservoir capacitor inside the driver, but I think it would be interesting, and would be enough to prove that the LED driver's characteristics will make it unusable in its current form. Including the effect of its reservoir cap would just make it less usable in an unmodified state.
Also, as a last resort, the drivers could be modified with a "drain" resistor across the inputs.
Yes, I didn't want to suggest this, but I'm afraid it's the only answer I can think of that might give this switch circuit a chance of being workable.

And we would have to assume that the reservoir cap on the driver board will be enough to keep the micro running during the time that the switch board's reservoir cap is being charged through the paralleled resistor, otherwise the driver's micro will reset and the driver might change modes or do something else stupid, right?

To support a modified driver board (modified with a paralleled resistor added across it), the switch board should be able to monitor its own supply voltage, so each time it turns its MOSFET OFF, it could wait until its reservoir cap had charged to a certain fixed voltage point, or until the rise of its reservoir cap voltage had tapered off to a certain slope. That would allow it to ensure its own self-preservation, while having the least impact on the driver and causing the least flicker. Whether the driver would also be preserved would depend on its characteristics.

I really think you would be opening a can of worms if you want to support various drivers, various LEDs, and various battery voltages.

Edit: Voltage drops are pretty critical when you're working from a 2.8V supply! It may be possible to avoid the Schottky diode's forward voltage drop by using a P-channel MOSFET instead of the diode. Its gate would be driven from the same signal that drives the N-channel MOSFET's gate, so when the N-channel MOSFET is OFF, the P-channel MOSFET would be ON and the reservoir capacitor would be charged.
 
Top