I want to increae 0-5v slowly with an potential meter.
So if i set the pot meter to max i want to start the 0 volts and increase till 5v in 15 minutes.
What would be the best way to do this?
Also should i use a pwm to analog converter from aliexpress or is there a better way to do this?
i have a power supply form meanwhell that i can regulate the ouput current with 0-5 v from 0-100%
i want to slowly increase the output power.
the time it needs to take i want to set with the potentionmeter.
so when the potentionmeter is on max it needs 15 minutes to reach full power.
but when i set the pot meter half wax i want to increase over 7,5 minutes.
If I get it correctly, the pot sets the ramp time between 0 and 15 minutes, correct? What starts the voltage ramp? Is there an additional switch button for that?
How should pot (and maybe button) input be handled, once a ramp cycle is in progress?
I noticed another weird thing - last post you mentioned supply current not voltage. Explain.
I have a feeling you are talking about the trim pot, if so it will not do what you want. It will vary maybe +- 0.5V maybe a bit more. If it is another pot we need to know what we are talking about. Post links to "Technical" information on all the hardware items. Post a rough schematic showing how you plan on wiring it showing all connections including power and ground. Post a simple schematic showing what you are trying to do. FYI: A potential meter will display the voltage it will in no way control or adjust it. What pot meter (new to me) are you talking about.
I agree about the diagram. Also, again, please answer the really basic, simple questions I asked you about your original request about coding for the pot. Really, you haven't been forthcoming with replies. That will discourage other people from helping you because the answers to questions like that are crucial to answering your question.
You came here with a coding question about the pot, but it is fairly obvious that you don't have a working hardware design at the moment. Coding for non-existing hardware is not smart.
Also the idea itself doesn't sound like anything that is compatible with any kind of battery that I am familiar with. So you need to explain that part of the project as well.
What should happen if the pot or start relay is changed during the sequence?
Also, a lot of general information is still missing. Like, what battery? What Arduino? You show an Uno, but a lot of people just choose it because they find it in Fritzing. Then we find out later, it's actually something else.
to get you started and give you some ideas on how you transform the pot reading into a duration
const byte potPin = A0;
long duration = -1;
const long minPot = 0; // the min and max values your signal pin gives from an analogRead()
const long maxPot = 1023;
const long maxDuration = 900000; // 15 min in ms
const long minDuration = 60000; // 1 min in ms
void setup() {
Serial.begin(115200);
}
void loop() {
long d = map(analogRead(potPin), minPot, maxPot, minDuration, maxDuration);
if (d != duration) {
duration = d;
long minutes = duration / 60000ul;
long seconds = (duration % 60000ul) / 1000ul;
Serial.print(F("Duration = "));
Serial.print(minutes);
Serial.write(':');
if (seconds < 10) Serial.write('0');
Serial.println(seconds);
}
}
connect your pot signal pin to A0 and the code will show you a duration that varies between 1min to 15min when you turn the potentiometer
Reading through this thread, I think you want to do the following. If so, please respond with clarity for the benefit of all of us, and we can proceed.
Use a potentiometer to tell the Arduino how fast the ramp will be.
Question - you've said full pot = 15 minutes, but what does minimum pot = ? 1 minute? 0 Minutes?
Create an analog output voltage from the Arduino that will set the output current of the power supply per the chart you presented.
Question - you state 0-5V, but if you actually read the manufacturer's data sheet, you should only use the range 1-5V, as the 0-1 range is unstable.
This is a programmable current supply, in this mode. Do you really want to run the power supply up to it's maximum current output in this fashion? This could be very destructive.
Just trying for clarity.