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.

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.

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?

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.

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.

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.

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