Loading...
Pages: [1]   Go Down
Author Topic: Outputting a voltage  (Read 197 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I just wanted to know if it's faisable with a arduino, and especially with a arduino BT board to outputting a voltage between 0v and 5v.

For example the number 100 corresponds to 0V and 345 corresponds to 5V.

Thank you
Logged

South England
Offline Offline
Full Member
***
Karma: 3
Posts: 194
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, but not directly. You'll either need to use a PWM output and run that through a low-pass filter to get your voltage, or use something like a SPI/I2C interfaced DAC to do the job. Depending how much precision you want, I might be tempted to start with the first option as you only need a resistor and a capacitor smiley
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 16426
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

With PWM, 0 would correspond to 0, 128 to ~2.5V, and 255 to 5V.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

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

Ok so i don't need to buy extra hardware ?
Actually the values is between 70 and 200 so it should be ok
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 43
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I just wanted to know if it's faisable with a arduino, and especially with a arduino BT board to outputting a voltage between 0v and 5v.

For example the number 100 corresponds to 0V and 345 corresponds to 5V.

Thank you

You could map it, and then use PWM.
Something like this:
int x = NumberToOutput; //replace with your value
int y = map(x, 100, 345, 0, 255);//  map 100 - 345 to 0 - 255
analogWrite(PWMpin, y); // write value to your (PWM-capable) output pin
Logged

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

Thank you for your help.
I'm not already at this point of my project, I will try ASAP and I come back if I have more questions.
Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 11
Posts: 1338
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, See http://arduinoinfo.info 
http://arduino-info.wikispaces.com/Analog-Output
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Pages: [1]   Go Up
Print
 
Jump to: