URGENT ! Question for connecting a light barrier

Hi

I am sorry for bothering you with an urgent question; I had an IR light barrier connected to a piece of work of mine. Yesterday it found out that it's too slow, and so I decided to buy a laser light barrier. I connected it to a 12 V DC adapter (it works!). Now I want to connect it to my Arduino and I don't know how I should make the connection.

I know which cable I have to take (it's only one, since there is no relais); and I need a 10 k resistor (I was told so) and a gnd to connect it, right? But in which order?

Please help me!!

You will need to provide information about the light barrier (for example, a link to the datasheet) before anyone can answer your question.

Hey, yeah, ... here a found a link to the datasheet.

http://www.produktinfo.conrad.com/datenblaetter/175000-199999/182320-da-01-en-M18R_Miniatur_Lichtschranke.pdf

A connected brown (12 V) and blue (GND). And black to another cable which goes to digitalport, then a 10 K resistor and after the resistor another gnd.

If you are using one of the varieties with an NPN output, then what you need is:

Blue to ground
Brown to +12v
Black to Arduino input pin
Either enable the internal pullup resistor on the Arduino pin, or connect a pullup resistor (suggest 1K to 10K) between the pin and +5v.

And for PNP ?

It is a pnp as I found out.

I would use something like:

Blue to Arduino ground
Brown to +12v
Black through 10K resistor to Arduino pin
6.8K resistor from Arduino pin to ground