Using potentiometers to control resistance in motors?

I am relatively new to the world of programming with arduino so bare with me! :confused:

I was wondering if there were any suggestions as to how I could use an arduino to control the resistance in motors based in pressure sensors? For example, if I wanted three modes:

  • Mode 1: bot moves up down left and write automatically with no pressure
  • Mode 2: want to add a slight push and have the robot move in direction according to that push. So if I give a slight push up move up, slight push down move down etc etc
    basically I would like to make a bot with a resistance in the wheels that is dictated by either a mode switch or by the applied pressure. Is this possible?

Basically a span of functions where if no pressure is applied the bot can move automatically, have the bots movement dictated with a slight amount of pressure and then the need for a lot of pressure to move in a certain direction.

I have the code from a prior project I did where if a high pressure is applied motors move clockwise and low pressure have the motors move counter clockwise if it would help!

I do not know if I made any sense, lol but i can clarify further if needed! :slight_smile:

peanut1234:
I am relatively new to the world of programming with arduino so bare with me! :confused:

I was wondering if there were any suggestions as to how I could use an arduino to control the resistance in motors based in pressure sensors? For example, if I wanted three modes:

  • Mode 1: bot moves up down left and write automatically with no pressure
  • Mode 2: want to add a slight push and have the robot move in direction according to that push. So if I give a slight push up move up, slight push down move down etc etc
    basically I would like to make a bot with a resistance in the wheels that is dictated by either a mode switch or by the applied pressure. Is this possible?

Basically a span of functions where if no pressure is applied the bot can move automatically, have the bots movement dictated with a slight amount of pressure and then the need for a lot of pressure to move in a certain direction.

I have the code from a prior project I did where if a high pressure is applied motors move clockwise and low pressure have the motors move counter clockwise if it would help!

I do not know if I made any sense, lol but i can clarify further if needed! :slight_smile:

Your lack of programming experience is not where the problem is.

A potentiometer has very limited current carrying ability. Perhaps 10 to 20 milliampers maximum. For an adjustable resistor to control current to motor you need a rheostat with wire wound reisitance.

And a rheostat to control motor speed will only work on your motor if they are regular DC motors, not steppers or servos.

You have not stated how you intend to turn the control shafts of the potentiometers.

Perhaps rethink what you want to do. and don't dwell on the "how" to do it. I am sure what you want can be done.

Paul

Paul_KD7HB:
Your lack of programming experience is not where the problem is.

A potentiometer has very limited current carrying ability. Perhaps 10 to 20 milliampers maximum. For an adjustable resistor to control current to motor you need a rheostat with wire wound reisitance.

And a rheostat to control motor speed will only work on your motor if they are regular DC motors, not steppers or servos.

You have not stated how you intend to turn the control shafts of the potentiometers.

Perhaps rethink what you want to do. and don't dwell on the "how" to do it. I am sure what you want can be done.

Paul

I really appreciate your response Paul! I have not even heard of a rheostat before so I will inquire further into that thank you so much! :))

This new project is really just an attempt to better the functionality of the previous one. In the previous one I actually used a force sensitive resistor. The force applied to the sensor changed the resistance and output an analog voltage signal that was then interpreted by the motor controller board. The structure of the code was based on the sensor logic. Light pressure (from 0 to 60 percent of the voltage signal) would actuate the motor to rotate clockwise. Medium pressure (between 60 and 80 percent of the voltage signal) will prompt the motor to shut off. Heavy pressure would cause the motor to reverse and rotate counter clockwise.

Instead of this I want the pressure applied to actuate how easily it moves. No pressure move on its own. High pressure then the user dictates how it moves. Understanding how to use these sensors also to not just control clockwise or counterclockwise but direction of left right and up down was also something I am struggling with.

It's not a good idea to use a resistance to control the speed of a motor. If you have a motor driver board between the Arduino and the motor then the Arduino can control the power using the analogWrite() command.

Basically the Arduino produces a series of pulses. If the ON part of the pulse is narrow the motor moves slowly. If the ON part of the pulse is wide the motor moves fast. This is called Pulse Width Modulation (PWM)

...R

Robin2:
It's not a good idea to use a resistance to control the speed of a motor. If you have a motor driver board between the Arduino and the motor then the Arduino can control the power using the analogWrite() command.

Basically the Arduino produces a series of pulses. If the ON part of the pulse is narrow the motor moves slowly. If the ON part of the pulse is wide the motor moves fast. This is called Pulse Width Modulation (PWM)

...R

Thank youu R!! I think I am going to try to simplify what I want this to do to begin with xD. Should I use a motor control board if I just want the motors to actuate when slight pressure is applied? FSR is bad for this?

An FSR is a sensor, not a motor controller. Don't mix those things up. A pot is also a form of sensor, it senses the position you put it in.

You indeed need some form of motor control - assuming you have regular brushed DC motors, a H-bridge type control board (the L298N is cheap and popular but there are MUCH better ones out there for little extra cost - look for a MOSFET based one) will do great.

Wire your FSR as voltage divider, mid point to an analog input, the reading you get (0-1023) is a direct measure for the pressure applied. Have your Arduino operate the motors through the controller based on this reading - do some testing to find numbers that make sense for you in terms of no, light, strong pressure.

Another thing: analogRead() does what you expect it to do: it takes an analog reading from an analog pin.

In contrast, analogWrite() produces a PWM signal (basically a block wave) on a PWM enabled digital pin (check the documentation on which pins can produce a PWM signal). Don't use analogWrite() with analog pins...

wvmarle:
An FSR is a sensor, not a motor controller. Don't mix those things up. A pot is also a form of sensor, it senses the position you put it in.

You indeed need some form of motor control - assuming you have regular brushed DC motors, a H-bridge type control board (the L298N is cheap and popular but there are MUCH better ones out there for little extra cost - look for a MOSFET based one) will do great.

Wire your FSR as voltage divider, mid point to an analog input, the reading you get (0-1023) is a direct measure for the pressure applied. Have your Arduino operate the motors through the controller based on this reading - do some testing to find numbers that make sense for you in terms of no, light, strong pressure.

Another thing: analogRead() does what you expect it to do: it takes an analog reading from an analog pin.

In contrast, analogWrite() produces a PWM signal (basically a block wave) on a PWM enabled digital pin (check the documentation on which pins can produce a PWM signal). Don't use analogWrite() with analog pins...

@wvmarle thank you so much!! I will try this and see if I can get it working! :slight_smile:

peanut1234:
basically I would like to make a bot with a resistance in the wheels that is dictated by either a mode switch or by the applied pressure. Is this possible?

What do you mean "resistance" here? Friction? Or does the bot actively push back against you, like a dog that doesn't want to go to the vet?

It sort of sounds like a 'follow me' bot. I'm imagining a joystick on top of the bot. You move the stick and the bot moves to try to always keep the stick under your hand. Any time the stick is not precisely vertical, it moves to try to make it vertical.

How big is this? Is it an X-Y frame like a 3D printer or is a wheeled bot moving around your house? For a wheeled robot, have you seen "Mecanum wheels"? They will let the robot drive sideways when required.

MorganS:
What do you mean "resistance" here? Friction? Or does the bot actively push back against you, like a dog that doesn't want to go to the vet?

It sort of sounds like a 'follow me' bot. I'm imagining a joystick on top of the bot. You move the stick and the bot moves to try to always keep the stick under your hand. Any time the stick is not precisely vertical, it moves to try to make it vertical.

How big is this? Is it an X-Y frame like a 3D printer or is a wheeled bot moving around your house? For a wheeled robot, have you seen "Mecanum wheels"? They will let the robot drive sideways when required.

I appreciate your help!! :slight_smile:

I wanted the users force to essentially control how easily the bot moved. It was supposed to be relatively small! As small as I could make it. Really a simple project to just understand how this stuff works :slight_smile: someone also suggested omni wheels so that the bot can slide sideways! So I wanted a small wheeled bot for the table that didn't turn and could move in a perpendicular direction