Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Circuit to convert duty cycle of PWM to resistance...HELP!

Status
Not open for further replies.
PWM --> Lowpass filter --> A/D converter --> digital potentiometer.

**broken link removed**, among others, has A/D's and digital pots.
 
Jerry Miller said:
Ron,
Thanks for the info. Can you walk me through this a bit more (remember my electronic background is not that established)
I'm not sure why I need the lowpass filter. I wish for the entire range to be accounted for. The 20Hz frequency stays constant and only the duty cycle changes. I'm just confused as I thought the PWM signal was digital.
Sorry, please help!
Jerry

It is a 'digital' signal, it goes from 0V to some positive value, and that doesn't change. The reason for the lowpass filter is to provide a smooth DC voltage from the output pulses. 20Hz is very slow for PWM, so the lowpass filter will have to very low frequency, this will restrict how fast it can change.

Assuming your PWM pulses are 0-5V, varying the pulsewidth from 0-100% should give 0-5V at the output of the lowpass filter.

I should try giving many more details of what you are trying to do, it's possible that we may be able to suggest a better way of doing it.
 
Presumably this is an automotive application?, it certainly sounds like it, 12V and slow PWM - presumably from a sensor intended to feed a crude meter in the dashboard (which averages it out). Also, presumably, you are wanting to feed this sensor into a computer based instrument, which probably requires a steady voltage. From what you've already said, presumably the new instrument requires a resistive sensor, which forms a potential divider with an other resistor?.

Assuming the requirement is something similar to that, presumably you can't alter the sensor?, what about the unit you want it to feed? - if I'm right in assuming it uses a resistive sensor with an extra resistor, can you remove the extra resistor?. If you can you only need the lowpass filter, you could then feed the resultant volage directly in - no need to try and convert it to a resistance.

The lowpass filter could consist simply of a resistor and capacitor, depending on the output impedance of the sensor, and the input impedance of the unit it will be feeding.
 
With a microcontroller(uC) you can measure the width of the pulse directly without an A to D. Look for a ucontroller with a "capture compare" module. This extra hardware built into the uC will let you time the pulse width without much software oversite. The uC then uses a digital pot to set the resistance.

Ron's solution doesn't involve a uC but by using a uC you don't have to use any analog components besides your digital pot which will make it less noise sensitive. You will also be able to have any relationship between input pulsewidth and output resistance that you want. You also might be able to make the uC talk to your automotive bus (CAN etc.). Your switching method might work too. With the PWM out from the uC you could switch a transistor at several kHz.

Hope this helps

Brent
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top