controlling flashlight

Hi!

It's probably a stupid question but I can't find anything about it and I will not die if you laugh ;O)

I use 12 flashlight like this http://tinyurl.com/q4anao9 and I'd like to control them separately on/off and at different timing. Is it possible to take the + and - and just wiring it to the Arduino board and using the LED sketch? Do I need a electronic circuit to make it work? if yes, what do I need ?

Thanks in advance! mhc

It's a good question 8)

The 18650 battery is a Li-ion battery, and the led is probably a high power led. The Arduino output pin can drive a normal led (a led plus a series resistor), but not that high power led. But the Arduino can be like a switch that turns the flashlight on and off.

The best way to do that is with a logic level mosfet. A mosfet can be used like a switch: on and off.

it is really pretty simple. if you use a single power supply you can deliver power that the flashlight needs.

figure out where the LED gets power, then tie in to the ground side of the LED. connect that to an FET. control the FET with the arduino.

since the LED is already designed to run with the voltage of the power supply, all you need to do is to connect your wires on both sides of the switch.

the (+) goes to the FET, the FET is connected to ground and you control it with gate.

look up 2n7000, a pretty common FET. connect the drain to the LED that would go to ground, connect the gate to the arduino and then the source to the ground

check out the sketch to blink an LED and you can have some fun.

once you can turn it on and off, read about blink without delay.

Arduino may not provide enough current to run the led but that’s okay, the batteries do.

Question is do you want to hack a $13 flashlight or 2?

You might be able to do a clean job of it if there’s room inside for wires though you will have to make a hole.

The idea is to find out how the on/off switch is connected and then put your own wires in so that if it was 1 piece of wire, the light would shine with batteries in place. But you have 2 wires. Connect those to the collector and emitter of an NPN transistor so that + is to the collector and - to the emitter. The transistor is your switch. Connect a 10k resistor to the base pin of the transistor and when you give that 5V from a pin the battery current will flow.

And make SURE that the - wire is connected to Arduino GND.

You can put the resistor and transistor right in the wires and simply plug those into the Arduino holes.

http://electronicsclub.info/transistors.htm

dave-in-nj, I'm sorry, but the 2n7000 is not a good choice. It is not a 'logic-level' mosfet and it is only 400mA. I would prefer something like this: https://www.sparkfun.com/products/10213

I was wondering about how much current the lamp draws. Note that there is a 3 AAA battery option as well as the 3.7V Lithium cell option. The 3 AAA’s, if they are in series for 4.5V might give how much current for a reasonable time? 100mA?

I was thinking that a regular cheap 5 cent transistor suitable for < 1A might do okay.

But a FET… except for the price difference they are more efficient.

Ummmmm… Cree leds I see > 1A at 3V, some (arrays?) several Amps!

Ok ... I'm glad it wasn't a so stupid question !

Thank you so much for your replies, I really appreciated it! So now, I've got 2 options 1. Transistor 2. Logic level mosfet

To be honest, I don't fully understand the difference between mosfet and transistor but no matter what, I think I'll go with the mosfet because of the very clear and simple schematic I found on Sparkfun website. Thank you so much Peter_n for pointing me this out http://bildr.org/2012/03/rfp30n06le-arduino/

Question is do you want to hack a $13 flashlight or 2?

Yup, I'm ready for that. I will open one later in the day and see if it's easy to do. I'm ready for that also because i'm thinking of wiring them on AC adapters.

Many many thanks and i'll keep you updated!

Cheers,

If you’re going with AC adapters then what of the flashlights do you want?

The leds, you can get for less without having to destroy anything and keep the flashlights.
Heck, you can pick up a free or near free led light at Harbor Freight. It won’t be AS bright but…

The lens and focus? Well, sure, but you could have hacked those. Oh well, too late!

Does the front of the flashlight with the led and lens screw off the back with the batteries?
If so it should simplify the process and save drilling holes.

For saying all, I'm making sound with lights without any sound generators, only lights and photodiodes. If you are curious, here is an example http://tinyurl.com/k4bfxl3, at 2min, you see the sound changing with the focus of the flashlight. Yes, I used flashlight for their lens and focus but I'm also working with ikea led lamps like this http://tinyurl.com/8w4jujl and halogens. All kind of light change the textures of the sounds.

I'm invited to do an installation with this and, that's why I need to program all the lights.

The lens and focus? Well, sure, but you could have hacked those. Oh well, too late!

Well, I'm open to all suggestions (still have 2 month before the opening) and if you know good places where I can looking at or great tips, please tell me. In your spirit, I've bought this as well http://tinyurl.com/p4t2dr6 to see if I can make my own lamps. I just receive it today so, don't know yet. But at the end, it's not cheaper.

So wiring the flashlights on AC plug will eliminate for the staff of the gallery batteries managing and if I have all the lights on AC circuit, I think it will be easier to program all of them with Arduino.

Now that you know all my life (...) do you think that the suggestion by Peter_n with the is the best solution for my need?

Thanks!

Mosfets are more efficient transistors especially with higher power. Also more expensive and used to be in the 80's and maybe still are much more sensitive to static.

Don't just shop at one place. Look around. It keeps the market more honest. I am not sure if Sparkfun is local to you, that may add to shipping and time. I have a whole bookmarks folder and sub folders of links to different shops and parts houses.

What you do is pretty neat. My connect is slow so I only watched enough to see you affect light through the slits. I see how you do it, there is degrees of artistic control in the techniques. Do you also vary the rpm of the disc?

Yes, you are very right to use "house power". Batteries have more associated pollution, recycle or not, as well as cost and charging maintenance.

With the transistor and a controller you can vary or blink the light at different frequencies as well.

I don't suppose that color will come of use? In photoelectric effect, color makes voltage, brightness makes current.

For lenses, find some cheap eyeglass clip-on reading magnifiers or reading glasses and other lenses. You might also on the side play with polarizing films and other things found in optical experiment kits.

Do you also vary the rpm of the disc?

Yes I do. It change the frequencies of a note.

I don't suppose that color will come of use?

For now, colors make nothing special.

I was thinking while I was eating ... that mofset Peter_n suggested will not work with AC current I guess ?

I'm lost a bit. Can't use batteries for all the reasons you said but it makes programming more complicated if I use AC current. I know so little about Arduino, a little more in electronics but not much ... (feeling discouraged a bit ...)

Thanks for your reply, I thnik I'll go for smoke ... ;)

Get a switching power supply with enough capacity for what you want. A notebook computer power adapter might do for a start, certainly enough to run the flashlights.

I have small plug-ins that deliver up to 2 Amps of 5V or 12V for external power, they cost less than $5. A PC power supply is another option but always run it with a load, a fan might do.

Thanks GoForSmoke !

if the flashlight as it’s own circuit, you probably would not want to pwm the unit.

Anyone wanna comment on using a transistor to switch a 4.5v power supply ?

Peter_n: dave-in-nj, I'm sorry, but the 2n7000 is not a good choice. It is not a 'logic-level' mosfet and it is only 400mA. I would prefer something like this: https://www.sparkfun.com/products/10213

the Cree XM-L runs about 100 lumens per watt. at 2,000 lumens, that would be 20 watts. for 4.5 volts.... I am thinking you are correct. I underestimated the power draw of the device.

GoForSmoke:
Question is do you want to hack a $13 flashlight or 2?

not sure is there is a requirement for the light. but $13 is pretty cheap for that much luminosity
for $3 you can get 300 lumens, so the price seems to be pretty much a per-lumen cost.

.

if the flashlight as it’s own circuit, you probably would not want to pwm the unit.

I had the same reflexion at one point … So maybe the best way is to connect the flashlight to an AC plug and control it with a relay?

clic clic clic :wink:

dave-in-nj:
Anyone wanna comment on using a transistor to switch a 4.5v power supply ?

It depends on how much current you’re going to draw doesn’t it? Or you mean take the whole load?
And you do know that a MOSFET is a transistor? That’s what the T at the end stands for.

I’m petty sure that stereos were using “power transistors” before MOSFETs were available.