An infrared (IR) transmitter is an electronic device that emits infrared radiation to transmit signals wirelessly. This form of invisible light is commonly used in remote control systems for televisions, air conditioners, and other consumer electronics. IR transmitters are also used in object detection systems, communication devices, and various types of automation.
Pin Number | Name | Description |
---|---|---|
1 | Anode (+) | Connects to the positive supply voltage |
2 | Cathode (-) | Connects to the ground (0V) |
Power Supply: Connect the anode of the IR transmitter to a suitable power supply (3V to 5V), ensuring that the current does not exceed the specified forward current.
Current Limiting Resistor: Place a current-limiting resistor in series with the anode to prevent damage to the IR LED. Calculate the resistor value using Ohm's law: R = (V_supply - V_forward) / I_forward
.
Signal Input: To modulate the IR signal, connect the anode to a microcontroller or oscillator circuit capable of generating the desired signal pattern.
Ground Connection: Connect the cathode of the IR transmitter to the ground of the power supply.
#include <IRremote.h>
IRsend irsend;
void setup() {
// Start the serial communication
Serial.begin(9600);
}
void loop() {
// Example: Send an IR signal (NEC encoded) every 5 seconds
if (Serial.available() > 0) {
int input = Serial.parseInt(); // Read the input as an integer
irsend.sendNEC(input, 32); // Send the NEC encoded input
Serial.println("Signal sent");
delay(5000); // Wait for 5 seconds before sending the next signal
}
}
Remember to always refer to the specific datasheet of the IR transmitter model you are using for precise information on operating conditions and limitations.