Simple circuit design with photo-interrupter tilt switch

Status
Not open for further replies.

brucep

New Member
Hi there, thanks for reading. I'm an electronics novice trying to figure out how to integrate a photo-interrupter style tilt switch in a simple circuit. Below is an image from the switch's documentation. The full documentation for the switch is here https://www.nkkswitches.com/pdf/ds-bTiltSwitch.pdf

**broken link removed**

I simply want to use it to turn a group of LEDs on and off, the power supply will be AA batteries.

Excuse my terminology here, I hope you can follow: So as I understand the above diagram I need to provide a constant 5 volt power supply to the switch through anode and cathode, then, when tilted the switch will close the circuit between collector and emitter. I need to add resistors to the circuit at the anode and collector legs of the switch. This is how I'm thinking of wiring it up:
**broken link removed**

So my questions are:

1. Does the circuit above look like it might work?

2. The switch needs a 5 volt power supply, do you think I could get away with 6 volts (4x AA)?

3. Are there any small (around 3/8" in each direction) components I could use to convert 3v to 5v so I could use the pair of batteries on the right to power the switch AND the LEDs? It seems like overkill to add 4 batteries to the system just to power a little switch.

Thanks so much for reading and trying to understand my novice explanation. I really appreciate and input you might have.

Thanks!

Bruce
 
You should be able yo use the same set of 3 to power both. The resistor on the led side should then be arouns 100 ohms.
 
The transistor side is bad too. 100K is way too big.

If is about 20 mA, but there is a range. You might shoot for a design goal of 30+ mA because the battery depletes.

You can use the same supply for both sides.

The formulas are: R(ohms) <= (Vbatt * n - VLed - Vd)/If ;

If will be about 30 mA or 0.3 A for the LED side
If must be less than 20 mA or 0.2 A for the transistor side, so pick the next higher standard value for I.

VLed = 1.2 in both cases

Vx will be 1.2 V for the LED side of the interupter
Vx will be 0.6 V for the transistor side of the interupter

You can't have negtative resistances, so you would have to increase the battery voltage,

I'd have to do some more research to figure out what kind of battery and size would make sense. I'd also have to know what lifetimeyou are expecting. Each kind of battery hs a different discharge curve. AA Alkaline are probably OK. I think 3 would be a good minimum.

You might get better life, by adding a transistor and a couple of resistors on the transistor side, so you can design for 30 mA rather than 20 mA. A switching regulator might help too.
 
Last edited:
To add to the existing post. The attached is a rough idea of what you may want, it is just an example.

Looking at the data sheet the maximum collector emitter forward current is 20 mA, so you need to keep that in mind. If you look at the example circuit from the data sheet they use Vcc = 5 Volts but that is just an example. However, the 20 mA is important as to the output side.

When you mention:
I simply want to use it to turn a group of LEDs on and off, the power supply will be AA batteries.

A group is a rather hard number to work with.

The specifications for the LEDs needs to be known. In the attached circuit I used 4 LEDs and each has a forward voltage drop of 1.6 volts and a forward current of 10 mA. I used Vsupply = 12 volts. So what I have there is:

1.6 * 4 = 6.4 volts forward drop for the LEDs. Now we figure roughly .6 volt forward drop for the NPN output so we get 6.4 volts + 0.6 volts = 7 volts. Since Vsupply is 12 volts and I am using 10 mA LEDs I want to limit the current to 10 mA. Therefore I can say:

12 Volts - 7 Volts = 5 volts / .015 amp = 500 Ohms. You won't find a common 500 Ohm resistor off the shelf so we can drop it to 470 Ohms and do just fine. Here we see how important it is to know the data for our LEDs. A common generic everyday red LED would be about right for my attached cartoon, however if we get into other colors or super bright everything will change. Again, in the circuit we are keeping the current of 10 mA well below the max rating of 20 mA for the coupler.

On the input side they tell us in the example that the Vfwd of the coupler is a maximum of 1.3 volts. They also use a forward current of 19 mA. I used 15 mA in my example and a fwd voltage of 1.2 volts. So on the input side we now have:

12 Vsupply - 1.2 Vled = 10.8 / .015 = 720 Ohms for R1 limiting the input side current to about 15mA.

Remember the output side of the coupler has a max rating of 20 mA! Generally you want to remain well below the max rating for a long life. Exceed 20 mA and bad things will happen.

The R2 in the example is used because the circuit is designed to provide a TTL level output at Vout right off the collector. As pointed out it would not work for your intended application. The circuit I posted here is merely an example of what is involved.

In real life I would use the R2 = 100K and use Vout to drive a transistor and let the added transistor drive my LEDs.

Hope That Helps
Ron
 

Attachments

  • Opto Coupler1 LED.gif
    11.4 KB · Views: 1,001
Thanks everybody! This explains a lot. I hadn't really considered amperages at all. I'm out of town for a week but when I get back I'm going to see how many amps the LEDs are and try and get my head around all this new information.

Thanks again!

Bruce
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…