Pages: [1] 2 3 4   Go Down
Author Topic: DAC  (Read 1655 times)
0 Members and 1 Guest are viewing this topic.
Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
DAC
 Bigger Bigger  Smaller Smaller  Reset Reset

This is on the way:
http://www.sparkfun.com/products/8736
I don't understand exactly how to operate it. I understand the I2C part, but what if I am putting in 5V, what number would I input digitally to get, say, 3.4V?
I want to generate a sine wave for audio....

Also, how can I generate a negative voltage? (for this and op amp supplies)

Thanks!
« Last Edit: January 16, 2011, 07:29:50 pm by baum » Logged

Atlanta
Offline Offline
Sr. Member
****
Karma: 1
Posts: 254
Arduino still rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Its a 12-Bit Digital-to-Analog Converter, so the output is Vref * count / 2^12 which is Vout = Vref * count / 4096.

Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what is "count" and "vref"? Are those the numbers?

i.e. If I had 5V supply rail and I wanted 2.5 volts I would send 2048 over I2C?

[glow]Also, how can I generate a negative voltage?[/glow]
Logged

0
Offline Offline
Shannon Member
****
Karma: 201
Posts: 11744
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like its ratiometric to the supply.  4095 -> 5V,
0 -> 0V. 2048 -> 2.5V
Logged

[ I won't respond to messages, use the forum please ]

Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And a negative voltage?
Logged

0
Offline Offline
Shannon Member
****
Karma: 201
Posts: 11744
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also, how can I generate a negative voltage?
By having a -5V supply as well, and an opamp in an inverting amplifier configuration perhaps?  The DAC chip is only single rail and max supply of 5.5V so it won't do it by itself.
Logged

[ I won't respond to messages, use the forum please ]

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also, how can I generate a negative voltage?

You can't directly. You can either take the D/A analog output into a unity gain op-amp that has a +2.5vdc offset to the - input of the opamp and that uses + and - voltage rails and then you would have a AC output voltage centered on 0v, going both positive and negative.

For simple audio use, you can most likely just pass the D/A output through a say .5mfd series capacitor and using a common ground connection from the converter to the device you are wiring to, and it will be a true zero based ac voltage. Recall that a cap passes AC but blocks DC voltages.

Lefty
« Last Edit: January 16, 2011, 09:01:33 pm by retrolefty » Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With no relation to anything else I have talked about on this post, how can I generate the inverse voltage of the input? 5v generates maybe
 -4.98V and so forth.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/en/Reference/Map
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That makes negative integers. I want a negative voltage.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26569
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need a part like this then.
http://www.analog.com/static/imported-files/data_sheets/AD1851_1861.pdf
It needs a negative supply so you can output a negative voltage.
If you search further, either at analog devices or at maxim-ic.com, you might even find one with an internal negative supply source.
These do not put out much current, so you may need a buffer after it depending on your needs.
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.
Arduino for Teens available at Amazon.com.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The simplest way it to have two power supplies one for the positive and one for the negative voltage. You then connect the -ve of one supply to the +ve of the other. This point then becomes your ground or reference point. Then the +ve end is the positive voltage and the -ve end is the negative voltage. You can then use these voltages to feed into your op-amps or A/D or D/A.
Logged

Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So like two batteries in series, with one wire at each end and ground in the center?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26569
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Exactly. Two AAs will yield +/= 1.5V
6 will yield +/- 4.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.
Arduino for Teens available at Amazon.com.

Connecticut
Offline Offline
Edison Member
*
Karma: 17
Posts: 1216
RTFD (Datasheet in our case)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How can I do that with arduino? I don't want to power an op-amp off batteries.
Logged

Pages: [1] 2 3 4   Go Up
Jump to: