Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to I generate a digital controlled 0-5V analog signal.

Status
Not open for further replies.

kupper

Junior Member level 1
Joined
Jun 8, 2005
Messages
19
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,466
how to generate an analog signal

Hello,

I am trying to build a circuit that can output a 0-5V analog signal.
This analog signal will be controlled by a mcu.

What i have in mind is to have a mcu communicate to some sort of 12bit dac.
I am familiar with the mcu portion of things, but i am not familiar with dac.
The 0-5V as a control signal to control an old power supply.

These are some of the questions i have:
1) Is there any cheap dac that anyone can recommend.
2) Typically do we use the dac to output the 0-5V signal directly or do we have to use some sort of buffer to scale the output of the dac to max at 5V and provide some current drive to drive connected circuit.
3) Can the entire dac/driver circuit be powered from a signal real supply?
4) Is there any other alternative?



Appreciate any feedback and help.

Cheers,
kupper
 

svicent

Full Member level 6
Joined
Jul 11, 2001
Messages
322
Helped
33
Reputation
64
Reaction score
7
Trophy points
1,298
Activity points
2,293
how to generate digital signal

I suggest you to use Direct Digital Synthesis.
h**p://en.wikipedia.org/wiki/Direct_Digital_Synthesis

Look "Electronics-Lab". Circuit Cellar #131, June 2001. The autor uses DDS with an 8051, and two PWM outputs to generate: sinus, triangle, sawtooth and square waveforms.
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,920
Helped
4,874
Reputation
9,766
Reaction score
4,661
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
126,942
generate low voltage digital signal

You really need to be more specific about the voltage you want to produce. Is it a stable voltage as might be used as a power supply or is it audio or even RF?

Generally:

A DAC will work and is fast, your suggestion of a 12 bit DAC will let you set the voltage in steps of 1.22mV, does it need to be that accurate? DACs are relatively expensive.

PWM can generate a voltage anywhere from zero up to the micro's supply voltage, either in software or using the chips on-board PWM hardware if present. Cost is almost nothing, all you need is a simple filter to average the PWM signal. It could be nothing more than a resistor and capacitor.

You can run DACs from a single supply, most work that way.

The amount of amplifying can be from none to as much as you like, it depends on what your application demands of it.

Brian.
 

bimbla

Advanced Member level 1
Joined
Jul 13, 2001
Messages
419
Helped
23
Reputation
46
Reaction score
8
Trophy points
1,298
Activity points
3,608
single supply pwm dac output

Hello,

Make sure to pass the DAC output through a low pass filter, preferably a 2nd order, to remove the traces of switching frequency.

Regards,

bimbla.
 

kupper

Junior Member level 1
Joined
Jun 8, 2005
Messages
19
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,466
digital to analog 5v

Thanks for the replies everyone.

Sorry should have been more specific with my signal requirements:
I think the main requirement for voltage signal is stability and accuracy.
It would be use as the voltage reference of a lab power supply to control its output voltage and current.

If this works I have other projects in mind.
I want to use this digital controllable signal to simulate real sensors that outputs a voltage signal in 0-5V range. Eg. pressure sensors. The sensors voltage will be read by 10bit ADCs, so I thought my source signal should have better resolution.
Alternately, I could play around and create sensors modules of my own of play with, have a micro's adc read some analog sensors, output as a 0-5V reading. I like the idea of a 0-5V output as its an easy interface for any micro or data acquisition card.

I am open to new ideas, still in the prep stage.
With the DDS or PWM method, how accurate can they be and will they be stable.
Any drawbacks?
Would you suggest any other methods, if I want best value for money(home project ;)) if I am looking to produce as multiple channels of 0-5V source.

Thanks again.

Cheers,
Kupper
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,920
Helped
4,874
Reputation
9,766
Reaction score
4,661
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
126,942
5v signal filter

For your PSU application I would forget DDS and go for the PWM solution.

In PWM control you rapidly switch a digital signal from 0 to 1 and back again. Think of always 0 being 0 voltage output and always 1 being full output voltage. By changing the ratio of 1 to 0 within a fixed time frame you can produce any voltage between zero and maximum. The only consideration is that you have to average the signal to remove the digital content. If your PWM rate is fast enough (in the KHz region) all you need is a simple RC filter.

You can in theory produce as many simultaneous PWM outputs from one microprocessor as there are IO pins on it. You could also drive any metering and monitoring from the same micro.

Brian.
 

matbob

Full Member level 2
Joined
May 15, 2008
Messages
128
Helped
26
Reputation
52
Reaction score
12
Trophy points
1,298
Location
KERALA
Activity points
2,061
dac0800 single supply

Hi kupper,

If you have enough output pins left on the uC you may use the cheap solution as given in the figure. You can extend the resolution simply by increasing the number of ladders. Use 1% metal film resistors for fairly good accuracy.
37_1249144148.png
 

Petre Petrov

Member level 3
Joined
Aug 5, 2009
Messages
58
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,288
Location
Sofia
Activity points
1,780
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top