Help! 4 photoswitch

Aug 13, 2005 11 Replies

I have built several IR/visible switches from schematics found on the web. My objective is to have an indicator between an unblocked and blocked beam. I wanted to find one with sufficient voltage separation that a program could read (via the sound card) the values and determine a boundary value above or below which would indicate the value meant blocked or unblocked. So far my experience indicates that the IR switches have ranges in the low millivolt area. The one which shows the most promise is a Radio Shack 276-145 Phototransistor's emitter feeding the base of a PN2484 and the 2484's emitter goes to ground via an LED and 550 R resistor. Both collectors are fed with a 9 volt battery. I just finished the breadboard of "Simple Optical Switch" at Electronics Lab and the output was again low and variable. Very disappointing.


1) Why does the voltage jump to high levels when unblocked (276-145 version) before dropping below 100? The digitized values look to be 60-90 after jumping to 190-210 for
2-3 seconds. Oh and the tests were at 1 second intervals.
2) Why is the voltage unstable when blocked? The digitized values are 130 for 3-4 seconds then drift all around (119-125 but occasionally spike) then up to 130 again. The tests were made under battery power with new 9v (no load) battery.

You\'re having problems because you don\'t have the thing wired properly and also, perhaps, because you don\'t have the phototransistor shielded from ambient light. It should be wired like this: +9V>--+-----------+--------+ | | | | [10K] | | | E | +-[10K]-B 2N4403 [390] | C | C |A [IRLED] --> | Q1 | | E [LED] | | | | GND [390] | | | GND>--+-----------+--------+ Where Q1 is your phototransistor. The 390 ohm resistors will give you about 20mA of current in both LEDs, and the two 10k resistors will keep the 2N4403 cut off when the IRLED is off. When the IRLED is on, it\'ll pull the 10k resistors down to ground, almost, and turn on the 2N4403 and the LED.

Your sound card input stage has probably a capacitor in it's path to block the DC component of the signal so you can't really use it as a digital voltmeter.

Sylvain

Or, for an audio output to a sound card: 9V 7555 | +-------+ 10K[POT]TO SOUND CARD +--|TH R|O---Vcc | | |__ | C +-O|TR OUT|--+--[390]--[IRLED>]~~~B 276-145 | +-------+ | E +----[6k8]----+ | | GND [0.1] | GND When the beam isn\'t broken, there\'ll be about a 1kHz signal on the output to the sound card. If the sound card\'s input is internally capacitively coupled to the outside world, the 0.1µF cap on the arm of the pot can be omitted.

As pointed out in another post, the sound card will only respond to a voltage that varies with time, it will not response to a DC voltage. You can couple your phototransistor to a 555 so that when unblocked the 555 oscillates at an audio frequency like 1KHz, and when blocked the 555 stops oscillation. Something like this:

View in a fixed-width font such as Courier.

. . +----------------------------------->

. | . | 9V BATT TO SOUND CARD . | ------------ . | | - |[--+--------->

. | | | | . | | + |] ----+ . | ------------ | | . | 0.1U | | . +--||---+-----------------+ | . | | | . | | | . 1K | 1K | 22U + | . +---/\\/\\--+-/\\/\\--+--------||----------+ . | | | . | ~ | 0.22U | 1K . +---------+--|>|--+--------||----------+---/\\/\\--+ . | LED | | | . | | ----- -LM555 | | . 0.01U | | | \\_/ | | PTR | . +--||-----|-------+--| GND V+ |--+ ------|-- . | | | | | | c | . | 220/ 47K/ | | | |/ | . +---------\\-------\\--| TRIG DIS | |~~~ | | . | / / | | | |\\ | . | | | | | | e | . | +-------|--| OUT THRESH |--+ ------|-- . | | | | | | | . | 68K / | | | | | . | \\ +--| RST CON | | | . | / | -------------- | | . | | | | | . +---------+-------|--------------------+ | . | | . +------------------------------+ . . .

I suppose a little hysteresis would not hurt:

View in a fixed-width font such as Courier.

. . . +----------------------------------->

. | . | TO SOUND CARD . | . | +---------->

. | | . | 9V BATT | . | ------------ | . | | - |[--+ . | | | | . | | + |] ----+ . | ------------ | | . | | | . | | | . | | | . | 0.1U | | . +--||---+-----------------+ | . | | | . | | | . 1K | 1K | 22U + | . +---/\\/\\--+-/\\/\\--+--------||----------+ . | | | . | ~ | 0.22U | 1K . +---------+--|>|--+--------||----------+--/\\/\\-----------+ . | LED | | | . | | ----- -LM555 | | . 0.01U | | | \\_/ | | PTR | . +--||-----|-------+--| GND V+ |--+ ------|-- . | | | | | | c | . | 220/ 47K/ | | | |/ | . +---------\\-------\\--| TRIG DIS | |~~~ | | . | / / | | | |\\ | . | | | | | | e | . | +-------|--| OUT THRESH |--+ ------|-- . | | | | | | | . | 68K | 3.3M | | | | | . +----/\\/\\-+-/\\/\\--+--| RST CON | | | . | | -------------- | | . | | | | . +-----------------|--------------------+ | . | | . +--------------------------------------+ . . .

That works for the CMOS 555 , but the RST current required for the bipolar version will require doing something more like this: View in a fixed-width font such as Courier.

. . . +----------------------------------->

. | . | TO SOUND CARD . | . | +---------->

. | | . | 9V BATT | +------------+ . | ------------ | | PTR | . | | - |[--+ | ------|-- . | | | | | | c | . | | + |] ----+ | | |/ | . | ------------ | | | |~~~ | | . | | | | | |\\ | . | | | | | e | . | | | | ------|-- . | 0.1U | | | | . +--||---+-----------------+--|--------------------+ . | | | | . | | | | . 1K | 1K | 22U + | 100K | . +---/\\/\\--+-/\\/\\--+--------||----------+-/\\/\\--+---------+ . | | | | . | ~ | 0.22U | 47K | . +---------+--|>|--+--------||----------+-/\\/\\--+-----+ | . | LED | | | | | . | | ----- -LM555 | | c | . 0.01U | | | \\_/ | | | \\| | . +--||-----|-------+--| GND V+ |--+ | PN2484|-+ . | | | | | /| . | 220/ | | | e . +---------\\----------| TRIG DIS |----------|-----+ . | / | | | . | 68K | | | | . +--/\\/\\---+----------| OUT THRESH |--+ | . | | | | | . | | | | | . | +--| RST CON | | | . | | -------------- | | . | | | | . +-----------------|--------------------+ | . | | . +----------------------------+ .

Actually, he was quite specific that the "diode" was an LED, in that he wrote ..."the 2484\'s emitter goes to ground via an LED and 550 R resistor." , so my take on it was that the LED in the emitter was just a visual indicator, not the IR source, which would have been called "the" LED. Anyway, after reading his first paragraph about using "voltage separation" and a sound card to do the detection, and following his link to: http://www.electronics-lab.com/projects/misc/017/ I decided he basically didn\'t know what he was doing, so I provided him with a circuit which would give him a large voltage differential between the beam\'s blocked and unblocked states and then, later, a circuit which would give him an AC output he could run into his sound card if he wanted to do the detection that way, by checking for the presence of AC every second or so...

From the original description of a "diode" in the emitter and checking the sound card every second, it sounds like he was using an IR latched switch like so: View in a fixed-width font such as Courier.

. . Vbatt . | . | . +-------+----+ . | | | . c | | . +--+ _ |/ | o| . | | /| ~~~ | | + . |r | / |\\ | o| . |e | / e | | . |f | / | | | . |l | / +-------|----+ . |e | / | | . |c | / [Rb] | . |t | / | c . |o | _ | |/ . |r ||\\ +-----| . | | \\ |\\ . | | \\ e . | | \\ | . | | \\ | . +--+ \\ +-[Re]--+ . \\ | . \\ --- . ~~~ \\ / . --- . | . | . gnd . . .

I read in sci.electronics.design that Fred Bloggs wrote (in ) about 'Help! 4 photoswitch', on Tue, 16 Aug 2005:

Hi, Fred. Another great 'Muriel'!

Regards, John Woodgate, OOO - Own Opinions Only. There are two sides to every question, except \'What is a Moebius strip?\' http://www.jmwa.demon.co.uk Also see http://www.isce.org.uk

Thnx- anyone who likes transistors will like this:

View in a fixed-width font such as Courier.

. . . . . . . Vbatt . | . +--------------------------+ . | | . [Re] e . | |/ . +---------[10K]----------| 2N3906 . | |\\ . | c . --- | . ~~~ \\ / | . +--+ --- | . | | | | . |r | +--------------------+ | 7555 OSC . |e | / | | +-------+ . |f | / | | | | . |l | / +-[47K]-+------------------+---|RST |--> to . |e | / | | | | | | souncard . |c | / | e | | | | . |t ||/ | |/ | | | | . |o | - +-----|2N3906 | [47K] | | . |r | \\ | |\\ | | | | . | | \\ | c | | | | . | | \\ | | | | +-------+ . | | \\ [47K] [4.7K] | | | . | | \\| | | | +-------+ . +--+ - | | +--|

I know- well the yo-yo's keep calling an IR LED "the" LED.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required