TSOP1838
TSOP1838
The TSOP1838 is an infrared (IR) receiver module designed for remote control applications in various IoT devices, consumer electronics, and appliances. It is a high-sensitivity, low-power consumption component that provides a reliable and efficient way to receive IR signals.
The TSOP1838 IR receiver module converts the incoming IR signal from a remote control into a digital output signal that can be easily interpreted by a microcontroller or other digital devices. The module operates on a supply voltage of 2.7V to 5.5V, making it suitable for a wide range of applications.
| The TSOP1838 has a 3-pin package with the following pinout | |
| Pin 1 | VCC (Supply Voltage) |
| Pin 2 | GND (Ground) |
| Pin 3 | OUT (Digital Output) |
The TSOP1838 is available in a small SMD package with dimensions of 4.90mm x 2.80mm x 1.35mm.
For detailed specifications, application notes, and technical information, please refer to the TSOP1838 datasheet.
TSOP1838 Infrared Receiver Module DocumentationThe TSOP1838 is a popular infrared (IR) receiver module widely used in various IoT and electronics projects. It's a highly sensitive and reliable component for receiving IR signals, making it suitable for remote control systems, IR communication, and other applications.Pinout and ConnectionsThe TSOP1838 module has three pins:| Pin | Description |
| --- | --- |
| VCC | Power supply (typically 5V) |
| GND | Ground |
| OUT | Signal output |Code Examples:### Example 1: Basic IR Receiver with ArduinoThis example demonstrates how to use the TSOP1838 module with an Arduino board to receive IR signals from a remote control.```c
const int irReceiverPin = 2; // Pin 2 for Arduino Uno/Nanovoid setup() {
Serial.begin(9600);
pinMode(irReceiverPin, INPUT);
}void loop() {
if (digitalRead(irReceiverPin) == LOW) {
Serial.println("IR signal received!");
// Add your code here to handle the IR signal
}
}
```Hardware Connection:Connect the VCC pin of the TSOP1838 module to the 5V pin of the Arduino board.
Connect the GND pin of the TSOP1838 module to the GND pin of the Arduino board.
Connect the OUT pin of the TSOP1838 module to digital pin 2 of the Arduino board.### Example 2: IR Remote Control with Raspberry Pi (Python)This example demonstrates how to use the TSOP1838 module with a Raspberry Pi to decode IR signals from a remote control using the LIRC (Linux Infrared Remote Control) library.```python
import RPi.GPIO as GPIO
import lircGPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP)lirc.init("my_remote")try:
while True:
code = lirc.nextcode()
if code:
print("Received IR code:", code)
# Add your code here to handle the IR code
except KeyboardInterrupt:
passlirc.deinit()
```Hardware Connection:Connect the VCC pin of the TSOP1838 module to the 3.3V pin of the Raspberry Pi.
Connect the GND pin of the TSOP1838 module to the GND pin of the Raspberry Pi.
Connect the OUT pin of the TSOP1838 module to GPIO pin 17 of the Raspberry Pi.These examples demonstrate the basic usage of the TSOP1838 IR receiver module. You can modify and extend these examples to suit your specific IoT project requirements.