IR beam

Hello
I am completely new to the arduino and im having trouble understanding a lot of things.
Im not very good with electronics as a whole so was looking for some pointers with something im trying to do.

I want to set up and IR beam that is on constantly and when the beam is broken, that triggers something in Pure Data.

Could someone tell me how to go about setting this up from the start. I've tried reading tutorials etc but im still lost.

Thanks a lot

Stick an IR Led on an digital pin with a current limiting resistor and turn it on
Stick a phototransistor on a digital pin and monitor it, it will need a pull up and should be low when the IR beam is on it. [edit]Eh, don't need a digital pin, just +5 volts for the IR led. You do need one for the phototransistor[/edit]

When the photo transistor pin goes high that's your beam break

Thanks

Ill see if I can get my head round that.

What resistor would i use and where would i put it. My knowledge of electronics is very limited!

Also, how would I declare a phottransistor in the Arduino environment software?

Thanks

You'll have to improve your knowledge then.
The resistor is on the IR LED to keep from destroying it. It limits current.

Get the data sheet for the IR LED and find the forward voltage, use +5 for the source voltage since it'll be running off the regulated arduino supply.

The pick the closest higher resistance. 220 ohm works for standard ones but the IR one may vary.
http://led.linear1.org/1led.wiz

I just found an instructable
http://www.instructables.com/id/SLEX4JEF6B7T1V2/

Since you want a beam break you don't need the IR LEDs on the digital pins. They can go to +5v.

They don't show it but the text tells it that +5 goes to pin 2 and the 10k resistor then the other side of the resistor goes to the photo transistor. The resistor is pulling up pin2 and the photo transistor grounds it. You'll be looking for the digital pin to go low.

Thanks

Ill see if I can get my head round that.

What resistor would i use and where would i put it. My knowledge of electronics is very limited!

Also, how would I declare a phottransistor in the Arduino environment software?

Thanks