Question about the basic arduino circuit for a motor.

Hey folks –

In the basic tutorial set-up for spinning a motor, you see a breadboard layout like at the following link. . .

Breadboard layout.

The associated circuit diagram.

I created a circuit that looks like the attachment. In the autodesk-circuits page (similar to fritzing), it works just fine. Then again, it works fine if I just connect 5v and GND to the motor. I know the transistor and diode are there for a reason.

I don’t understand why the circuit from the example seems to have “extra” connections.

For instance, in my diagram (I’m a total electronics noob, so this might sound silly), I imagine that current flows from 5V to the transistor, out of the transistor, through the diode, into the motor, and back to ground. The diode prevents current from flowing “backwards” when the motor slows slow and damaging my board. I just don’t know why I need anything else to make this work and work safely.

THEIR diagram has an “extra” loop in it, for lack of a better term. Can someone explain why theirs has that, and what the problem with my circuit is?

Thanks.

I also understand that my 5v and GND are reversed from theirs, but I don’t think that’s an issue. It was just the neatest way for me to run the wires.

Well,

What you did was pretty much the opposite of what was shown as an example. secondly, your Diode is supposed to go ACROSS the motor pins. The way you have it... it just control directional flow... which was not why it was there in the original design and now serves no purpose.

|500x263

This is what they drew in the breadboard design and was explained in the second image.

You actually drew a PNP Based circuit (A SOURCE DESIGN) versus the SINK design and confusing the two is not good for a noob.

Look carefully. The diode goes ACROSS the motor to allow for reverse voltage spikes to escape when the power is removed by the transistor switch from the motor. (Its what "coils" do)

NOTE: There are some pitfalls with the SOURCE design using PNP's that are not immediately obvious. In the relay drawing I showed (Which would be the same for a motor) I can use a 12V supply for the motor... You cannot do this with the PNP design you drew without extra parts added.

Thanks.

I’m still curious though. I KNOW I didn’t do what they said. That’s what I’m asking about. At least in the autodesk my design works fine. I’m wondering what’s wrong with it besides “it’s different than what they did.”

They said this, “There is a diode connected across the connections of the motor. Diodes only allow electricity to flow in one direction (the direction of their arrow).”

But, you said, “The way you have it… it just control directional flow… which was not why it was there in the original design and now serves no purpose.”

That confuses me. Believe me, I’m trying to boil this question down to the essence of what I don’t get. . .

When you’re talking about “soldering across the motor” are you talking about something like my new attachment. . .literally going across the motor? (pretend that there’s one wire coming into either side that splits to the motor and the diode) I know that’s not a perfect representation, but it’s the neatest real world example I could find of what I’m picturing.

So, now, I gather that when the motor tries to reverse the flow, that’s handled by the diode in it’s own little circuit? That is, the negative flow just gets “eaten up” in that little motor-loop without getting back to my board

But, what I was trying to do. . .that is, just put a diode “in line” (in series?), well. . .I don’t know what it does. I was trying to stop the motor from reversing the flow into the board, but it seems like you’re saying it doesn’t do that. I know it doesn’t matter in the big picture. I’m not going to build my wrong circuit. I’m just trying to learn something more general.

The diode... as shown in my supplied circuit, performs that routing of the reverse induced motor/relay voltage from the coil... sending it back to V+ instead of smacking onto the "collector" pin of the transistor where the high voltage will exceed the reverse breakdown voltage of the transistor... eventually causing it to fail from abuse.

Kickback voltage from coils can briefly be extremely high voltage compared to the locl operating voltages.

Note: You also had your PNP plugged in backwards

TheCityGame: At least in the autodesk my design works fine.

Your definition of "works fine" is flawed. The simulator simulates the physics, not the logic. Your circuit is valid in the sense you can connect components any way you want. However, the circuit as designed is incorrect. The simulator doesn't know that.

TheCityGame: They said this, "There is a diode connected across the connections of the motor. Diodes only allow electricity to flow in one direction (the direction of their arrow)."

But, you said, "The way you have it... it just control directional flow... which was not why it was there in the original design and now serves no purpose."

That confuses me. Believe me, I'm trying to boil this question down to the essence of what I don't get. . .

Your circuit has a diode in series with the motor, but current was only going to flow one way anyway, so its pointless.

Without the free-wheel diode across the motor you'll destroy your circuit - any attempt to suddenly shutoff the current through an inductive load will cause large voltages - unless you provide a safe path for the current to continue (and diminish slowly). This is because current in an inductor has stored energy associated with it (due to the magnetic field), and that energy has to go somewhere, and if you suddenly shut off the current the energy has to go somewhere very fast (ie with very high power).

Inductors will generate whatever voltage is necessary - 100's, 1000's or 10000's or more depending on the scale of things.

BTW use a 150 ohm base resistor, not 1k, for driving a motor via a 2N2222.

(just saw other responses. thanks).

To willard -- I figured out what you meant about the PNP. I had to google it. I just grabbed the first transistor I saw in the component list when "building" that. I put in the "N" transistor.

I think I found a picture of truly soldering across the motor. . .

http://cdn.instructables.com/FJB/7D8M/H1ZG8IPG/FJB7D8MH1ZG8IPG.LARGE.jpg

I won't bug you with any more questions, but understand, when I say "noob", I mean "NOOB". . .like, I haven't looked at a circuit diagram in my life until about a month ago when I got an arduino, so I don't necessarily understand how that circuit diagram translates to the breadboard, or the real world (but I'm starting to). I'm coming at this from a a math and programming background, and I know I'm basically doing the equivalent of asking how to write a "for loop".

It's in good faith, though. . .I'm trying not to be a "copy & paster" when it comes to code or wiring, so this was prompted by my confusion over why the diode had to go across the motor, instead of just anywhere in the circuit.

Thanks.

MarkT -- yes, I'm starting to see why my diode was pointless.

Well, your "drawing" would only have worked if it WAS a PNP and wired as a source switch... but I now leave that up to something you can research