Why should you use a diode in a relay driver circuit? (2024)

Circuits guide series

A relay is commonly used to drive large electrical loads. With a relay, your Arduino can control large motors, LED strips, lights, etc. But without a simple diode, your circuit can be easily damaged.

Why should you use a diode in a relay driver circuit? (1)

You can easily make a relay driver circuit with a transistor, a current limiting resistor (to turn the transistor on and off), and a diode in parallel with the relay coil.

The diode is often the cause of confusion: why do we need one?

I will explain...

Inductors

The coil of a relay device is that it is an inductor. An inductor will react to sudden changes in current by producing a large voltage across its ends.

To energize the relay, you must turn on the transistor so that current will flow between its emitter and collector. To de-energise the relay, you must turn the transistor off, which will interrupt the current flow between the emitter and collector.

This sudden change in the current that flows through the coil of the relay, will cause the coil to react. The result of this reaction is a large voltage across its leads.

Back-current suppression diode experiment

The diode is there to suppress this voltage so that it cannot damage any components around the relay, such as the transistor and the external battery supply (but also the controlling logic circuit, such as the Arduino).

To understand what is going on, I did a quick experiment on my oscilloscope.

I used two versions of a simple circuit with a coil, button, power supply and current limiting resistor (pictured below).

In the first version, I use a diode as a suppressor for the voltage spike in the coil.

In the second version, I did not use the diode.

Here are the two circuits:

Why should you use a diode in a relay driver circuit? (2)

I used a channel (blue)on my scope for the trigger, and the other (yellow)to capture the voltage around the coil. The Yellow line is the coil voltage, and the Blue is the voltage on the switch (the trigger). You can ignore the blue line in the screenshots below.

Here is what the capture looks like without the diode:

Why should you use a diode in a relay driver circuit? (3)

The capture with the diode:

Why should you use a diode in a relay driver circuit? (4)

Look at the voltages, especially the Vpp one (Vpp: Voltage Peak-to-Peak).

Which one is larger? The one with, or without the diode?

If you look at the ending part of the waveform for the yellow line, for both circuits the voltage will eventually stabilize at the same value. Therefore the longer term (after around 350ns) effect of the diode is negligible (if any).

But just after the moment I press the button and energize the relay coil, the first line (no diode) shows a much bigger (in this case, roughly double) peak-to-peak voltage compared to the second line (with diode).

As you can see, the addition of the diode in a circuit that contains any kind of coil (like in a relay or DC motor) will significantly dumpen back currents by limiting the effect of the voltage accross the ends of the coil.

The Tech Explorations Subscription program

Subscribe and access all of our video courses immediately.

With a catalog of 25+ premium video courses (and growing), this subscription gives you an amazing resource to boost your learning.

Learn more

Browse this article

Inductors

Back-current suppression diode experiment

Jump to another article


2. What is a bypass/decoupling capacitor?
3. What is the purpose of the diodes in a keypad circuit?
4. Logic level shifting
5. Why should you use a diode in a relay driver circuit?
6. Why use a voltage divider with a photoresistor?
7. Optoisolator: a simple way to electrically separate parts of a circuit
8. Use MOSFETs to drive large(ish) loads

New to the Arduino?

Arduino Step by Step Getting Started is our most popular course for beginners.

This course is packed with high-quality video, mini-projects, and everything you need to learn Arduino from the ground up. We'll help you get started and at every step with top-notch instruction and our super-helpful course discussion space.

Learn more

Why should you use a diode in a relay driver circuit? (6)

Done with the basics? Looking for more advanced topics?

Arduino Step by Step Getting Serious is our comprehensive Arduino course for people ready to go to the next level.

Learn about Wi-Fi, BLE and radio, motors (servo, DC and stepper motors with various controllers), LCD, OLED and TFT screens with buttons and touch interfaces, control large loads like relays and lights, and much much MUCH more.

Learn more

We publish fresh content each week. Read how-to's on Arduino, ESP32, KiCad, Node-RED, drones and more. Listen to interviews. Learn about new tech with our comprehensive reviews. Get discount offers for our courses and books. Interact with our community. One email per week, no spam; unsubscribe at any time

Join Tech Explorations

Why should you use a diode in a relay driver circuit? (2024)

FAQs

Why should you use a diode in a relay driver circuit? ›

The diode is there to suppress this voltage so that it cannot damage any components around the relay, such as the transistor and the external battery supply (but also the controlling logic circuit, such as the Arduino).

Why do we use diode in relay? ›

This switching from the relay coil is what allows the current to flow to the load. Diode: The diode is responsible for providing transient voltage suppression. The idea behind having a diode is to ensure a smooth transition between states when the relay is switched such that any transient voltage spike is suppressed.

What is the purpose of the diode in the drive circuit? ›

A diode is placed in parallel with the solenoid to protect the transistor from the inductive voltage spike that occurs as the solenoid de-energizes. A significant voltage drop between the power supply and solenoid may occur if there is unexpected resistance, such as long lead wires or other electrical components.

Where to put a diode on a relay? ›

The most common coil suppression technique in relays is to connect a reverse-biased diode in parallel with the relay coil. The cathode of the diode is connected to the + 5 V DC and the anode to the relay coil end that goes to the ground.

Why would you use a diode in a circuit? ›

A diode is an electronic component that directs the flow of electricity in a single direction. These are called "active components" and are basic components of semiconductors. They can regulate the flow of electricity, maintain a constant voltage, and extract signals from radio waves.

Should I use a resistor or diode for relay? ›

RELAYS WITH DE-SPIKING RESISTORS

High ohm resistors are sometimes used instead of diodes. A resistor is more durable than a diode and can suppress voltage spikes similar to a diode, but the resistor will allow current to flow through it whenever the relay is on.

How do you wire a relay with a diode? ›

Install a diode, P/N 12112422, across the coil of the relay. It is important that the striped end of the diode be connected to the positive terminal of the coil and the other end of the diode be connected to ground. Be sure to insulate the diode with heat shrink tubing before installing.

What are the three main uses of a diode? ›

Despite being nothing more than a simple two-pin semiconductor devices, diodes are vital to modern electronics. Some of their most common applications include turning AC to DC, isolating signals from a supply, and mixing signals.

What is a diode for dummies? ›

A diode is an electronics component made from a combination of a P-type and N-type semiconductor material, known as a p-n junction, with leads attached to the two ends. These leads allow you to easily incorporate the diode into your electronic circuits.

Do relays have built-in diodes? ›

Some relays have a built-in surge-absorbing diode (for DC coils). These diodes can also be externally installed.

Should diode go on positive or negative? ›

You could put it in either leg, but it's traditionally put in the wire between the positive power supply terminal and your power supply filter capacitor. That way none of the important signals in your circuit have that diode drop in ground path.

Does diode go on positive or negative? ›

Diode Functionality

We call the lead affixed to the N-type semiconductor the cathode. Therefore, the cathode is the negative side of a diode. In contrast, we call the lead connected to the P-type semiconductor the anode, which makes it the positive side of a diode.

When should you use a diode? ›

Diodes are used in circuit protection due to their ability to restrict electrical current to flow in only one direction. This trait is useful because some electrical components and devices will be damaged or malfunction if current flows in the wrong direction.

What happens if you turn the diode around in the circuit? ›

Current passing through a diode can only go in one direction, called the forward direction. Current trying to flow the reverse direction is blocked. They're like the one-way valve of electronics. If the voltage across a diode is negative, no current can flow*, and the ideal diode looks like an open circuit.

Can you bypass a diode? ›

When the switch is open the current would flow through the diode. Then once the swap has occurred the switch would be closed providing a path of lower resistance for the current to flow, bypassing the diode.

Top Articles
Latest Posts
Article information

Author: Clemencia Bogisich Ret

Last Updated:

Views: 6043

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Clemencia Bogisich Ret

Birthday: 2001-07-17

Address: Suite 794 53887 Geri Spring, West Cristentown, KY 54855

Phone: +5934435460663

Job: Central Hospitality Director

Hobby: Yoga, Electronics, Rafting, Lockpicking, Inline skating, Puzzles, scrapbook

Introduction: My name is Clemencia Bogisich Ret, I am a super, outstanding, graceful, friendly, vast, comfortable, agreeable person who loves writing and wants to share my knowledge and understanding with you.