Pages: 1 [2] 3   Go Down
Author Topic: Potentiometer to change speed of DC motor  (Read 4547 times)
0 Members and 1 Guest are viewing this topic.
Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The left red wire is going to ground, the center to the motor, and the right one also to the ground.

edit: I just checked the wiring again, and everything is right connected like the wiring diagram in the book.
« Last Edit: March 14, 2012, 11:07:16 am by TiboJ » Logged

Northern California (by San Francisco)
Offline Offline
Sr. Member
****
Karma: 2
Posts: 251
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, AWOL's code confirmed that your pot is working correctly. So your using a 25k pot instead of a 10k pot is not a problem.

Your code looks fine. But it appears that your motor is getting full power, or nearly full power, most of the time. Somehow I think your transistor or motor wiring is wrong. I cannot see anything wrong from your picture. I'll keep looking.
Logged

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Already thank you for help all!

I'm sure it's wired the right way, and I have checked it like 20 times now.
I will try another motor.
Logged

Northern California (by San Francisco)
Offline Offline
Sr. Member
****
Karma: 2
Posts: 251
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 14, 2012, 11:38:16 am by TiboJ » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 241
Posts: 24480
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Northern California (by San Francisco)
Offline Offline
Sr. Member
****
Karma: 2
Posts: 251
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, it's working now! smiley-mr-green

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.
(http://arduino.cc/forum/index.php/topic,96310.msg723031.html#msg723031)

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!!
Logged

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok this works also!! smiley-grin

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!
« Last Edit: March 14, 2012, 01:07:11 pm by TiboJ » Logged

Northern California (by San Francisco)
Offline Offline
Sr. Member
****
Karma: 2
Posts: 251
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 14, 2012, 01:08:25 pm by Daanii » Logged

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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-grin

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

Up to the next project! smiley-mr-green

« Last Edit: March 14, 2012, 01:14:29 pm by TiboJ » Logged

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I added a fan to it smiley
Here is a video:
Logged

Northern California (by San Francisco)
Offline Offline
Sr. Member
****
Karma: 2
Posts: 251
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 211
I love Arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink

I had placed a diode to avoid the reverse current.
Logged

Northern California (by San Francisco)
Offline Offline
Sr. Member
****
Karma: 2
Posts: 251
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Pages: 1 [2] 3   Go Up
Jump to: