Automated Digital Potentiometer

Hello everyone ! What I am trying to build, is an automated digital potentiometer circuit. I want to use an Arduino UNO and an experimental potentiometer circuit. It should work like this:

I press on a dip-switch ... and then ... in between a period of time (let's say 10 seconds ... the wiper of a 10 kilo-ohm digital potentiometer moves smoothly from 0 to 10 (or reverse).

Would be nice if I could trigger at least TWO potentiometers with this method. I could use one of these experimental potentiometer boards that are on the marked these days.

All I need is the coding and the information about the pins to use. I have no idea how to code and connect this.

I want to use it for accelerating or slowing down a machine automatically.

Thank you in advance.

If you want someone to write the code for you, use the flag button to ask a moderator to move your post to the Jobs and Paid Collaborations forum section.

If you want to learn how to write code to control a digital potentiometer, post a link to it. Someone might be willing to help you get started.

In any case you need to learn how Arduino works. The Arduino IDE has lots of examples teaching the basics, and there are countless tutorials on line.

Digital pots do not move smoothly. They jump from one value to the next one stair-step wise.

Yes, I know. But there are a lot of steps, I assume.

How do I "Post a link" to it ? I'm new here. But someone helped me with the project prior to this one. So I tried it again.

Copy and paste a relevant URL into your post.

This is a key piece of information. It's very likely that there's a simpler way of accomplishing this than motorizing a couple of pots. What is the machine and what is its interface for speed control?

Excuse me for being so late.

Yes, you may be right. There might be a simpler way.

First of all: I have built a machine that is able to paint oil-pictures in neo-impressionistic style by using the "color dot method". The only machine of this kind worldwide.

In addition to this, I am using a "color shaker" which is able to dilute oil color from tubes with turpentine. This is where I am working on here now.

At current time, I am using this code here:

const byte potStep = A1;        // the pin where the wiper of the potentiometer is connected to
const byte potSpeedPin = A0;    // pot pin for handling speed
const int stepPin = 3;          // define pin for step
const int dirPin = 4;           // define pin for direction

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);

  Serial.begin(115200);
  Serial.println(F("Ready"));
}

void loop() {

  // reading the pot's induced voltage value. 0 means 0V and 1023 means 5V - usually linear in between
  int potSample = analogRead(potStep);

  // map the value that we read between 0 and 1023 into a new value between 20 and 300
  int numberOfSteps = map(potSample, 0, 1500, 10, 70);

  // calculate the desired speed, here we do it all in one go
  unsigned long customDelay = map(analogRead(potSpeedPin), 0, 1023, 8000, 16300);

  // set direction clockwise
  digitalWrite(dirPin, HIGH);

  for (int x = 0; x < numberOfSteps; x++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(customDelay);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(customDelay);
  }
  delay(300);

  // set direction anticlockwise
  digitalWrite(dirPin, LOW);

  for (int x = 0; x < numberOfSteps; x++) { // loop for 100 steps
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(customDelay);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(customDelay);
  }
  delay(300);
}

As you can see, there are two potentiometers. One for the speed and one for the depth.

But now I would like to add an option where I could press a button (Dip-Switch) and then the speed as well as the depth dim down from 10 to 0 in (let's say) 10 seconds.

Maybe one could add some code or ... maybe use a second UNO and then connect two digital potentiometers.

What do you think ?

??? the potentiometer input (unless there's something else to it not stated) is purely an artifact of your code: that's how you decided to control its behavior. You can just as easily control the behavior of the code with any other input device.

That's what I mean. I could add a multi-switch with 2 contacts (for the 2 wipers ... ground and +5V could stay connected) and then another UNO with the digital potentiometers will take control. This other UNO would have a dip switch with the "go"-function. But in any case I would need a code for the "automatic-version". Meaning there would be a "timer-code" necessary. Are there any suitable codes available? # I am answering via mail because I cannot log in to the forum. I am writing from another computer here. # Chris # Greetings to Chicago from Hamburg

Hello. Is there a debounce-like method for smoothing the output?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.