Electronic – ny DAC that generates a negative voltage or sine wave without offset

avrdacmicrocontroller

I would like to generate a positive and negative voltage (sine wave without offset) from an AVR microcontroller. I think it needs an external DAC, because the internal ones are not able to generate a negative voltage.

Is there a possibility to do it or is there a DAC which makes that?

Best Answer

Some of the AVRs have fairly decent 12-bit DACs. You could merely shift the zero using an op-amp. Say your DAC reference is 2.5V, then you could shift the output by an input-referred -1.25V so you get a bipolar output signal with output 0V at 0x800.

The general approach would be something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

Just throw a bit of algebra at it- for example for Vref = 2.5V and desired output -4.0V to +4.0V you could pick Rf = 10.0K, then R1 = 6.25K and R2 = 16.67K.

The above circuit does not load the DAC output, but it does present some load to the Vref. If it's not very low impedance you could use another op-amp in a dual as a unity-gain buffer so Vref also is not loaded.

Of course your op-amp requires bipolar supplies or it won't give you a bipolar output.