I have encountered a problem with running the potentiometer-controlled servo.

The circuit connections were checked physically (visual inspection x 3) and electrically - with continuity tester for connections to power-supply terminals and the Arduino pins

The output from the potentiometer wiper was checked with a 4 ½ digit autoranging multimeter to check that it was 1) connected properly to +5V supply, 2) outputting a variable voltage.The pot wiper is outputting a variable voltage from 0V dc to 4,77V dc depending on wiper position, which seems correct.

No other connections are relevant and all connectivity has been checked.

Uploading the program compiles without notified errors and uploads (apparently) correctly -

Observations: 1) upon upload, the servo shocks three times and positions itself at roughly 85 degrees; when settled there, it remains constant and no potentiometer input makes any difference to it although the voltage can be seen to vary from the pot wiper.

void loop() { val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180) myservo.write(val); // sets the servo position according to the scaled value delay(15); // waits for the servo to get there }

I do not see how to supply copy of circuit as JPG or PNG here but address for ref which shows it is:http://www.arduino.cc/en/Tutorial/Knob

FV, your problem is your circuit. I just checked the sketch and it works fine!

For what it's worth, I found that remaking the circuit again a little later using comletely different positions on the board tended to solve things like this. In fact, the only problems I had completing the starter kit were physical, ie either me wiring things in the wrong way or because of badly fitting components.Good luck!

I had problems with this circuit aswell try googling the servo motor you have and take note of the pinouts the servo motor I have is wired in the plug different to the circuit. It looks like the pins have been put in the wrong holes on the plug reconfigured and all ok.

I cut and paste the code you posted, hooked up an HXT900 servo ala the "knob" circuit and it worked as advertised. There is nothing wrong with the code which must have been used a zillion times by now. I use a modified version of that very sketch to run two servos with a 2-pot joystick: no problems.

I don't know what servo comes with the kit though: it might be that it needs more current than the Arduino is happy to supply. Maybe try hook it up with its own power supply, ala attached pic? Edit.... quite a lot of servo "funnies" like disobedience and the shakes can be corrected by a better power supply: so it's a common thing to sort out soon as you experience a problem. If nothing else, it eliminates one possible source of the problem, and who knows, often it fixes it.... (Although it's strange in your case that "sweep" works which would tend to exonerate the power supply and the servo and the connections.)

Jim

PS.... to attach pix to posts, click the Additional Options link just below the typing area.