Go Down

Topic: DAC (Read 1 time) previous topic - next topic

baum

Jan 17, 2011, 01:27 am Last 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

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


baum

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

Looks like its ratiometric to the supply.  4095 -> 5V,
0 -> 0V. 2048 -> 2.5V
[ I won't respond to messages, use the forum please ]

baum

And a negative voltage?

MarkT

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 won't respond to messages, use the forum please ]

retrolefty

#6
Jan 17, 2011, 02:58 am Last 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

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

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

baum

That makes negative integers. I want a negative voltage.

CrossRoads

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. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Grumpy_Mike

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

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

CrossRoads

Exactly. Two AAs will yield +/= 1.5V
6 will yield +/- 4.5V.
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.

baum

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

Go Up