Pages: [1]   Go Down
Author Topic: A ramp voltage with 50s or 100s ramp time  (Read 702 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Please do not cross-post.
Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 25
Posts: 1873
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16517
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16517
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thx a lot! I will try this one
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: