# How To Use a Diode?

Hi all!

I am building a quadcopter using an Arduino Nano and I have all four motors working perfectly. I am using an external 7.4V battery to power both the motors and the arduino and it works just great.

I am using diodes (1N4004) to protect the Arduino from back EMF voltage generated by the motors. My (limited) understanding is that DC motors generate electricity when they spin, and this electricity can go reverse direction through the circuit and can fry the Arduino if you don’t use diodes.

I have the diode working using this configuration from a tutorial:

My question is: are there are any alternative places in this circuit I could place the diode to achieve the same result? I’m perfectly happy with how I have it working now, I’m just asking out of curiosity so I can understand how diodes work and how I can better use them in the future. Right now, all I know is that they prevent electricity flowing in the wrong direction by magic, so I would like to understand them a bit better

Could you give me examples of how you use diodes in your own circuits, and where you are putting them? My background is mainly in the programming side of things, my knowledge of how electrical engineering works is rudimentary (but growing every day).

Thanks!

Its nothing to do with the backEMF due to the motor’s rotation, thats just a function of
the motor speed.

Its the inductive kick-back when trying to interrupt the current rapidly (within microseconds)
that would otherwise likely destroy the transistor and maybe other semiconductors in the
circuit. The diode goes across the motor to allow the current an alternate path to flow at the
instant the transistor switches off. Without it 100’s or even 1000’s of volts could be generated.

Thanks so much for the info Mark! I have one more question for you. I have switched the design of a quadrocopter that I am building to use brushless motors with an ESC. The only connection is like a servo connection from the ESC. Would I use a diode here? There is a GND connection and a digital output connection but that's it.

The ESC is the complete motor driver, it takes a single logic signal input, there's no power electronics involved on that port. You probably want to add a serial resistor on that line to protect the Arduino should the ESC blow up (yes they can fail spectacularly).

Diodes are used to protect against inductive kick back, so they go where the current needs to flow when a switch opens.

MarkT:
The ESC is the complete motor driver, it takes a single logic signal input, there’s no power
electronics involved on that port. You probably want to add a serial resistor on that line
to protect the Arduino should the ESC blow up (yes they can fail spectacularly).

Diodes are used to protect against inductive kick back, so they go where the current needs
to flow when a switch opens.

That makes things easy, thanks!!

nightsd01: Right now, all I know is that they prevent electricity flowing in the wrong direction by magic, so I would like to understand them a bit better :grin:

Difficult to explain without going into complicated physics but it's not magic. Think of the current flowing in the diode a bit like water flowing over a dam.

In the case of your diode when operating in the forward direction the height of the dam is 0.7 V. If the voltage is less than that no water (current) flows over the dam. Any higher and the current flows, increasing rapidly as the voltage increases.

In the reverse direction the height of the dam is something over 50 V so with 5 V no current will flow. If you increase the voltage, at some point over 50 V current will again flow and unless it is controlled it will break the dam and destroy your diode.

That's very much simplified but I hope it helps.

Russell.