Electronic – arduino – How to detect when an LED changes color from red to green and quickly send a message to a PC to capture an image from a camera

arduinonetduinooptoelectronicsphotoresistor

I am working with a 3rd party IR curtain system, and the only way to tell in real-time that something has pierced the curtain is an LED at the top of the sensor pole that changes from green to red when there is an object in the way.

My goal is to grab an image from a 60fps camera at the moment the curtain is pierced by an object (in this case a dog running full speed through the IR curtain).

It has been suggested that a phototransistor (with a filter that only allows red light to pass) can be used to quickly sense when the LED changes color to red.

Beyond that, I am guessing that an Arduino or Netduino could be used to sense the phototransistor change and then send a message to a PC/Mac to let it know to capture the image (or most likely, to grab an image from a ring buffer that is 50-100ms in the past, so it gets close to the exact moment the object passed the IR curtain).

So, my questions to this StackExchange is:

  • Is this a good approach in general?
  • Any suggestions on what phototransistor to use?
  • Any suggestions on where to find a filter that will only allow red or green light to pass to the phototransistor?
  • What is the best way to get a message from a Arduino/Netduino to a host PC/Mac in a timely fashion (I'm guessing RS232 is out for speed reasons – and it seems to USB may be problematic)

EDIT:

Turns out the gel filters are not needed. Since the response curve of the photoresistor is at its peak at around the green wavelength and tapers off near the red wavelength, I can reliably tell the difference between off, green, and red by just the resistance indicated by the photoresistor.

Best Answer

•Is this a good approach in general?

Yes, although I'd go farther. Use two sensors, one with a red filter and one with a green filter.

•Any suggestions on what phototransistor to use?

No. What you need depends on a bunch of things, such as what kind of mount you can make for your sensors, how bright the LED is, how far from the LED your sensors are, etc. A photodiode may work OK, or even a photoresistor.

•Any suggestions on where to find a filter that will only allow red or green light to pass to the phototransistor?

eBay.

•What is the best way to get a message from a Arduino/Netduino to a host PC/Mac in a timely fashion (I'm guessing RS232 is out for speed reasons - and it seems to USB may be problematic)

Basically, if you're taking 60 frames / sec, anything which responds in less than 1/60 second should do you. A single character at 9600 baud will take 1 msec, so that's hardly a problem.