The 4N25 is an optocoupler, also known as an optoisolator, designed to transfer electrical signals between two isolated circuits using light. It typically consists of an LED and a phototransistor in a single package, providing electrical isolation and protection from high voltages. This component is widely used in applications where signal isolation is crucial, such as in power supply circuits, microcontroller interfaces, and communication systems.
Parameter | Value |
---|---|
LED Forward Voltage | 1.2V (typical) |
LED Forward Current | 10mA (typical), 60mA (max) |
Collector-Emitter Voltage (Vce) | 30V (max) |
Collector Current (Ic) | 50mA (max) |
Isolation Voltage | 5000V RMS |
Current Transfer Ratio (CTR) | 20% to 300% |
Operating Temperature Range | -55°C to +100°C |
Pin Number | Name | Description |
---|---|---|
1 | Anode | LED Anode (positive terminal) |
2 | Cathode | LED Cathode (negative terminal) |
3 | NC | No Connection |
4 | Emitter | Phototransistor Emitter |
5 | Collector | Phototransistor Collector |
6 | Base | Phototransistor Base (usually left unconnected) |
LED Side (Input):
Phototransistor Side (Output):
Here is an example of how to connect the 4N25 optocoupler to an Arduino UNO to isolate a digital input signal:
Arduino UNO 4N25
----------- -----
D2 --------------> Anode (Pin 1)
GND --------------> Cathode (Pin 2)
5V --------------> Collector (Pin 5)
GND --------------> Emitter (Pin 4)
// Define the input pin for the optocoupler
const int optoInputPin = 2;
// Define the output pin for the LED
const int ledPin = 13;
void setup() {
// Initialize the input pin as an input
pinMode(optoInputPin, INPUT);
// Initialize the output pin as an output
pinMode(ledPin, OUTPUT);
// Start serial communication for debugging
Serial.begin(9600);
}
void loop() {
// Read the state of the optocoupler input
int optoState = digitalRead(optoInputPin);
// Print the state to the serial monitor
Serial.println(optoState);
// Control the LED based on the optocoupler input state
if (optoState == HIGH) {
digitalWrite(ledPin, HIGH); // Turn on the LED
} else {
digitalWrite(ledPin, LOW); // Turn off the LED
}
// Add a small delay to avoid rapid state changes
delay(100);
}
LED Not Lighting Up:
No Output Signal:
Intermittent Operation:
By following this documentation, you should be able to effectively use the 4N25 optocoupler in your electronic projects, ensuring proper signal isolation and protection.