Go Down

Topic: DAC (Read 7040 times)previous topic - next topic

baum

Jan 17, 2011, 01:27 amLast Edit: Jan 17, 2011, 01:29 am by baum Reason: 1
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!

AltairLabs

#1
Jan 17, 2011, 01:34 am
Its a 12-Bit Digital-to-Analog Converter, so the output is Vref * count / 2^12 which is Vout = Vref * count / 4096.

baum

#2
Jan 17, 2011, 02:21 am
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]

MarkT

#3
Jan 17, 2011, 02:50 am
Looks like its ratiometric to the supply.  4095 -> 5V,
0 -> 0V. 2048 -> 2.5V
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

baum

#4
Jan 17, 2011, 02:50 am
And a negative voltage?

MarkT

#5
Jan 17, 2011, 02:53 am
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.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

retrolefty

#6
Jan 17, 2011, 02:58 amLast Edit: Jan 17, 2011, 03:01 am by retrolefty Reason: 1
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

baum

#7
Jan 17, 2011, 03:07 am
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.

retrolefty

#8
Jan 17, 2011, 04:15 am
http://arduino.cc/en/Reference/Map

baum

#9
Jan 17, 2011, 05:08 am
That makes negative integers. I want a negative voltage.

CrossRoads

#10
Jan 17, 2011, 05:27 am
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Grumpy_Mike

#11
Jan 17, 2011, 02:21 pm
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.

baum

#12
Jan 17, 2011, 09:28 pm
So like two batteries in series, with one wire at each end and ground in the center?

CrossRoads

#13
Jan 17, 2011, 10:19 pm
Exactly. Two AAs will yield +/= 1.5V
6 will yield +/- 4.5V.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

baum

#14
Jan 17, 2011, 10:23 pm
How can I do that with arduino? I don't want to power an op-amp off batteries.

Go Up