photo-interrupter

sorry, but my last topic was unsuccesful, so ill start a new one!

well, i still have the photo interuptor, and i still cant get it working, i have 3 of them, 2 with 3 pins, and one of them has four pins, and i couldent get the 3 pin ones working, and the four pin one, i have no idea how to hook it up...

can anybody give me some advice?

thanks in advance -big9dy3

Post the part numbers. Have you tried a search on google to see if you can find a datasheet?

well, i pulled these out of a printer, and the only number i can get out of them is:

41 5
.0D:

( exactly like that ) and that is for the 3 pin one...

edit:

o yea, and me knowing hebrew, it looks like there are 2 letters from the hebrew alphabet. incase it helps, and the 4 pin one has white letters that say "004w" and ontop it looks like "ROHM, or KOHM" and under the letters the numbers are "574"

And how might i hook up a 4 pin photo interupter to an analog pin?

edit edit:

i found a data sheet for it, but i have to subscribe to these asshole's site.... so tell me if you find one while i try to sign up... thnks

If you post a link to that datasheet I will see if I can find a similar one on another site.

i found one from google, but it dident show me how to hooker up.. ill fetch the link:

http://www.datasheet4u.com/html/R/P/I/RPI-574_Rohm.pdf.html

ptress the "datasheet view" button right under the blue bars ( i had a hard time finding it lol )

Pins 1&2 are the LED: Pin 1 goes to one end of a 220 ohm resistor, the other end of the resistor goes to +5 volts. Pin 2 goes to ground.

Pins 3 & 4 are the photodetector Pin 3 goes to the Arduino digital input pin, this should be treated as if it was a switch Pin 4 goes to ground.

how do i tell which pin is which? ( o and thnks for the quick reply )

The pin layout is shown on one of the External Dimension drawings in the datasheet you found.

lol not that it helps now..... but i got my hands on a good camera and took some hi res photos of both the types i had, so maybe u can figure out the 3 pin one buy the pictures... i'm guessing the 3 pin one uses the same ground for both connections, and thats how they get it down to 3 pins?

It could be both grounds on one pin, but it also could also be the anode and collector (+volts) on one pin. Or it could be a twin sensor photodetector without the LED. The picture may help, but I would focus on the 4 pin one for now because you have the connection info.

roger that, im uploading the pictures of both this, and the circuit boards of all the controllers, and stuff, ill post back in like 5 mins with the pics

weeeeeeeeeeha pictures are in!

here are the photo interrupters, for the rf stuff, go into the one and ill post that stuff there

pics:

4 pin photo interrupter:

3 pin interrupter:

wooooooooooooow, i’m trying this and it’s not working, can u tell me what i’m doin wrong?

i got everythin hooked up good, except it wont work!

i’m using the example switch test in the arduino software, and incase u dont got it lying round, here it is:

/*
 * Button
 * by DojoDave <http://www.0j0.org>
 *
 * Turns on and off a light emitting diode(LED) connected to digital  
 * pin 13, when pressing a pushbutton attached to pin 7. 
 *
 * http://www.arduino.cc/en/Tutorial/Button
 */
 
int ledPin = 13;                // choose the pin for the LED
int inputPin = 7;               // choose the input pin (for a pushbutton)
int val = 0;                    // variable for reading the pin status

void setup() {
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare pushbutton as input
}

void loop(){
  val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {            // check if the input is HIGH
    digitalWrite(ledPin, LOW);  // turn LED OFF
  } else {
    digitalWrite(ledPin, HIGH); // turn LED ON
  }
}

got everything hooked up how u said, and i’m confused.

thnks

Have you hooked up and ran the blinking LED sketch? Have you hooked up and ran the button test?

You might go here and study the texts so you have some basic understanding of electronics.

Free online books at the top. http://www.allaboutcircuits.com/

The abbreviations you use are annoying.

sorry about the abbreviations, ill try to spell stuff out more, and as far as i know the arduino is fine, it turns into a capacitive sensor when i unhook some wires, but led blink works, and i have that exact value resistor, and everything!

cant figure out whats wrong!

I would try hooking it up to an Analog input and reading the return. Maybe the sensor is not a HIGH/LOW but a variant you could then use something like

If (Pin > 250){serial.print(“On”);
If (Pin < 250){serial.print(“Off”);

Not exact code but you get the point…

yes, i see what you mean, but how could i hook it up to analog, it has 4 pins? do i need to instead of hooking to the digital input, to an analog input?

By looking at the picture I would guess one side is just a transmitter and one a receiver

transmitter side Look at the symbol closer to verify polarity. pins 1 and 2 1 being ground 2 being +5v

receiver side

Pins 3 and 4 Polarity may or may not matter. Either way it shouldn't hurt anything to try it in both directions. 3 being ground 4 being analog pin.

I find it very hard to understand them.

Ok. You can verify you have the diode working by pointing a digital camera at it. You should see a glow in the display. MEM's wiring is the one to go by.

If you look at the device you'll see the diode symbol on it. That end is the diode. The triangle end is the anode and goes to the resistor the resistor to +5v the other end the flat end goes to ground.

http://en.wikipedia.org/wiki/Image:Diode_symbol.svg Duh, borked yabb code here's a tinyurl

http://tinyurl.com/2kpxnn

The other end is the photo transistor. You need to connect a 10k resistor to +5v then run the other end of the resistor to a digital pin, run that digital pin to pin 3 on the photointerrupt and then run pin 4 on it to ground. When mem said 'treat it as a switch' you follow this but you replace the button with the two phototransitor connections wired properly.

http://www.arduino.cc/en/Tutorial/Button

The 10k resistor going to +5 causes the digital pin to be high with +5v. The phototransistor will pull it low. Just look for a low on that digital pin and you know the beam has been tripped. You don't want to short +5v to ground without the resistor the resistor is needed to keep current low.

sorry about the abbreviations, ill try to spell stuff out more, and as far as i know the arduino is fine, it turns into a capacitive sensor when i unhook some wires, but led blink works, and i have that exact value resistor, and everything!

cant figure out whats wrong!

I find it very hard to understand them.

Ok. You can verify you have the diode working by pointing a digital camera at it. You should see a glow in the display. MEM's wiring is the one to go by.

If you look at the device you'll see the diode symbol on it. That end is the diode. The triangle end is the anode and goes to the resistor the resistor to +5v the other end the flat end goes to ground.

no resistor? its a small led, i dont know if itll burn it out, or if it will be ok