Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use 4N35: Examples, Pinouts, and Specs

Image of 4N35Design with 4N35 in Cirkit Designer

Introduction

The 4N35 is a versatile optocoupler or optoisolator IC that consists of an infrared emitting diode coupled to a phototransistor. It is designed to provide electrical isolation between its input and output, allowing a signal to be transferred between two isolated circuits without a direct electrical connection. This isolation helps protect sensitive electronic components from voltage spikes and surges, as well as reducing electrical noise in signal processing.

Explore Projects Built with 4N35

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of STM32 Nucleo-Controlled Solenoid Actuation System: A project utilizing 4N35 in a practical application
STM32 Nucleo-Controlled Solenoid Actuation System

This circuit appears to be a microcontroller-driven array of push-pull solenoids with flyback diodes for protection. The STM32 Nucleo F303RE microcontroller's GPIO pins are connected to the gates of several nMOS transistors, which act as switches to control the current flow to the solenoids. A pushbutton with a pull-up resistor is also interfaced with the microcontroller for user input, and the power supply is connected to the solenoids with ground return paths through the nMOS transistors.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Name Description
1 Anode (A) Anode of the infrared LED. Connect to positive voltage.
2 Cathode (K) Cathode of the infrared LED. Connect to ground.
3 NC No connection.
4 Emitter (E) Emitter of the phototransistor. Typically connected to ground.
5 Collector (C) Collector of the phototransistor. Connect to the output circuit.
6 Base (B) Base of the phototransistor. Optional use for increased sensitivity.

Usage Instructions

How to Use the 4N35 in a Circuit

  1. Input Side (LED):

    • Connect the anode to a digital output pin of a microcontroller through a current-limiting resistor.
    • Connect the cathode to the ground.
  2. Output Side (Phototransistor):

    • Connect the collector to the positive supply of the isolated circuit through a load resistor.
    • Connect the emitter to the ground of the isolated circuit.
  3. Base Connection (Optional):

    • The base pin can be left unconnected for normal operation.
    • For increased sensitivity, a resistor can be connected between the base and the emitter.

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

FAQs

Q: Can I drive the 4N35 directly from a microcontroller? A: Yes, you can drive the LED side of the 4N35 directly from a microcontroller pin through a current-limiting resistor.

Q: What is the purpose of the base pin on the 4N35? A: The base pin allows for increased sensitivity and faster switching speeds when used, but it is optional for normal operation.

Q: How do I choose the value of the current-limiting resistor for the LED? A: The value can be calculated using Ohm's law: R = (V_supply - V_forward) / I_forward, where V_supply is the voltage from the microcontroller pin, V_forward is the forward voltage of the LED (typically 1.2V), and I_forward is the desired forward current (usually around 10mA).

Q: Can the 4N35 be used to switch AC loads? A: While the 4N35 itself cannot switch AC loads, it can be used to drive a relay or triac which in turn can control an AC load.

Example Code for Arduino UNO

// Example code for interfacing a 4N35 Optocoupler with an Arduino UNO

const int ledPin = 13; // LED connected to digital pin 13
const int optoPin = 2; // Optocoupler input connected to digital pin 2

void setup() {
  pinMode(ledPin, OUTPUT); // Set the LED pin as output
  pinMode(optoPin, OUTPUT); // Set the optocoupler pin as output
}

void loop() {
  digitalWrite(optoPin, HIGH); // Turn on the optocoupler (LED on)
  digitalWrite(ledPin, HIGH);   // Turn on the LED
  delay(1000);                  // Wait for a second
  digitalWrite(optoPin, LOW);   // Turn off the optocoupler (LED off)
  digitalWrite(ledPin, LOW);    // Turn off the LED
  delay(1000);                  // Wait for a second
}

This example demonstrates how to turn on and off the LED inside the 4N35 optocoupler using an Arduino UNO. The same signal is used to turn on an LED connected to pin 13 to provide a visual indication. Remember to include a current-limiting resistor in series with the optocoupler's LED.