Reading IR sensor PNA4602

Hello all!

I am an arduino n00b and just got my board a day ago. I quickly moved threw an "Arduino Experimentation Kit" that was sold online. I bought a sensor pack that included a IR sensor - PNA4602. I am simply just trying to get a reading on the sensor, but I seem to be doing something wrong.

Currently, I have the sensor in a breadboard with the pin on the far right (Pin 3) to 5v, the middle pin(Pin 2) to GND and the left pin(Pin 1) to Digital Pin 2 on the Arduino Duemilanove.

The code I am using is below:

int pin = 2; //Digital Pin 2 

void setup()
{
  Serial.begin(9600);  //Start the serial connection with the copmuter
  pinMode(pin, INPUT); //Set pin as input
}
 
void loop()                     // run over and over again
{
 Serial.println(digitalRead(pin)); //printing the result
 delay(1000);                      //waiting a second
}

This only prints a 1 no matter what type of IR light I shine at the sensor. I am shining two different types of IR light into the sensor. One is a tv remote, and the other is an IR led bulb that i have used for several other projects. I know that both are emitting light when I test them with my camera.

Can anyone tell me what I am doing wrong, all I want to do is be able to read the input from the sensor. I have a tried a few other things as well but nothing seems to be working.

Any Ideas?

Thanks in advance!

  • Cole

Hi Cole,

Coincidentally, I just got a PNA4602 myself and am still trying to work out how to use it in my project.

One point that I think is relevant to your question is that the chip has an AGC (Automatic Gain Control) circuit built in (as shown in the block diagram in the datasheet). As I understand it, one implication of this is that a steady light will not produce a signal, which you discovered. Patterns of pulses/bursts of appropriate form will.

I found the PNA4602 datasheet to be singularly unhelpful. You might find it useful to look at the datasheet of the TSOP1738, a related chip by Vishay. Although they are not the same, you might get a better sense of how this chip should work and what kind of pulses to use.

As I said, I too have many questions about the IR protocols and detection and am just starting to delve in. I'm sure that others here can give more detailed answers, which I'll look forward to.

Good luck.

Yeah, I agree the data sheet for the PNA4602 is very unhelpful. I got more from the description of the product on the website I bought it!

I hope someone knows more about this product, because this is halting point for my project. I am making(or going to try and make) a mouse that uses your head as the input. Moving your head would intern move the mouse. I have a pair of glasses that I put two IR's on top of. I want the sensor to be able to see these glasses and than I will use java to take this as an input and move the mouse.

Hopefully someone can help with this IR problem so I can take this project to the next step.