Go Down

### Topic: A ramp voltage with 50s or 100s ramp time (Read 1 time)previous topic - next topic

#### zhyf1991

##### Feb 26, 2013, 02:37 am
My professor asked me to generate a ramp voltage with 50s or 100s ramp time by Arduino uno 3 so the ramp rate is about 5v/50s=0.1v/s or 5v/100s=0.05v/s. However I'm a little confused about whether it can be achieved. Do you have some suggestions or basic ideas or codes about this project? thx

#1

#### holmes4

#2
##### Feb 26, 2013, 02:43 am
The Uno cannot output voltages between 0v and 5v just 0v and 5v. So your first problem is to find a way of overcoming this limitation. Now as your the student.......

Mark

#### zhyf1991

#3
##### Feb 26, 2013, 03:17 am
thx for your reply.not having 5V is ok, I can amplifer it. now I don't know how to code it to make every steps keeping (50/256)s (let's say 8bit for 50s ramp time)

#### retrolefty

#4
##### Feb 26, 2013, 03:22 am

thx for your reply.not having 5V is ok, I can amplifer it. now I don't know how to code it to make every steps keeping (50/256)s (let's say 8bit for 50s ramp time)

I think you fail to understand. An arduino simply cannot directly generate a true variable analog output voltage. There is no way for you to directly have a pin output say a +2.5vdc voltage level. What you can do with external circuitry is to use the PWM outputs and wire up a low pass filter and possibly a buffer amp which will then simulate generating a true analog output voltage within the 0 to +5vdc range. Will your Prof allow such external circuitry?

Lefty

#### zhyf1991

#5
##### Feb 26, 2013, 03:30 am
thanks. yes I know this, my original plan was to build a DAC (resistive ladder)to achieve it. Is this feasible? I'm new to Arduino and my main problem is coding I guess...

#### retrolefty

#6
##### Feb 26, 2013, 03:34 am

thanks. yes I know this, my original plan was to build a DAC (resistive ladder)to achieve it. Is this feasible? I'm new to Arduino and my main problem is coding I guess...

Sure an external DAC would work fine. As far as the programming goes, it's just a matter of spacing the time internals to increment the DAC output values. The mills() function is a handy method of keeping track of elapsed time within your running program.

LEfty

#### zhyf1991

#7
##### Feb 26, 2013, 03:36 am
thx a lot! I will try this one

#### Nick Gammon

#8
##### Feb 26, 2013, 04:13 am
I don't want to do your homework for you (then you wouldn't have any fun!) however an RC circuit with a buffer will help get the voltage out of the PWM output. Example:

http://www.gammon.com.au/forum/?id=11395
Please post technical questions on the forum, not by personal message. Thanks!

http://www.gammon.com.au/electronics

Go Up

Please enter a valid email to subscribe