one of those things that is obvious when it's explained, but not before:
- if you run a current through a wire, you generate a magnetic field
- if you pass a magnetic field across a wire, you generate a current
- if you pass a current through a coil of wire you get a larger magnetic field, because more wire
- if you cut off that current, the larger magnetic field collapses
- back into the coil
- generating a reverse polarity voltage spike back into the current source
- which explains the vast blue spark when you unplug a coil
and your Arduino eats that reverse spike. On an old Triumph motorcycle, 6 volt coils, I measured 321 V spikes when the points opened.
which is why NASA was insistent that the products they bought have a relay across the diode, with a high enough PIV Peak Inverse Voltage rating to shunt the voltage spike to ground or the regulated power supply:
you have the same situation on the load side. in the drawing above, if COM is a power source, and NO & NC both go to inductive loads, both NO & NC need a diode that is reverse biased to the load voltage, shunting the reverse spike from the load to ground. A diode on COM can't work, because it will be disconnected at the precise time i8t is needed.
it is called a commutating diode. this is not a particular kind of diode, like a zener or Schottky diode. It's a generic diode that is used to mitigate the effect of polarity reversal.
SSRs do not need commutating diodes on the 5 volt logic side, but use them on the load side.
A decent post, but the title is trying to make it sound important.
Adding a relay isn't a *pro* tip - it's fundamental.
Perhaps thread should be renamed -
WHY DO I NEED A DIODE ACROSS MY RELAY.
So... I shouldn't just wire a nano digital output directly to trigger a relay? It does trigger the relay but I have a project that I am working on and am new and not sure where to seek advice.
So... I shouldn't just wire a nano digital output directly to trigger a relay?
Unless it is a reed relay, drawing much less than 40mA, that's right, you must not connect the coil to an output pin.
But you don't want to be asking questions here, in six month old threads.