SFH 551 TTL to Arduino UNO

I need help with writing an Arduino script for SFH 551 TTL transistor. Please find the data sheet attached with this Post. I am writing the script for Arduino. I need to read multiple sensors (at least 5 sensors) to an Arduino Uno board. Each sensor is constantly receiving an input from a Red laser diode. But when the laser beam is interrupted once then I would like to count it through the arduinio. So the number of times the laser beam is interrupted I want to count it. The counts should be visible on the arduino serial monitor with respect to time.

I need to know if I can connect the output from the SFH 551 TTL transistor to the Arduino digital channel.

AV02-3033EN+DS+SFH551_V+25Oct2011,0.pdf (78.7 KB)

I need to know if I can connect the output from the SFH 551 TTL transistor to the Arduino digital channel.

As figure 1 in the datasheet suggest you should use a pull-up resistor to set the passive state to HIGH. The photo transistor will pull the signal to ground when a light signal is received.

Yes but it still does not answer my question. Which digital pins on the arduino should I connect it to. Please help me with the programming.

Yes but it still does not answer my question. Which digital pins on the arduino should I connect it to.

I cannot find that question in your first post. Which digital pin you use depends on the programming method you choose and this depends on parameters like the frequency of the interruptions of the laser beam. You haven't specified that or given us a description of your project so we're able to estimate ourselves.

Please help me with the programming.

We help you but we don't do it. So try yourself, ask questions if they arise but don't expect us to do your job.

The frequency of interruptions I am looking at is 5kHz. If that helps. I think the description I have provided is sufficient.

The frequency of interruptions I am looking at is 5kHz. If that helps. I think the description I have provided is sufficient.

If that's all you have to do, it's quite easy: Save the state of every laser beam input and compare it in every run of the loop() routine to the actual input reading. If you have a state change, increment the counter. You get much more than 10'000 runs per second if you don't do anything else (which you don't do if you description is sufficient).