Optoisolators

Has anyone used this optoisolator https://www.sparkfun.com/products/314. I was thinking of using it to switch a small DC load and want to make sure that my schematic and component values are correct. I have a 6V light that I want to switch from a FEZ Panda and this seemed like a good way to go.

Thanks,
Stacy

Do you mean in conjunction with a relay? That opto only has a max current of 50 mA (enough for 1 LED). It should work fine as an alternative to a transistor when switching a relay.

https://www.sparkfun.com/products/312 That might be a better choice.

Oh. I think I read the specs wrong. I didn’t plan to use a relay. I am switching a single LED that draws 60 mA. This is to replace the switch on an LED flashlight that’s powered by a CR123 battery. I want to be able to use a microcontroller to do the switching. Since I’m kind of an amateur, this was my first attempt. Is there a better way to do this? I’m thinking of keeping the microcontroller on a separate power supply.

Thanks,
Stacy

If it’s only 60 mA, then you can get by with just a 2N2222 transistor circuit. Check out this site, specifically the “Using a tranistor as a switch section”.

http://www.kpsec.freeuk.com/trancirc.htm

Note that the input (B) is where your signal from your micro would come in. You’ll need a small resistor between your signal and the transistor. The “LOAD” will be your LED + the appropriate size resistor to match it.

Okay, that makes sense and the thought had crossed my mind, but being a noob, I wasn’t sure how I would go about keeping the CR123 for the flashlight separate from the power source for the microcontroller. Is that even feasible? I also looked at solid state relays. Again, one of the goals is to be able to blink the flashlight without any noise. I’m using a microcontroller so that I can have programmable blink patterns.

Thanks for your help and patience!
Stacy

Why do you need two separate power sources? How are you powering the FEZ? Could you just use the 5V line from it to power your LED?

I’m trying to fit this all into existing packaging for the light that I’m hacking. I suppose I can try to figure out a way to use the same power source. I’ll give that a shot and see what I can do.

Thanks again!
Stacy