Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Turning pot with servo...

Status
Not open for further replies.

Diy1995

Member
Hello,
I would like to make "redneck" digital potentiometer.
My plan is attaching servo on top of potentiometer. Connecting servo to arduino and than connecting two push buttons for up/down.
Than I would need the code that at a press of a button servo would rotate for about 20 degree clockwise everytime that I press up button and counterclockwise for down button.

What would be the code for this? I'm a complete noob in programing.

Thankyou
 
What servo motor are you using ?

Just be careful if its a 5v type and you power it from the Arduinos +5v supply as many of those examples show; if its a large motor it might need its own direct supply rather than overload the Arduinos regulator which can only give out about 450ma max, a lot less in continuous use.
 
Most servos have a pot to provide position feedback for the servo...
 
You simply send out the code for each 20 degrees. I did it with a PIC chip to raise and lower boom gates very slowly.
 
Hello, I thinked this over and servo it's not good for me because it wont remember last position when turned off.
However I already have servo without pcb inside (just motor and gearings) that I would like to use with a transistor. That way I would only need one pin to be gnd and other one to be + when as long as I press one button and than I would need arduino to change gnd and + between those two pins when I press the other button.
 
However I already have servo without pcb inside (just motor and gearings) that I would like to use with a transistor. That way I would only need one pin to be gnd and other one to be + when as long as I press one button and than I would need arduino to change gnd and + between those two pins when I press the other button.

That may look like a servo on the outside, but it is not a servo. You need feedback of position to make it a servo. Now, if you attach the output shaft to a pot and make a feedback circuit, you can make it into a servo. But, the cost of building that additional circuit will probably exceed the cost of getting a basic, cheap servo.

If you want to build that feedback amplifier, there are many designs available. First. you will need to define the signal you will be using.

John
 
That may look like a servo on the outside, but it is not a servo. You need feedback of position to make it a servo. Now, if you attach the output shaft to a pot and make a feedback circuit, you can make it into a servo. But, the cost of building that additional circuit will probably exceed the cost of getting a basic, cheap servo.

If you want to build that feedback amplifier, there are many designs available. First. you will need to define the signal you will be using.

John
Hello, thank you for your anwser.

It was a servo, than I removed it's pcb and blocking pin so it works like an ordinary motor.
And I want to use ordinary motor, because if I will use servo it will always return to it's original position when arduino will be turned off and on. If I use ordinary motor with transistors and program arduino to make for example pin7 LOW and pin8 HI when I press UP button and pin7 HI and pin8 LOW (reversed polarity) when I press DOWN button and both pins LOW when no button is pressed. The motor will stay on it's position when arduino will be rebooted.

I will use pot to control audio signal (subwoofer level, because have amp connected to my factory head unit).
 
Hello,
Than I would need the code that at a press of a button servo would rotate for about 20 degree clockwise everytime that I press up button and counterclockwise for down button.

If you still want to do what you describe in your original post (i.e., a fixed amount of movement for each press of a directional button), you need feedback from your motor to tell your arduino the servo's position. How do you propose to use a single transistor to do that? Have you drawn a circuit for it?

Servos without power do not return to their original position. True, power-off holding ability can vary greatly between different servo types, as resistance to movement is due mainly to the gear train and the motor. "Coreless" servos have very little holding ability without power. When you apply power, your servo will assume the position the programs tells it to assume. Maybe your arduino reboots in that "zero position" state. That is a programming issue, not a mechanical one.

John
 
If you still want to do what you describe in your original post (i.e., a fixed amount of movement for each press of a directional button), you need feedback from your motor to tell your arduino the servo's position. How do you propose to use a single transistor to do that? Have you drawn a circuit for it?

Servos without power do not return to their original position. True, power-off holding ability can vary greatly between different servo types, as resistance to movement is due mainly to the gear train and the motor. "Coreless" servos have very little holding ability without power. When you apply power, your servo will assume the position the programs tells it to assume. Maybe your arduino reboots in that "zero position" state. That is a programming issue, not a mechanical one.

John
I would use 4 transistors (h-bridge). I have read that alot of people have problems with their servo returning to zero state after turning arduino back on. It would be much more simple with the servo and if it would not turn back to zero position I will go for it.
I had not write any program or schematic for it yet.
 
A gearmotor would be better
s-l1600.jpg
 
What you need are two pots mechanically-coupled onto the same shaft turned by the gearmotor. You could do this if you find a pot with a thru-shaft, or you could use three spur gears (middle gear on gearmotor shaft, outer gears on two pot shafts).

Use one pot wiper connected to the AD input on the Arduino to position the gearmotor shaft (Arduino based servomotor), the other pot is used to control the audio...

ps, here are some "dual" pots (two pots on one shaft) that might work for you...

pps, you might need a linear pot for the position feedback, and an audio-taper for the audio control. Might be tough to find a "dual" like that.
 
Last edited:
servo with it's PCB removed
Have you tried it I have not had much luck with servo I had some cheap ones that I removed the stop and pcb and powered just the motor they died really fast running on 5 volts. The pcb board must have something on it that limits run time or something.
They work fine before I took the stop out to make them into gearmotors but they are dirt cheap $1.99 I had some good ones that worked fine after mod.
Mike's 2 pot idea is what you need. But real gearmotors Is what Id use.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top