# Linear Potentiometer Motorised

Hello! I need a bit of help. I have a linear motorized potentiometer, where I need to control the movement ( of going up and down) however I'm stuck on how to wire it up to the Arduino and what code I need. Would someone be able to help?

Yes. You can help.
Post a link to the spec for the device you have.
Without that, there is little we can offer with regards to how to drive the motor or read the potentiometer.

Hi,

This is what I have:

Sorry I meant this :

https://uk.rs-online.com/web/p/potentiometers/1348199/

You really need to supply on the URL for the device: https://uk.rs-online.com/web/p/products/7703093/, Not all the rest of the stuff.

From that data sheet, you already know it needs 6-11 volts DC to operate and needs 800ma to move at all. So, you need an H-bridge that can control 1 amp DC at approximately 10 volts. And you need a power supply that can supply 10-11 volts at 1 amp or more.

When you have that, then worry about connecting it to the Arduino.

Paul

Yes, I have all of those- but I am not sure what goes where!

MB94:
Yes, I have all of those- but I am not sure what goes where!

I expect that your H-bridge has connections that are intended to go to a motor (or more than one). The potentiometer has connections to its motor (the 2 pin socket A,B). Connect the motor outs from the driver to the motor ins on the pot and you're in business.

Then just drive it like any other DC motor...there are examples of code in the IDE and all over the web.

Steve

Thanks! I have managed to connect everything but now I need help controlling how much the motor can move, to control how much linear potentiometer I can move This is my code so far:

void setup() {

//Setup Channel A
Serial.begin(9600);
pinMode(12, OUTPUT); //Initiates Motor Channel A pin
pinMode(9, OUTPUT); //Initiates Brake Channel A pin

}

void loop(){
int sensorValue = analogRead(A0);
//forward @ full speed
digitalWrite(12, HIGH); //Establishes forward direction of Channel A
digitalWrite(9, LOW); //Disengage the Brake for Channel A
analogWrite(3, 225); //Spins the motor on Channel A at full speed

delay(3000);

digitalWrite(9, HIGH); //Eengage the Brake for Channel A

delay(1000);

Do you think you'll be able to help?

Thanks!

When posting code, use the code tag. It makes code easier to scroll through and easier to pull in to the IDE.

It looks like you did not post the entire sketch.

You posted code. Does it do what you want. If so, YAY!
If not, please explain what you expect it to do and what it actually does that differs from your expectations.

Thanks, I have attached the code and the circuit, what I need help with:

Q1. The slider moves slightly but does not that much, I need help with moving the slider more and controlling how much I can move the slider by.

I hope that makes sense

Thanks!

Motor_Moving_v1.ino (560 Bytes)

circuit image.pdf (177 KB)

MB94:
I have attached the code

Don’t do that.

Post it as code, using code tags. That way we do not have to download it. It is in a scrollable window and it is easy to load in to the IDE or test editor.

and the circuit

Read through this handy image guide.
If you save it as an image format rather than a PDF, you can embed the image into the post making it easy for us all to see, again without the need to download files.

circuit image.pdf (177 KB)

``````void setup() {

//Setup Channel A
Serial.begin(9600);
pinMode(12, OUTPUT); //Initiates Motor Channel A pin
pinMode(9, OUTPUT); //Initiates Brake Channel A pin

}

void loop(){
int sensorValue = analogRead(A0);
//forward @ full speed
digitalWrite(12, HIGH); //Establishes forward direction of Channel A
digitalWrite(9, LOW);   //Disengage the Brake for Channel A
analogWrite(3, 700);   //Spins the motor on Channel A at full speed

delay(3000);

digitalWrite(9, HIGH); //Eengage the Brake for Channel A

delay(1000);

}
``````

I hope this is works