Mood CUE- Servo doesnt move

Hei everybody, I am back.

Working on project #5. Issue: Servo doesn't move-serial monitor shows: angel: 0potVal: 0, angel: 0potVal: 0, angel: 0potVal: 0, `

Watched the video on YouTube and the code is alright-no errors occur.
Here my code.

#include <Servo.h> 
Servo myServo;
int const potPin = A0;
int potVal;
int angle;
void setup() {
  myServo.attach(9);
  Serial.begin(9600);
}
void loop() {
  potVal = analogRead(potPin);
  Serial.print("potVal: ");
  Serial.print(potVal);
  angle = map(potVal, 0, 1023, 0, 179);
  Serial.print(", angel: ");
  Serial.print(angle);
  myServo.write(angle);
  delay(15);
}

I hope you can follow my wiring.


What is the matter here? :smiley:

Please transform the pictures into schematics.
If A0 reads a zero then the rest is logical. Use a DMM to check things up around the pot.
Powering a servo that way, through a breaboard is not good. Breadboards are not recommended for power distribution.
Using USB the current limit is some 0.5 Amp. How much does the servo draw? Datasheet please.

Hi @Railroader. T. Sorry I am beginner. Rookie. Starter Kit Arduino. Sorry to say, but your post doesn't get me anywhere further. Why?

Schematics-How?
DMM-What?
Breadboard isn't good-Why? The wiring isn't my idea. It's just after the book.
Datasheet-Where? Supply is from Arduino Starter Kit. Bottom line, there is no datasheet.

Any idea mate @PerryBebbington and @build_1971

Pen, paper, camera and post it.

Voltages around the pot and at A0.

Often poor contact, not good enough for motor currents.

From kit data or manufacturer.

That's bad. Hard to give You good replies.

The red positive supply wire at the top left of the first photo disappears off the side and appears not to be connected to anything.

However, to repeat what has been said: please post a schematic.

See

DMM means digital multimeter, probably ÂŁ20 for a basic one, well worth every penny. Please buy one.

Have you turned the pot?
It is on the 0 postion and you are reading 0 from A0...

What type of servo do you have?

Does the tutorial really recommend 100uF capacitors?
Or maybe 100nF...

Hi mate @PerryBebbington thank you for reply. Just for the bigger picture. I am beginner, just a few weeks ago I have started. So, all from stretch-no (real person) is sitting right next to me.

Indeed! You are right. The power line wasn't plugged in the 1st image. Sorry, I did plug back in-no change.

Quote on quote: "However, to repeat what has been said: please post a schematic." Like I mentioned before, unfortunately I can't provide with that. I don't know how to do it. So, if you have a great editorial or tutorial to get the schematic it, I am more than welcome. :slight_smile: I just do have schematic from the book.

Great post! Yep, I have read it and know from a previous forum post.
Alright DMM=digital multimeter. Now I get it. I have just literally bought one.


But I am afraid to say, I don't know how to use it yet. Any good tutor of YouTube

Hi @build_1971 great to have you on board. :blush: Yes, I did. In fact, I was surprised about this paraphrase out of the booklet because even I have never touched the pot, the number shall be like that.

I am not sure. I, guess I found it but no datasheet like @Railroader was asking after.


Jep! 100uF. :slightly_smiling_face:


Sorry I did tell you that mate @PerryBebbington. The reason I hooked you in that chat now and before is, I am a beginner. Just right of the gate, like I mentioned above. I found your name in the forum “about” section. So, I thought maybe he could be the ONE to push me forward and where I could learn from you :blush:

So, did you try to turn the pot while watching the values on the serial monitor?

2 Likes

It is not really recommended to run servos from the arduino 5V pin.
But this small one should work...

I know you are, and I like to see beginners progress from not having a clue to learning new and interesting stuff, it is one of the things that keeps me interested in this forum.

I gave you a link to my 'how to get the best out of this forum' tutorial. Read it please, it has a bit about schematics, including a link to another tutorial to help you draw a schematic. I am not going to repeat that advice here, as the tutorial is much better than anything I could put here. Without a schematic the help you get won't be very good.

In case you missed the point: it helps that you provide a schematic of what you have created, not just a copy of what is in the book or whatever; we want to see what you actually made, not the instructions you tried to follow.

Thank you but the reason I am in the 'about' section is that I am a moderator. Being a moderator means I get rid of spam and spammers, it means that when people post rude comments I remove the comments and sometimes I remove the people making them. It does not mean I have extra special knowledge. Many of the regular posters here have far better and more relevant knowledge than I do.

I suggest you disconnect the servo completely and just get the pot working, when you turn it the readings in the serial monitor should change. Get that to work then add the servo.

I have just seen this:

I would be so easy :blush: but yes I did @build_1971 .
I have just double-checked it and I have done it once again. Values are all time 0. I do have a DMM now. Should I check something with DMM?

Good to hear. :blush: Any check and info you want to know? What I could do for you?