For the hardware in this tutorial, you will need these parts:
- Arduino Uno
- IR LED
- TSOP382 IR Receiver
- Mini Push Button Switch
- 330Ω Resistors
- IR Keychain Remote or any IR remote that uses 38kHz modulation
You will be setting up two separate circuits both using an Arduino. The first example circuit uses a TSOP382 IR photo sensor to receive and demodulate the IR signal from a common remote control. The second example circuit uses an IR LED and current limiting resistor to transmit IR codes to a common appliance, for example a home stereo or TV.
Here is the complete setup for connecting to an Arduino:
Hardware setup for both of the examples.
Be sure to connect your LED correctly! The long leg is positive and connects to the resistor, then to the Arduino’s output pin. The short leg is negative and is connected to ground (GND).
Also, you cannot see IR LED light with your eyes, since IR radiation is outside of the visible spectrum. However, most cellphone cameras can detect short wave IR and can see the LED faintly glowing.
When the LED is modulating at 38kHz, the LED should appear constantly lit, but dim.
Also, pay attention to the polarity of the TSOP382. Refer to the TSOP382 datasheet for the pinout of the sensor.
The current limiting resistor attached to the LED can have values down to 100Ω (40mA) for full power and longest range. If you use a larger value resistor, the LED won’t light as bright and your range will suffer. With a 330Ω resistor, you should be able to operate the IR LED across a dimly lit room.