Simple IR barrier sensor for arduino

Hi!

I would like to build a simple IR barrier
sensor and wondered how to wire it.

Any simple ciruits out there?

Thanks!

Thank you for your reply!

I would like to avoid environmental interferences so
how to modulate a IR signal?

What I want to do is:

  1. Understand how to build a sensor like this
    in general for future projects.

  2. Maybe I want to build a machine to sort
    coins so I would like to detect the size of
    a coin and if a coin has reached a physical
    place in the machine.

I have this IR phototransistor (BP 103B-2)

And this IR LED (LD 274-3):

I also have a BPW 42 phototransistor As well As a SFH 409 IR LED.

Thank you very much!! :slight_smile:

Links work for me, opens into pdf docs.

Lefty

Sorry if the links didnt work for you. Here are some better ones of the
components I have here:

My phototransistors:

My IR LED:

  1. Is it possible to build a barrier sensor just with these components without external
    ICs etc. (Of course resistors)?

  2. Is it possible to modulate a beam just with eg. PWM of the arduino?
    Could someone provide a very small code example just as a hint? It would be nice to read
    the state of the IR barrier sensor as simple as this little sample:

if(digitalRead(IRSensorPin) == LOW){
       Serial.Print("Alarm!!!")
}
  1. The link you provided needed some other components too. Is it because the serial data
    transfer (btw thats really cool... ;))? I just want to detect if the beam is disconnected
    because of an object so can it be simpler?

Thanks you so much! :slight_smile:

Thanks for your input and help.

I will have closer look on the modules which allready send at
a certain modulation. Thanks for your advice! :slight_smile: