# Do I need to use a diode?

**URL:** <https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435>\
**Category:** General Electronics\
**Created:** [March 9, 2024, 10:37am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435 "2024-03-09T10:37:01Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliglass](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/aliglass/32/1013044_2.png) [@aliglass](https://forum.arduino.cc/u/aliglass)\
**Post date:** [March 9, 2024, 10:37am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/1 "2024-03-09T10:37:01Z")

</div>

Hi,

I am looking to use this pneumatic solenoid valve [https://www.amazon.co.uk/dp/B0943RSV8H?psc=1&ref=ppx\_yo2ov\_dt\_b\_product\_details](https://www.amazon.co.uk/dp/B0943RSV8H?psc=1&ref=ppx_yo2ov_dt_b_product_details) with this relay [https://www.amazon.co.uk/dp/B07GXBSX58?psc=1&ref=ppx\_yo2ov\_dt\_b\_product\_details](https://www.amazon.co.uk/dp/B07GXBSX58?psc=1&ref=ppx_yo2ov_dt_b_product_details) and an Arduino Uno R3. Do I need to use a flyback diode in this this scenario and if so, what specification and in which direction should it be connected?

Thank you in advance for any help.

Alistair

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [March 9, 2024, 11:44am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/2 "2024-03-09T11:44:25Z")

</div>

Yes. In fact 2 diodes because the valve has 2 coils.

When the current to a coil is cut off, the coil generates a voltage in the opposite direction to the voltage when the current was on. It is this voltage you need to short out with the diode, so that it doesn't damage or interfere with the rest of the circuit. So the direction of the diode should be anode to ground and cathode to +12V. If you connect it the wrong way around, it will simply short circuit the 12V power supply when you activate the relay, damaging the power supply and probably blowing the diode.

A diode from the 1N400X range is suitable. Choose one with a current rating above the coil current.

---

<div class="post-metadata">

**Author:** ![aliglass](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/aliglass/32/1013044_2.png) [@aliglass](https://forum.arduino.cc/u/aliglass)\
**Post date:** [March 9, 2024, 11:46am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/3 "2024-03-09T11:46:31Z")

</div>

Thank you Paul. I really appreciate your time and help.

Alistair

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [March 9, 2024, 11:54am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/4 "2024-03-09T11:54:02Z")

</div>

> [@PaulRB](#):
>
> 1N400X

Correction: the range is all rated for 1A but at different voltages. 1N4001 is rated for 50V so should be fine.

---

<div class="post-metadata">

**Author:** ![aliglass](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/aliglass/32/1013044_2.png) [@aliglass](https://forum.arduino.cc/u/aliglass)\
**Post date:** [March 9, 2024, 12:04pm UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/5 "2024-03-09T12:04:17Z")

</div>

> [@PaulRB](#):
>
> 1N4001

Thanks Paul

---

<div class="post-metadata">

**Author:** ![MarkT](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@MarkT](https://forum.arduino.cc/u/MarkT)\
**Post date:** [March 10, 2024, 8:27am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/6 "2024-03-10T08:27:59Z")

</div>

That relay board will have the diodes built in to every channel. It is opto-isolated so no extra precautions are needed.

---

<div class="post-metadata">

**Author:** ![aliglass](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/aliglass/32/1013044_2.png) [@aliglass](https://forum.arduino.cc/u/aliglass)\
**Post date:** [March 10, 2024, 9:39am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/7 "2024-03-10T09:39:07Z")

</div>

Thank you Mark

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [March 10, 2024, 9:50am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/8 "2024-03-10T09:50:13Z")

</div>

Hi,  
TIP, Buy 1N4007 diodes, same price as the other 1N400X series, but 1KV.  
They will cover 99% of your projects.

Good to have in the junk box, buy them by the 100.  
I have along with 10K resistors.

Tom.. 😀 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [March 10, 2024, 9:56am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/9 "2024-03-10T09:56:28Z")

</div>

@aliglass  
@PaulRB is correct. You should have diodes across the solenoid coils. The relay board does not have them

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [March 10, 2024, 10:12am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/10 "2024-03-10T10:12:43Z")

</div>

> [@MarkT](#):
>
> That relay board will have the diodes built in to every channel.

Those diodes only protect the circuit from reverse voltage from the coils inside the relays themselves. They won't protect the circuit from reverse voltage from external coils attached to the relays.

Being opto-isolated can help protect, but if @aliglass has a common ground between the Arduino circuit and the 12V supply, then the opto-isolaton is pointless.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [March 10, 2024, 10:18am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/11 "2024-03-10T10:18:14Z")

</div>

> [@TomGeorge](#):
>
> 1N4007 diodes, same price as the other 1N400X series, but 1KV

Slightly of-topic question: if higher rated diodes are the same price, why make a range that includes lower rated models? The others must have some advantages, I assume. Like maybe leakage current, voltage drop...?

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [March 10, 2024, 10:23am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/12 "2024-03-10T10:23:17Z")

</div>

Hi,

> [@PaulRB](#):
>
> Slightly of-topic question: if higher rated diodes are the same price, why make a range that includes lower rated models?

You tell me, they may have different prices when you buy then by the millions.

Tom... 😀 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [March 10, 2024, 10:34am UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/13 "2024-03-10T10:34:06Z")

</div>

> [@TomGeorge](#):
>
> You tell me, they may have different prices when you buy then by the millions

I guess so. The [data sheet](https://www.vishay.com/docs/88503/1n4001.pdf) doesn't indicate any other differences that I can see:

 ![Screenshot_20240310-103211](https://europe1.discourse-cdn.com/arduino/original/4X/6/2/1/62120d0dbff9a7e496e5bbcd56b503dcac62e7ae.png)

---

<div class="post-metadata">

**Author:** ![Wawa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wawa/32/1211303_2.png) [@Wawa](https://forum.arduino.cc/u/Wawa)\
**Post date:** [March 10, 2024, 8:10pm UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/14 "2024-03-10T20:10:28Z")

</div>

I read somewhere that there are two ways of manufacturing. The 4005-4007 falling in the second group. The article stated that the 4001-4004 group has a slightly faster 'on' time. The 1N4004 is my go-to choice for low voltage projects, and the 1N4007 is only used for mains voltage.  
I stock four diodes that cover most of my needs. 1N4148, 1N4004, 1N4007, 1N5819 (Schottky).  
Leo..

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 6, 2024, 8:10pm UTC](https://forum.arduino.cc/t/do-i-need-to-use-a-diode/1233435/15 "2024-09-06T20:10:50Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
