Can I use a DAC to convert duty cycle to voltage at 5 to 100 Hz

Thread Starter

rbrautigan

Joined Nov 9, 2017
7
I want to use a DAC ic to convert a low impedance input comprised of square wave 13V pulses of anywhere from 5% to 80% duty cycle and a frequency of anywhere from 5 to 100 Hz. So, in choosing the DAC, what specs are important in this application? BIT number? I'd like ripple to be less than 5% without having to add a low pass filter. I want to use an 8 pin DIP package.
 

philba

Joined Aug 17, 2017
959
You will need more than a DAC. There are chips that can do it, LTC2645 for example, but your requirements - 5Hz and DIP8 package - make it pretty challenging. No offense, but you really need to figure out how to use SMDs cause you are swimming against the tide with your DIP8 requirement.
 

Thread Starter

rbrautigan

Joined Nov 9, 2017
7
You will need more than a DAC. There are chips that can do it, LTC2645 for example, but your requirements - 5Hz and DIP8 package - make it pretty challenging. No offense, but you really need to figure out how to use SMDs cause you are swimming against the tide with your DIP8 requirement.
I can go surface mount. Will the LTC2645 put out a pure DC voltage all by itself? Will it disregard the changes in frequency and respond only to duty cycle, and will the output be straight line proportional to it?
 

crutschow

Joined Mar 14, 2008
34,459
won't almost any DAC work?
Nope. No DAC will work.
A DAC takes a digital number of typically 8-bits or more and converts that to a voltage.
That's not even close to what's required to convert a PWM signal (which is a square-wave with a varying duty-cycle) to a voltage.
 

philba

Joined Aug 17, 2017
959
You have all these specific requirements but I think you don't clearly understand the implications. Instead, why don't you tell us what you are trying to do? What's the PWM source? What the voltage destination?
 

ian field

Joined Oct 27, 2012
6,536
I want to use a DAC ic to convert a low impedance input comprised of square wave 13V pulses of anywhere from 5% to 80% duty cycle and a frequency of anywhere from 5 to 100 Hz. So, in choosing the DAC, what specs are important in this application? BIT number? I'd like ripple to be less than 5% without having to add a low pass filter. I want to use an 8 pin DIP package.
Switch mode power supplies usually use a low pass filter.
 

shteii01

Joined Feb 19, 2010
4,644
You input is PWM signal.

DAC is an OUTPUT device.
So.
You need "something" to analyze the input PWM signal, then you need this "something" to tell DAC what to output.

A good design approach is to make a block diagram where each block describes desired function. Once you have all the blocks, you can pencil a specific part into the block and see how all these parts will mesh together.

For starters. Your input signal is going to be 13 volts. Most microcontrollers would be fried if you apply 13 volts to them. Therefore, you need "something" that can read 13 volts or you need "something" that will modify input signal in such a way that microcontroller can read it and not get fried.
 

Thread Starter

rbrautigan

Joined Nov 9, 2017
7
Switch mode power supplies usually use a low pass filter.
The duty cycle comes from a fuel injector on my car and needs to be turned into a voltage I call Vi. Another pulse signal comes from the speedometer cable and enters an LM2917 freq to voltage converter and comes out Vs. These two signals represent fuel flow GPH and speed MPH. So Vs divided by Vi equal MPG.I thought it would be fun to make a working MPG meter using an inexpensive circuit I found on the web and parts on hand.
https://m.eet.com/media/1128322/12212-figure_1.pdf

Worried Vi not smooth at 6 Hz. thought a DAC would put out a nice clean voltage like the LM2917 does.
 

philba

Joined Aug 17, 2017
959
OK, understand. 6 Hz would be hard to LPF cleanly. I'd look at a microcontroller with a DAC (ATTiny 1617 has 3, there are a number of PICs with more than 1) that would read the input PWM (via voltage divider) and based on the ratio of on to off, output the ratio on the DAC. Then I'd use an op amp to scale the voltage to what ever you need. The output would be as solid as the PWM input. It's a very small amount of code.
 
Last edited:

Thread Starter

rbrautigan

Joined Nov 9, 2017
7
OK, understand. 6 Hz would be hard to LPF cleanly. I'd look at a microcontroller with a DAC (ATTiny 1617 has 3, there are a number of PICs with more than 1) that would read the input PWM (via voltage divider) and based on the ratio of on to off, output the ratio on the DAC. Then I'd use an op amp to scale the voltage to what ever you need. The output would be as solid as the PWM input. It's a very small amount of code.
I'm sure that would be eligant but way beyond my speed & understanding. What simpler device before the DAC would do the same thing? Currantly I'm putting the duty cycle directly into a 662 op amp.
 
Last edited:

Thread Starter

rbrautigan

Joined Nov 9, 2017
7
Going further, my op amp works ok at 6 Hz except output is so ripply afraid it's upsetting the rest of the circuit..
Sorry I'm not editing my replies timely manner. Main reason why dont like a simple LP filter is it slows response time
down to several seconds. I need respose within 1 sec.
 

philba

Joined Aug 17, 2017
959
Well, good luck to you finding a chip that does what you want. Let us know if you find something.

Though, I wouldn't write off learning to program micros too quickly. Arduinos are pretty easy/cheap to learn and the Attiny85 (8 pin micro) can be programmed via arduino. It doesn't have a dac but you could use a fairly high speed PWM that would filter easily and have very low latency. Lots of free code out there and tons of people willing to give advice. You could get exactly what you want that way.
 
Last edited:

ian field

Joined Oct 27, 2012
6,536
Sorry I'm not editing my replies timely manner. Main reason why dont like a simple LP filter is it slows response time
down to several seconds. I need respose within 1 sec.
The only thing I can think of is; chop the on pulses with a higher frequency so you can filter them with a faster LPF - but the output will rise and fall.
 
Top