Convert tension from photodiode IR to interrupt friendly pullup signal

Hi forum

I'd like to create a multidirectionnal IR detector with 4 IR photodiodes

The needs:
-The signals is read by the analog pins of arduino(3.3v) for each IR photodiode,
-Analog read is triggering by a interrupt in falling mode, when one of the photodiode recept a signal

The Questions is:
how to create a montage that meets the signals of each photodiode together to convert it into a pull up signal for an interrupt?(Logical gate,MOFSET, level shifter?)

Best regards Bertrand

As a beginner, it is incredibly unlikely that interrupts will be useful to you.

A common "newbie" misunderstanding is that an interrupt is a mechanism for altering the flow of a program - to execute an alternate function. Nothing could be further from the truth! :astonished:

An interrupt is a mechanism for performing an action which can be executed in "no time at all" with an urgency that it must be performed immediately or else data - information - will be lost or some harm will occur. It then returns to the main task without disturbing that task in any way though the main task may well check at the appropriate point for a "flag" set by the interrupt.

Now these criteria are in a microprocessor time scale - microseconds. This must not be confused with a human time scale of tens or hundreds of milliseconds or indeed, a couple of seconds. A switch operation is in this latter category and a mechanical operation perhaps several milliseconds; the period of a 6000 RPM shaft rotation is ten milliseconds.

Unless it is a very complex procedure, you would expect the loop() to cycle many times per millisecond. If it does not, there is most likely an error in code planning; while the delay() function is provided for testing purposes, its action goes strictly against effective programming methods. The loop() will be successively testing a number of contingencies as to whether each requires action, only one of which may be whether a particular timing criteria has expired. Unless an action must be executed in the order of microseconds, it will be handled in the loop().

So what sort of actions do require such immediate attention? Well, generally those which result from the computer hardware itself, such as high speed transfer of data in UARTs(, USARTs) or disk controllers.

Assuming for a moment that the interrupt is the correct solution, on what would it be triggered ?
The light level crossing an absolute threshold or a change in the light level of x units or what ? The latter would be quite difficult to implement.

If you condition the signal from the photodiode so it is capable of triggering an interrupt (external or pin-change), what are you going to measure with the analog pins ? The "raw" voltage at the photodiode ?

Is the Arduino also controlling the IR source which these photodiodes are to detect ?

The simple answer to the question is four comparators with open-collector outputs commoned up. IE an LM339 quad comparator chip.

That would work. From the early computer days an interrupt was defined as a condition that causes the microprocessor to temporarily work on a different task, and then later return to its previous task. Interrupts can be internal or external. ... Notice that when the interrupt (Int) occurs, if enabled, the program stops executing and the microcontroller begins to execute the ISR. To successfully use them keep the ISR short and do as much as you can do in your main loop. I typically set a flag and bail. Note the interrupt uses the same hardware, clocks etc inherent to the processor so it will execute the same instructions using the same number of clocks in the same time. There are some exceptions but very few. This from Wikipedia "In digital computers, an interrupt is an input signal to the processor indicating an event that needs immediate attention. An interrupt signal alerts the processor and serves as a request for the processor to interrupt the currently executing code, so that the event can be processed in a timely manner. If the request is accepted, the processor responds by suspending its current activities, saving its state, and executing a function called an interrupt handler (or an interrupt service routine, ISR) to deal with the event. This interruption is temporary, and, unless the interrupt indicates a fatal error, the processor resumes normal activities after the interrupt handler finishes. This is assuming the interrupts were enabled before the interrupt occurred and enabled after finishing the ISR. For the photo diode, place a resistor on the photo diode, the other ends of the resistor and photo diode to the power supply, be careful of the diode polarity. Then simply place the input of a 74HC14 to the junction of the photo diode and resistor. The output of the 74HC14 goes to one of the digital pins of the arduino. As far as direction I have no clue. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil