Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

generating analog voltage using microcontroller

Status
Not open for further replies.

aruna1

Member level 1
Joined
Jun 18, 2009
Messages
40
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,603
Hi

I need to generate an analog voltage using a microcontroller (16F877A)

I have two options -

1.)Use R-2R ladder and make a 10bit DAC

2.)generate 1kHz PWM signal-->send it through a 6 pole lowpass filter-->get analog voltage relevant to duty cycle.


Since I couldn't find any DAC ics, I'm stuck with above two options (they are the only methods I know of, are there any other methods?)

I have to order some DAC ICs but it will take about 3 weeks to reach me, so untill then I have to use some method to generate voltage?

What method do you think most reliable? that is more accurate and steady?

Thank you
 

leo_o2

Advanced Member level 4
Joined
Sep 3, 2004
Messages
1,324
Helped
277
Reputation
556
Reaction score
241
Trophy points
1,343
Location
China
Activity points
5,761
For second method, L C filter can be used for stable voltage.
 

muthukumar_ece2004

Member level 4
Joined
Apr 22, 2011
Messages
74
Helped
10
Reputation
20
Reaction score
9
Trophy points
1,288
Location
Chennai, India
Activity points
1,751
You don't need to generate PWM signal. Just generate a square signal of frequency 1KHz, then filter-out using a 4th order active filter to get a faithful sine wave. We are doing this form of simple analog voltage generator.
 

leo_o2

Advanced Member level 4
Joined
Sep 3, 2004
Messages
1,324
Helped
277
Reputation
556
Reaction score
241
Trophy points
1,343
Location
China
Activity points
5,761
Yes. It provides better efficiency if the analog signal need big driving capability.
 

aruna1

Member level 1
Joined
Jun 18, 2009
Messages
40
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,603
You don't need to generate PWM signal. Just generate a square signal of frequency 1KHz, then filter-out using a 4th order active filter to get a faithful sine wave. We are doing this form of simple analog voltage generator.
how could a sine wave help in my requirement? I think you misunderstood what I was saying.
 

JayantD

Member level 3
Joined
Nov 2, 2010
Messages
58
Helped
9
Reputation
18
Reaction score
9
Trophy points
1,288
Location
Pune, India
Activity points
1,549
Aruna,

If your range is 0 to 5V, you can use a DAC like MCP4912 (Microchip) which can be written through SPI. If you need higher voltage at the output, the DAC output can be amplified by a non inverting amplifier.

In case you dont want to use a DAC, you can generate a PWM, and connect a RC low pass filter to get a linear output voltage. ensure the RC time constant is greater than your PWM cycle time, otherwise you may end up getting a triangular wave.

Using a DAC will give you more accuracy. Hope this helps.

Regards,
JayantD
 

aruna1

Member level 1
Joined
Jun 18, 2009
Messages
40
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,603
I ordered a sample DAC from TI and it will arrive next week. after all I will not need PWM :)
thank you all
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top