Electronic – arduino – Detecting which IR detector was triggered using one pin

arduinointerrupts

I have a project that has 6 IR led's and detectors.

The project needs to detect when any of the 6 beams get broken, and exactly which one got broken. I would like to be able to use only one input pin to detect if any of these have been broken.

What kind of hardware setup would I need to achieve this?

Some more notes:
Currently a high is read when the beam is interrupted.
The actual breakage in the IR beam is extremely short. (A falling coin)
My preferred method would be to use an interrupt if this is even possible.

Best Answer

Edit: Changed answer after clarification by OP about simultaneous presses
If multiple detectors, up to 6, need to be sensed for possible simultaneous interruptions, the solution described in this posting on the Arduino forums is usable. Substitute the "buttons" referred to in the post, with your high-when-interrupted lines from the 6 sensors. Each detector line will connect to the resistor specified in that post, and the ADC values received will indicate what combination of detectors is interrupted:

BUTTONS        VALUES     RESISTORS
btn 1          837-838    220
btn 2          737-738    390
btn 3          610-611    680
btn 4          318-319    2.2k
btn 5          178-179    4.7k
btn 6          91-92      10k
btn 1 + btn 2  896-897      
btn 1 + btn 3  877-878      
btn 1 + btn 4  851-852      
btn 1 + btn 5  844-845      
btn 1 + btn 6  840-841      
btn 2 + btn 3  821-822      
btn 2 + btn 4  769-770      
btn 2 + btn 5  753-754      
btn 2 + btn 6  745-746      
btn 3 + btn 4  674-675      
btn 3 + btn 5  643-644      
btn 3 + btn 6  627      
btn 4 + btn 5  408-409      
btn 4 + btn 6  363-364      
btn 5 + btn 6  243

If your MCU of choice has a comparator with edge triggering on analog inputs, generating an interrupt each time the voltage rises over 0.5 Volt or so will work.

If you need more that 2 simultaneous interruptions detected, an alternative would be to use a key scanning IC that provides serial output, like MAX6955 or TCA8418, then read said IC's output using an I2C read on a single input line.