4N35 Optocoupler — Galvanic Isolation Demo
An LED and a phototransistor in the same package transfer signals across an electrical no-man's-land — your first encounter with isolation.
Difficulty: Breadboard. Estimated build time: about 25 minutes. Estimated parts cost: about US$2.80. 5-line bill of materials. Compare supplier offers when available. A logic-level signal that crosses an electrical isolation barrier through nothing but light.
Identify the pinout
DIP-6 with the notch up: pin 1 = anode of input LED, pin 2 = cathode of input LED, pin 3 = no connect, pin 4 = emitter of output phototransistor, pin 5 = collector, pin 6 = base (usually left unconnected — the LED's light is the base drive).
Wire the input side
From an Arduino digital pin (output, idle low), through a 220 Ω resistor, into pin 1 (anode). Pin 2 (cathode) → Arduino GND. When the pin is HIGH, ~14 mA flows through the LED.
Wire the OUTPUT side as a separate, isolated circuit
Use a separate 9 V battery for the output side — its negative terminal NEVER connects to Arduino GND. Battery + → 1 kΩ → LED anode → LED cathode → pin 5 (collector). Pin 4 (emitter) → battery −. Pin 6 → leave floating. The Arduino's 5 V world and the 9 V world share no wire.
Pulse the LED
Run a Blink sketch on the Arduino at 1 Hz. Each time the input LED turns on, the phototransistor's beta does the rest — it conducts, the output LED lights. There is no electrical connection between them; the only thing crossing the gap is infrared light through the epoxy.
Test the isolation
Probe Arduino GND to battery − with a multimeter — they should read whatever potential the air around them is at, NOT zero. Touch them together briefly and the circuit still works (because the optocoupler is light-coupled, not voltage-coupled) — but in a real isolated supply you would never short them. The 4N35 is rated 5 kV transient isolation between input and output.