Electronic – arduino – How should I wire up the circuit to connect a TSOP4838 (Radio Shack 276-64) infrared receiver to an Arduino

arduinoinfrared

Beginner question on datasheets basically.

I have this part, and am working from a tutorial for the code here, but am unsure exactly how to wire up the circuit and what risk I might be at for destroying it if I make a mistake. In the tutorial, the author doesn't give a circuit diagram, and merely says "All you need to do is supply a resistor (I used 200 Ohms, with a 3.3V supply) to the power line, GND it, then connect the data line to one of your digital pins (I used pin #2)".

However, the datasheet shows an example circuit with a 100 Ohm resistor connected to Vs along with a 4.7 micro Farad capacitor connected between Vs and GND. I'm guessing that I should connect Vs to the 3.3V output on the Arduino and use a 200 Ohm resistor, but do I need a capacitor?

If I wanted to connect it to the Arduino 5V output, how would this answer change?

Also, for pedagogical purposes, what information from the data sheet would help me answer these questions?

Best Answer

The connection to the Arduino will be thus:

schematic

simulate this circuit – Schematic created using CircuitLab

You can use either an analog or a digital input pin on the Arduino for reading from the device. The specific values of the resistor and capacitor are not critical, so long as the resistor does not limit supply current below around 5 mA, which the datasheet specifies as the Absolute Maximum the component could ever need. This means resistor values of up to 1 kOhm will be fine.

The R and C in the datasheet application circuit example are there to eliminate any high frequency noise in the supply circuit. With 100 Ohms and 4.7 microFarad, this filter has a cutoff frequency of around 340 Hertz, so it will smooth out power supply noise over that frequency.

You could use 220 Ohms and 2.2 uF for a similar effect, filtering out any power supply noise above around 330 Hz. ... Or any such combination of R and C. No, don't leave out the capacitor, else the power filtering purpose is not fulfilled.

Neither the resistor nor the capacitor really have any relationship to the voltage the TSOP part is powered with - other than that the capacitor needs to be rated to operate at well above such supply voltage. Since the 2.2 or 4.7 uF capacitor is most likely to be electrolytic, ensure that the capacitor is rated for 10 Volts, and is connected with the correct polarity, i.e. negative pin connected to GND, positive to Vcc through the resistor.

Note that the datasheet states Supply Voltage (VS) of 4.5 to 5.5 V. While the TSOP series does operate at 3.3 Volts from personal experience, this is below the rated supply range, hence functionality is not guaranteed, and may occasionally fail.