pwm to voltage

Discussion in 'The Projects Forum' started by Soroosh.m, May 14, 2012.

  1. Soroosh.m

    Thread Starter New Member

    May 14, 2012
    17
    0
    hi!
    i have a sensor with pwm output(40khz). i want convert it to voltage.
    i used rc filter but it dose not have a real time response!!
    what should i do?????:confused:
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    There will always be some delay no matter what scheme you use.

    The fastest response I can thing of is a digital circuit (microcontroller or such) reading the period (and frequency too if it is variable) to get a digital count of period. This number can then be sent to a digital to analog converter. You should be able to get a pulse-by-pulse response this way.

    But before going down that path what is your application? What are the constraints of the system looking at the sensor?
     
  3. Soroosh.m

    Thread Starter New Member

    May 14, 2012
    17
    0
    I use tsop1138.(ir receiver)
    the frequency is not variable but the period is variable.
    is there any chip set to do this??
    i used a low pass filter with a 100k resistor and 1uf capacitor. but i said , it had a delay(about 700ms)
    i'm looking for the fastest way.
    pls help me:(
     
  4. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    How much ripple voltage can you tolerate in the output voltage? That determines how fast you can respond to changes in the PWM duty-cycle using an analog filter.

    Your filter has a 100ms time-constant which is likely much longer than you need for a 40kHz signal.
     
    Soroosh.m likes this.
  5. Soroosh.m

    Thread Starter New Member

    May 14, 2012
    17
    0
    5V i can tolerate in the output voltage
     
  6. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    I would think you would want less than 5V of ripple. :confused:

    What is the PWM peak voltage?
     
  7. Soroosh.m

    Thread Starter New Member

    May 14, 2012
    17
    0
    its a pulse like this:
    [​IMG]
     
  8. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    By ripple voltage, I mean how much deviation of the filtered output can you tolerate. Using a shorter time-constant filter will increase the response time but it will also increase the slight variation in the filtered voltage due to the on-off 40kHz pulses from the input signal. My question is how much of this deviation (ripple) at 40kHz can you tolerate in the filtered signal?
     
    Soroosh.m likes this.
  9. Soroosh.m

    Thread Starter New Member

    May 14, 2012
    17
    0
    something about 40%
     
  10. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    So you can tolerate 2V or ripple on the filtered PWM output? What are you doing with this signal that it can tolerate such a high ripple? Such a high value doesn't seem reasonable. :confused:
     
  11. Soroosh.m

    Thread Starter New Member

    May 14, 2012
    17
    0
    :D this is just for calculate the distance between a ir receiver and transmitter. this is nut a data or something else
     
  12. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    I'm sorry but you will have to tell me more about what you are trying to do before I can give any useful answers.
     
  13. Soroosh.m

    Thread Starter New Member

    May 14, 2012
    17
    0
    there is a 5mm ir transmitter diode (40khz).
    and a tsop1138 ir receiver sensor.
    the distance between transmitter and receiver is variable
    i want to calculate the distance.
    but i have a problem! the output of tsop1138 is pulse and i want convert it to analog voltage and calculate it with ADC unit of micro controller.
     
  14. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    That sounds like a project to calculate the distance from a TV transmitting tower to a receiver by watching TV. Somehow the receiver and the transmitter will need to be synchronized or is the receiver re-transmitting the pulse back to the transmitter so you can measure the turn-around time?. How are you accomplishing that?
     
  15. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    You do realize that the speed of light is about 1ns/ft? So I don't see how you can resolve that sort of time using a 40kHz PWM signal and IR. :confused: One period of the 40kHz signal represents over 4 1/2 miles of travel time for light.
     
    Soroosh.m likes this.
  16. Soroosh.m

    Thread Starter New Member

    May 14, 2012
    17
    0
    :D :))))))))))))))))))
    i know but in fact there is not like something that you said ;)
    i use this system and it was use full for me. but i calculate the output by a micro controller
    and now i want convert it to analog voltage and and calculate it with adc unit .
     
  17. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    So help us older folks understand just exactly how your unit works. A sketch or schematic would be great.
     
  18. ifixit

    Distinguished Member

    Nov 20, 2008
    638
    108
    Hi Soroosh.m,


    Questions:
    1. You already said your PWM carrier frequency is 40KHz, but what is the modulation frequency, or at what maximum rate does the duty cycle vary?
    2. Also, what is the depth of modulation, or range of duty cycle variation in percent?
    If you can answer these questions, then a filter can be designed to extract the data you want from the signal.

    Regards,
    Ifixit
     
  19. Soroosh.m

    Thread Starter New Member

    May 14, 2012
    17
    0
    the duty cycle is from 10% to 100%
    i said , i used filters but i want something else to have a real time response :(
     
  20. crutschow

    Expert

    Mar 14, 2008
    12,993
    3,229
    At the risk of being repetitious, how fast a real time response do you need? :confused:
     
Loading...