radio cotrolled pulse width to voltage converter

Status
Not open for further replies.

SimonTHK

Member
Hello
I have a transmitter and receiver. The receiver sends pulses at the length of 0.5 - 2.5 ms and with 20 ms periods, so it runs 50 hz.

I want to convert this 20 ms signal and pulsewidth into a voltage.

Is it the same as using frequenzy to voltage converter? Or is there a difference?

Thanks in advance
 
Last edited:
Your frequency is fixed so a freq to voltage converter would not work.
What you have is a PWM (Pulse Width Modulation) signal with a low duty cycle (low on time).

Maybe one of the analog guys can fix you up with a circuit to convert that to voltage. I would measure it with a micro controller and generate an output voltage with a DAC.

A 50Hz PWM signal sounds like a signal intended for a servo but that on time is strange. Maybe someone else has seen the like of it.
 
Last edited:
It is for a servo and the converter does not have to be super perfect precise because it is going to follow my finger push anywho and I cant push that correct!

I guessed it would be a problem with that duty cycle, and that is why I dont quite know how to handle this I dont need a fansy circuit with a superior resolution, just easy road.
 

hi,
What is the output voltage going to be used for.?
 
I did this, and it gave me an ok output while reading it with a multimeter. Problem is that it seems that my microcontroller gets noise from reading this signal, probably cause it does it so well.
I cant use the microprocessor to measure the PWM signal, cause I simply doesnt have the room inside the chip. (I cannot be convinced to try using the microcontroller anymore).
 
hi,
What is the output voltage going to be used for.?

To be controlling a quadrocopter. The analog signal will be connected to microprocessor that will also have a gyrometer attached. I will use a ADC to read the signal made from this board, and I know some dont like going from digital to analog to digital, but I just cant make it perfectly work with room etc with my PSOC microcontroller.
 

hi,
This is an option, the 556 is just the servo generator pulse circuit.

The right hand section is the pulse to DC converter.
Arrange for the PIC to sample the DC out when the 0.5m to 2.5ms is inactive.
 

Attachments

  • ServpPulse1.gif
    36.1 KB · Views: 288
hi,
This is an option, the 556 is just the servo generator pulse circuit.

The right hand section is the pulse to DC converter.
Arrange for the PIC to sample the DC out when the 0.5m to 2.5ms is inactive.

Hi Eric
Fantastic, you make the world turn
I will make an interrupt to do the sample at falling edge.

Few quistions though.
-Does all the transistors work as switches or amplifiers?
-The opamp's minus is connected to ground or a minus voltage? And it is a none inverting amplifier?

Thanks
 

hi,
Q1,3,4 are switches, Q2 is constant current source.

The MCP6001 or [MCP6002 dual] is a single supply 5V, rail to rail OPA.
 
The simplest way to generate an analog signal is to just run the pulses through an RC low pass filter (integrator). That's basically what your multimeter does. But it's not as fast as Eric's circuit.

You would need an RC time-constant of about 200ms to minimize the ripple, so obviously the response time to a change in pulse-width is slow. Also you would likely need to amplify the signal since the maximum output signal is only 2.5/20 = 12.5% of the pulse amplitude.

Just a simple option for your consideration.
 

Using PWM to Generate an Analog Voltage

This must be what you are talking about. It would be fun to try that out aswell, since it is easy to build and also no interrupts for falling edge is needed, cause the voltage will be constant in my thoughts, and that will make my programming even easier. Right now I am reading the pulsewidth with a counter and interrupts, but it just fills too much when I need to measure 4 pwm signals.

Ill look abit more into this here: **broken link removed**
 
Reading the pulse width directly with the micro should take no time at all. You should interrupt on the rising and falling edge and just record the timer value.

Mike.
 
hey, im doing the same thing and the RCgroups suggest using a band filter Using PWM to Generate an Analog Voltage

havn't tried it yet,,

what i did do for a test run is i took a input from 3 transmitter CHannels and ran them to 4 Quad-Or gates, a few minor glitches but it lifted alot easier than when i did it for all 4 channels separate!
 
dooggy

The OP said
The receiver sends pulses at the length of 0.5 - 2.5 ms and with 20 ms periods,

The signal is only using 1/10 of the range. I am not sure that the output of a filter would be useful.
 
dooggy

The OP said

The signal is only using 1/10 of the range. I am not sure that the output of a filter would be useful.


I agree, it might wont work. I will still try unless someone can confirm otherwise, sinze it is so easy and I dont need a fanzy perfect signal
 
I agree it is worth a try. Let us know how it goes.
 
I agree, it might wont work. I will still try unless someone can confirm otherwise, sinze it is so easy and I dont need a fanzy perfect signal

hi,
If you are able to write the program for the PIC, I would go the same route as suggested by Pommie aka Mike and let the PIC sample the ON period of the 0.5 thru 2.5mS pulse.
 
hi,
If you are able to write the program for the PIC, I would go the same route as suggested by Pommie aka Mike and let the PIC sample the ON period of the 0.5 thru 2.5mS pulse.

Hi Eric
The problem is that I need to read 4 different inputs, and in a PSOC falling and rising and all I/O use the same interrupt. That means that I have to check which port of the 4 that is not turned on after I have got an interrupt I also have to figure out if it was falling or rising. I just dont know if this would work and there will be a chance that it will have two falling edges the same time.
Also I have to connect a gyrometer, barometer and accelerometer to the same uC and they will probably be using interrupts aswell.
 
Last edited:

hi,
Which PIC type are you using.?
 
If you are using a normal RC system and not a spread spectrum system then the signals do not overlap. A pic can easily read 4 signals to an accuracy of 1uS (or better) and it will still have 98% of it's processing power available. The only interrupt required is the PortB change (IOC) and so all other interrupts are still available for the other devices.

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…