TSOP4840 infrared receivers return random analog values

Dear users,

I am trying to connect a TSOP4840 infrared receiver to my Arduino UNO board. The Vs-pin of the sensor is connected to the 5V pin on the Arduino while the GND-pin of the sensor is connected to the GND-pin of the board. The data/OUT-pin of the sensor is connected to an analog port of the Arduino. When I now try to read the voltages using analogRead, I experience random values if the sensor is connected. Most values are 0 until they start to rise up to 0.6V and decline again to 0. In this form, they are different to the random values when no device is connected to the analog pin.
Using a voltmeter, I receive correct values which seem to be linear dependant on the distance of the infrared emitter.

Does maybe someone know, what I am doing wrong and what I have to do in order to get the correct voltages of my TSOP-sensor?

Thanks in advance.

Kind regards
Birk

That is because the TSOP4840 does not output an analog voltage value. It outputs a digital signal that is only HIGH or LOW at any specific time. There are user libraries around that will allow you to receive the signal value of this type of IR remote control sensor receiver.

Lefty

Thank you for your reply.
I have read that already on several websites. However, why does my voltmeter then display correct values which seem to be linear dependant on the distance of the infrared emitter?

Birk:
Thank you for your reply.
I have read that already on several websites. However, why does my voltmeter then display correct values which seem to be linear dependant on the distance of the infrared emitter?

Because a digital voltmeter is not designed to read changing digital signals, rather just the average DC voltage it sees as it performs a analog to digital display. So while your voltmeter is displaying values they are just nonsense values in this case.

Some Pointers for you:

  1. Read the data sheet for this receiver first.
  2. Confirm that you are using the correct pin-out for the receiver - it is not always the same with different IR receivers.
  3. Enable the pullup resistor on the Arduino input pin you connect the receiver to. (usually a digital port)
  4. Analog read is not the normal use for this device and may be too slow to detect the pulse changes.
  5. You will only be able to do what you want with an Osilloscope.
  6. IR receivers provide a digital output (Usually 0v or 5V) - not an analogue output
  7. This receiver is designed for 40kHz, which usually is associated with SONY IR signals, but may work at other more common frequencies with reduced range.
  8. Use the IRremote or IRLib libraries, which have plenty of examples. Also study their websites.
    9, A good resource for IR explanations is available (google-> sb projects IR)
  1. Read the data sheet for this receiver first.

And you will notice that the power pin is not connected directly to the power but through a resistor and capacitor. It is vital that you wire yours up in the same way otherwise it can pick up interference.