The 4N35 is an optocoupler (opto-isolator) that provides electrical isolation between two circuits using light. It is commonly used in signal isolation, microcontroller interfacing, and switching applications.
🔹 1. What is the 4N35?

- The 4N35 is an optocoupler with an infrared LED and a phototransistor inside a single 6-pin package.
- It electrically isolates one circuit from another while allowing signal transfer using light.
- Used for protecting microcontrollers from high voltages and noise-sensitive circuits.
📌 Why use it?
- Prevents electrical damage between circuits.
- Reduces interference (noise isolation).
- Allows communication between different voltage levels.
🔹 2. 4N35 Pinout & Functions
The 4N35 has 6 pins:
Pin No. | Name | Function |
---|---|---|
1 | Anode (A) | LED Positive Input |
2 | Cathode (K) | LED Negative Input (Ground) |
3 | NC | No Connection |
4 | Emitter (E) | Phototransistor Output |
5 | Collector (C) | Phototransistor Input |
6 | Base (B) | Optional Control (Normally Unused) |
📌 Key Features:
- Optical isolation between input and output.
- DC signal transfer with low power consumption.
- Input Voltage: 1.2V (LED Forward Voltage).
- Output Voltage: Up to 70V (Collector-Emitter Breakdown Voltage).
🔹 3. How 4N35 Works
- The internal LED lights up when voltage is applied to pins 1 & 2.
- The light activates the internal phototransistor (pins 4 & 5).
- The transistor switches ON or OFF, depending on the LED state.
📌 This allows a low-voltage microcontroller to control high-voltage circuits safely.
🔹 4. Using 4N35 for Microcontroller Isolation
🛠Required Components
- 1x 4N35 Optocoupler
- 1x 220Ω Resistor (LED Current Limit)
- 1x 10kΩ Resistor (Pull-down for Transistor Output)
- 1x Arduino (or Any Microcontroller)
- 1x External Circuit (e.g., Motor, Relay, or High-Voltage Load)
🛠Wiring Diagram
4N35 Pin | Arduino Pin / External Circuit |
---|---|
Anode (Pin 1) | D7 (Arduino Output Pin) |
Cathode (Pin 2) | GND (Arduino Ground) |
Collector (Pin 5) | Relay/Motor Control Circuit |
Emitter (Pin 4) | GND (External Circuit Ground) |
🔹 5. Arduino Code for 4N35
This example turns ON/OFF a high-voltage device using an Arduino and 4N35.
#define OPTOCOUPLER 7 // Connects to 4N35 Anode (Pin 1)
void setup() {
pinMode(OPTOCOUPLER, OUTPUT);
}
void loop() {
digitalWrite(OPTOCOUPLER, HIGH); // Turn ON the optocoupler (Activates output)
delay(2000); // Wait 2 seconds
digitalWrite(OPTOCOUPLER, LOW); // Turn OFF the optocoupler
delay(2000);
}
📌 What happens?
- The Arduino controls the optocoupler LED.
- When the LED is ON, the transistor allows current flow.
- When the LED is OFF, the transistor is OFF (isolates the circuit).
🔹 6. Using 4N35 for AC Mains Isolation (Safe Switching)
📌 4N35 can be used to switch AC appliances (e.g., lamps, fans) via a relay.
🛠Circuit Steps
- The Arduino controls the 4N35 LED.
- The 4N35 transistor switches ON a relay.
- The relay controls the AC device.
📌 Using 4N35 prevents high-voltage AC from reaching the microcontroller!
🔹 7. Applications of 4N35
✅ Microcontroller Isolation – Protects Arduino from high voltage circuits.
✅ Switching High-Voltage Devices – Controls relays, motors, and power electronics.
✅ Noise Reduction – Used in industrial automation and signal isolation.
✅ AC/DC Power Control – Safe switching of mains appliances.
✅ RS232 & Serial Communication Isolation – Protects data lines from voltage spikes.
🔹 8. 4N35 vs Other Optocouplers
Feature | 4N35 | PC817 | MOC3021 (Triac) |
---|---|---|---|
Isolation Voltage | 5kV | 5kV | 7.5kV |
Max Output Voltage | 70V | 80V | 400V |
Output Type | Transistor | Transistor | Triac (For AC Control) |
Best For | General Microcontroller Isolation | Low-power isolation | AC Load Switching |
📌 Verdict:
- 4N35 is best for general-purpose switching.
- PC817 is a smaller, lower-power alternative.
- MOC3021 is used for AC load switching (Triac control).
🎯 Conclusion
- 4N35 is an optocoupler that provides electrical isolation between circuits.
- Used for switching high-power devices, protecting microcontrollers, and noise reduction.
- Works with Arduino, ESP32, STM32, and other microcontrollers.
- Prevents high-voltage damage and interference in sensitive circuits.