low-level interrupt and photodiode
2004-05-06 by jay marante
Yahoo Groups archive
Index last updated: 2026-04-28 22:41 UTC
Thread
2004-05-06 by jay marante
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
2004-05-06 by Phil
with a photo transistor, you simply pull it low and take the output from the emitter. Connection wise, +5 connected to collector. emitter connected to pull-down resistor which is in turn connected to ground. output is take from the emitter. When the PT turns on (i.e. light), it will pull the output high, when its off (dark), the output is pulled low by the resistor. You will need to play with the pull- down resistor value to get the right triggering level. I'd use a 50K or so pot but wouldn't run it down below 1K (or use 1K in series to protect it). Once you get a relialable value for the pull-down you can substitute a fixed R. Make sure your I/O pin doesn't have pullups enabled. --- In AVR-Chat@yahoogroups.com, jay marante <jaythesis@y...> wrote: > hi! > i wanna trigger a low-level interrupt on interrupt 1 using a phototransistor. what i wanted is that when there is an insufficinet light on the phototransistor or when the light is blocked, interrupt 1 will trigger on low-level. how will i design this? thanks for the help...
> -jay > > > --------------------------------- > Do you Yahoo!? > Win a $20,000 Career Makeover at Yahoo! HotJobs
2004-05-06 by Graham Davies
--- In AVR-Chat@yahoogroups.com, "Phil" <phil1960us@y...> wrote: > with a photo transistor, you simply > pull it low and take the output > from the emitter. I would think you'd need a comparator so that the input to the MCU was a proper logic level and not some analog signal that could spend a lot of time floating around between the thresholds. Especially if you're expecting it to generate an interrupt. Graham.
2004-05-07 by Larry Barello
One of the really nice things about the AVR processor line is that EVERY I/O line is a schmitt trigger input. By adjusting the load resistor of the photo-transistor, you should be able to drive the AVR input pin directly. Read the data sheet to see what the thresholds are. They are pretty well defined so your design will work from chip to chip. Cheers!
-----Original Message----- From: Graham Davies --- In AVR-Chat@yahoogroups.com, "Phil" <phil1960us@y...> wrote: > with a photo transistor, you simply > pull it low and take the output > from the emitter. I would think you'd need a comparator so that the input to the MCU was a proper logic level and not some analog signal that could spend a lot of time floating around between the thresholds. Especially if you're expecting it to generate an interrupt.
2004-05-07 by Mark Jordan
On 7 May 2004 at 0:32, Graham Davies wrote: > --- In AVR-Chat@yahoogroups.com, "Phil" <phil1960us@y...> wrote: > > > with a photo transistor, you simply > > pull it low and take the output > > from the emitter. > > I would think you'd need a comparator so that the input to the MCU > was a proper logic level and not some analog signal that could spend > a lot of time floating around between the thresholds. Especially if > you're expecting it to generate an interrupt. > > Graham. > So use the AVR internal analog comparator. It can even generate a direct interrupt or a timer capture interrupt. Mark Jordan
2004-05-07 by Sean Ryan
Or use a schmitt trigger.. --- In AVR-Chat@yahoogroups.com, "Mark Jordan" <mark@c...> wrote: > On 7 May 2004 at 0:32, Graham Davies wrote: > > > --- In AVR-Chat@yahoogroups.com, "Phil" <phil1960us@y...> wrote: > > > > > with a photo transistor, you simply > > > pull it low and take the output > > > from the emitter. > > > > I would think you'd need a comparator so that the input to the MCU > > was a proper logic level and not some analog signal that could spend > > a lot of time floating around between the thresholds. Especially if
> > you're expecting it to generate an interrupt. > > > > Graham. > > > > So use the AVR internal analog comparator. It can even > generate a direct interrupt or a timer capture interrupt. > > Mark Jordan