Potentiometer to change speed of DC motor

I doubt that it is your motor.

Can you use your multimeter to check your power supply wiring? Make sure that what you think is positive is indeed positive. And what you think is ground is ground.

I tested another motor and no luck with that.

The wiring of the power source is also good, I tested the connections with my multimeter.

edit: I will try another power source now.

Can you simply turn the motor on and off using a digitalWrite to the transistor pin?

AWOL's suggested test should tell you a lot.

Apart from that, although the picture of your wiring is not real clear, I could not find any wiring problems either. Is your diode in the right way? It looks right, and I'm sure you checked, but I'll ask anyway.

Okay, it's working now! :grin:

All I did was connecting another power source, so the problem was the 2,1mm plug and socket power source.

So why would the circuit with the 2,1mm plug and socket not work? Maybe do I connect it wrong?
I started a topic about it yesterday, and someone told me to connect to front pin to V+ and the two backpins to the GND, and that is what I did and that is the reason it not worked first.
(Wiring an 2.1mm DC Barrel Jack - General Electronics - Arduino Forum)

It would be nice if it worked with the 2,1mm socket. Maybe do you guys now how to connect a 2,1mm plug and socket in the circuit?

Big thanks!!

Ok this works also!! :smiley:

I used my multimeter to look which one is the positive leg, and it is one of the back pins. The front pin is the negative leg.
So the negative and positive pins were switched.

Thank you all for the help!

Turn the socket sideways on your breadboard and it might work.

The way you had it in your pictured wiring, the front pin and the back pin were in the same row on the breadboard. But that should have shorted the power supply. So I'm not sure what is connected to what.

You should be able to figure it out using your multimeter as a continuity tester. Just make sure all three pins of the socket are in separate rows on the breadboard. Then find out what connects to what. As people told you in the other thread, one pin will be different than the other two.

Good to hear that you got the project working. Troubleshooting can be frustrating, but it's always fun when you actually do shoot the trouble and fix the problem.

EDIT: I see you already did something better than what I suggested. Good work.

Good to hear that you got the project working. Troubleshooting can be frustrating, but it's always fun when you actually do shoot the trouble and fix the problem.

That's true, and that's how you learn the most.
And the 2,1mm socket is also working now(see my previous post) :smiley:

btw: the pins weren't in the same row, but it looks like that because the picture is not very clear :wink:

Up to the next project! :grin:

I added a fan to it :slight_smile:
Here is a video:

Nice video!

You will want to be very careful with reverse polarity. DC motors don't mind which direction the current is going. Most circuits won't be so forgiving. I've burned out some expensive parts by mixing up power connections. Hope you do not.

Daanii:
Nice video!

You will want to be very careful with reverse polarity. DC motors don't mind which direction the current is going. Most circuits won't be so forgiving. I've burned out some expensive parts by mixing up power connections. Hope you do not.

Thank you :wink:

I had placed a diode to avoid the reverse current.

TiboJ:
I had placed a diode to avoid the reverse current.

As I understand it, the diode in your circuit takes care of back EMF. It does not do anything to prevent reverse polarity. In fact, current was flowing, and your motor seems to have been spinning merrily backwards with reverse polarity. Motors are good that way.

But if you send reverse polarity into a chip like an accelerometer (like I did), you may see it burn out (like I did). Even then, as we talked about, you learn from things like that (like I did).

Daanii:

TiboJ:
I had placed a diode to avoid the reverse current.

As I understand it, the diode in your circuit takes care of back EMF. It does not do anything to prevent reverse polarity. In fact, current was flowing, and your motor seems to have been spinning merrily backwards with reverse polarity. Motors are good that way.

But if you send reverse polarity into a chip like an accelerometer (like I did), you may see it burn out (like I did). Even then, as we talked about, you learn from things like that (like I did).

Yes you're right, it's protecting it from back EMF, and not from the reverse polarity.
Thank you for the tip :wink:

Can someone explain me how a potentiometer can change the speed of a dc motor?
I like to know how things work :slight_smile:

Arduino Tutorial Series – JeremyBlum.com Arduino Tutorial Series – JeremyBlum.com i think its like video 4 or 5 this guy has some awesome videos and other project stuff i do think most seasoned arduino users know of him well and for me just opening the door to c type coding and micro controllers i would have to say he is a god among teachers check out some of his helpful things on basic motors and speed control its all in there !!!!!! my favorite is the project section on his web site

ez8mm:
Arduino Tutorial Series – JeremyBlum.com Arduino Tutorial Series – JeremyBlum.com i think its like video 4 or 5 this guy has some awesome videos and other project stuff i do think most seasoned arduino users know of him well and for me just opening the door to c type coding and micro controllers i would have to say he is a god among teachers check out some of his helpful things on basic motors and speed control its all in there !!!!!! my favorite is the project section on his web site

I already heard of him, but never looked on his website.
Now I will do! Thanks! :wink:

I can't find anything about the potentiometer.

Maybe someone can explain it to me, how does the potentiometer change the speed of the motor?
Is it just because the Arduino reads the value from the potmeter, and then sends the value to the motor?

Yes, in your circuit the Arduino just reads the potentiometer to get a control value. It then takes that digital number, processes it, and uses the result to control the motor. So it is more a software control scheme than a hardware control scheme. In other words, the potentiometer does not electronically control the speed of the motor.

Daanii:
Yes, in your circuit the Arduino just reads the potentiometer to get a control value. It then takes that digital number, processes it, and uses the result to control the motor. So it is more a software control scheme than a hardware control scheme. In other words, the potentiometer does not electronically control the speed of the motor.

Okay thank you for explaining me! :slight_smile: