4

We are given two voltages A and B between 0 and 5V. So how do I generate a smooth/continuous analog change in voltage from A to B in a predefined time? The current with that varying voltage is 1 ma or less. The output voltage value is described by a simple quadratic (aX^2)+(bx)+c, at time x seconds.

If that not possible using an Arduino - what is the nearest solution to it? It seems that it would require an RC circuit?

When I mean smooth/continous I mean it doesn't move in "digital steps" or to use an analogy with resistance instead of voltage - it would be like the way resistance changes when a potentiometer is turned between two places, in a given time, by hand.

A potential solution would be to make a circuit that generate arbitrary voltage between 0 and 5v, some how, at a point in time. For each subsequent small change in time, the change in time is constant, generate the desired voltage from a sketch. If the change of time is small and constant, will putting in a high pass RC filter work? Though I'm not sure of a circuit that can create an arbitrary voltage, or arbitrary voltage resolution or how good the RC filter approximates the quadratic smoothness. I don't know the answer.

Pete
  • 89
  • 9

1 Answers1

1

I'm not sure that there exists a perfect solution for what you want. Generating the correct output voltage for time is easy. Just keep track of time and use the formula you wrote to compute the correct voltage you should be at. Then you can use a PWM output. However, this isn't going to be perfect since it is made with pulses rather than a continuous output. On the Uno the pulses are at 490Hz or 980Hz depending on which pin you use. Use an RC filter and you can then make it continuous - when you tell it output 2.5V you get 2.5V rather than 0 then 5 then 0 then 5 in short bursts. But, you're still going to get discrete steps based on the resolution of the ADC - for an Arduino Uno, it's 255 steps I believe. You could get a separate DAC chip to increase this and can probably get enough steps that their small enough you won't notice. Some versions of the arduino like the due have 12bit analog output and higher frequency, which should help.

mwwalk
  • 446
  • 2
  • 6