Arduino starter kit - Project 9

I didn't understand the functionality of the diode in the project 9 of the Arduino Starter Kit. Can somebody explain me? Thanks

The diode allows current to flow only one way. There are hundreds of starter kits, and most of them have projects numbered 9. Please show the exact circuit you are working with if you want more specific information.

Woops! I didn't know. It's a project that allows a little engine to run both ways and with different speeds.
I leave the link of an Italian video (but he shows the project so the language doesn't matter) - YouTube

The diode is to protect the transistor from the reverse high voltage that is induced when the current to the motor is cut off.

It is called a flyback diode and its use is explained on this page.

Link is broken. Posting a copy of the circuit diagram here is better, that’s all we need to see. Much easier & quicker than opening a video and trying to find the relevant info in it.

If the motor runs BOTH ways there’s usually no place for a flyback diode - at least not a single one - as you’d be using some kind of H-bridge or motor driver.

In the project there wasn’t anything that could let the energy pass from the motor to the circuit, but the starter kit said to put it in.
I leave the image, I hope you can see it.

Did you read the page that I linked in reply #3? That explains the use of the diode and how a transistor works to switch current.

It's a project that allows a little engine to run both ways and with different speeds.

The motor can only riun in one direction with that circuit. You need an H bridge driver to get a motor to run in both directions.

image from reply #5

740a8f3ce2bd08306240f94960a13e11bbea2f47.jpg

My guess is that this does not allow the motor to run both directions.

vinceherman:
My guess is that this does not allow the motor to run both directions.

That's no guess, it's a certainty!

And why isn't the diode between the green and the red wire?

Where should the diode be to shunt the reverse EMF from the motor?

Between the green and the black wire i think... because if the motor sends back some energy on his black cable it would go on the green wire without any block, isn't it? Or the diode takes away energy so i don't have to put it between the two wires? Sorry I'm new on arduino :frowning:

That's not Arduino; that's motor control.

The flyback aka freewheel diode goes across the motor terminals (or the wires leading to the motor), providing a circuit for the EMF to dissipate when the motor is switched off. Just do a quick Google search on those terms and you'll find many tutorials explaining it in much more detail (that's anyway a serious advice: the moment you see a term you don't (really) understand, enter it as Google search and you're likely to find lots of explanation).

wvmarle:
The flyback aka freewheel diode goes across the motor terminals (or the wires leading to the motor)

Actually, and somewhat counter-intuitively, the correct placement for the diode is between the drain of the FET and the supply bypass capacitor.