Convert PWM to Voltage for RSSI

Projects that are not for RC, but are cool and worthy of development.
Post Reply
User avatar
Rob Thomson
Site Admin
Posts: 4534
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Convert PWM to Voltage for RSSI

Post by Rob Thomson » Tue Sep 10, 2013 6:09 am

Hi All

I have been starting to play with FPV, and have come across a rather annoying issue with the FRSKY rx's.

RSSI!!!

Yes.. you can get RSSI for an on screen display on the D8R-XP receiver, but it is not without issues. The assumption with this rx (all of theirs) is that you want both RSSI and PPMSUM. What this means on the D8R-XP reciever is that if you do not use PPMSUM, you go from 8ch to 4ch!

I have been thinking about this and have come up with an idea for something that may work.

Now... opentx has an option to display RSSI values. It also I believe can use these values as an input to a mix.

So....

Theoretically, we could choose any channel avaliable, and output a signal on it that indicates the RSSI strength.

Problem of course is that we now need a small device to convert the signal into something usefull. An analog voltage.

I suspect that all we need to do this is just a resistor and a capacitor. Much like this post:

http://www.instructables.com/id/Analog- ... o-Voltage/

Has anyone done anything like this before?
Any ideas on what values the resistor/cap would need to be?
Whats the chance there is a pre-built device to do this already?

Rob
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

User avatar
Rob Thomson
Site Admin
Posts: 4534
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Convert PWM to Voltage for RSSI

Post by Rob Thomson » Tue Sep 10, 2013 6:18 am

Thinking about this... I am guessing it may be possible to grab the board from a cheap servo to achieve a similar result?
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

User avatar
Bill
Posts: 195
Joined: Thu Jul 04, 2013 5:54 pm
Country: -

Re: Convert PWM to Voltage for RSSI

Post by Bill » Tue Sep 10, 2013 8:29 am

So you want to transmit the RSSi from the transmitter to the receiver and then into the OSD . :lol: :ugeek:
An RC filter will work OK maybe a two stage one to reduce the ripple, but how are you going to interface it to the OSD, you may need to offset and amplify it also.
What input does the OSD require?
How does a servo fit in is it going to wave a flag at you as it goes by?
The FLD-2 module from frsky gives settable audible RSSI alarms can't the transmitter software do the same?
Explain what you need to do exactly to get into the OSD.
Last edited by Bill on Tue Sep 10, 2013 2:36 pm, edited 2 times in total.
“A good politician is quite as unthinkable as an honest banker”
They used to say "if you don’t want to work at McDonald’s, go to college." Now they say "if you want to work at McDonald’s, go to college.”

User avatar
gohsthb
Posts: 1412
Joined: Wed Dec 28, 2011 2:32 pm
Country: -
Location: Naperville, IL

Re: Convert PWM to Voltage for RSSI

Post by gohsthb » Tue Sep 10, 2013 11:51 am

So Rob,
What you want is the RSSI value displayed through some kind of OSD. You are using the receiver in normal mode PWM outputs on all channels, not the PPMsum and RSSI output. What you want is to transmit the RSSI value from the Tx to the Rx on an unused channel. My first thought for doing this would be a small microcontroller. It could read the PWM pulse from the receiver. Then using the uC PWM output at high frequency with a filter, produce an analog voltage. An attiny25 can have a very high PWM frequency. I would probably use one of those.
-Gohst

User avatar
Bill
Posts: 195
Joined: Thu Jul 04, 2013 5:54 pm
Country: -

Re: Convert PWM to Voltage for RSSI

Post by Bill » Tue Sep 10, 2013 2:23 pm

So you want to transmit the RSSi from the transmitter to the receiver and then into the OSD . :lol: :ugeek:
“A good politician is quite as unthinkable as an honest banker”
They used to say "if you don’t want to work at McDonald’s, go to college." Now they say "if you want to work at McDonald’s, go to college.”


User avatar
Rob Thomson
Site Admin
Posts: 4534
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Convert PWM to Voltage for RSSI

Post by Rob Thomson » Tue Sep 10, 2013 7:29 pm

Ok....

I was chatting with Tilman, and he had a thought that has solved the issue.

An FRSky CPPM/SBUS convertor.
http://www.alofthobbies.com/frsky-sbus-converter.html

So.. what this does for me is as follows:

D8R-XP Reveiver, with jumper on pin 3 & 4, and the convettor in port one does as follows:

1. CPPM - > CPPM Convertor -> PPM1 -> 4
2. RSSI
3 . JUMPER
4. JUMPER
5. PPM5
6. PPM6
7. PPM7
8. PPM8

The result is that I can get RSSI for my OSD System off pin2, channel 1->4 throught the CPPM and channerl 5 -> 8 through the rx ports.

A little bit of a mess of tech -> but works well.

Rob
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

User avatar
Ozzy
Posts: 74
Joined: Sun Jul 08, 2012 7:57 am
Country: -

Re: Convert PWM to Voltage for RSSI

Post by Ozzy » Wed Oct 23, 2013 7:59 pm

Of course your going to have to use an RC filter from the RSSI output to the OSD input, I suggest a 1K and 10uF. And then your probably going to only get ~60% of full scale on the OSD (RSSI is 3.3v max, your OSD is probably 5v), what I did was add a trimmer pot after the RC filter to adjust the 100% signal strength down to read 50% on the OSD, easier math to just double the OSD number in your head this way.
Homer: Here's to alcohol, the cause of - and solution to - all life's problems.

User avatar
citykid
Posts: 21
Joined: Tue Oct 29, 2013 10:47 am
Country: United Kingdom
Location: Birmingham

Re: Convert PWM to Voltage for RSSI

Post by citykid » Tue Oct 29, 2013 12:13 pm

I am yet to get an FrSky RX but I believe that the RSSI signal is a 1000 - 2000 microsecond pulse, once per frame.

This means that you should get a 2 millisecond (max) pulse with a large (18 - 20 millisecond) gap.

This would mean that the "charge pump" capacitor / resistor solution will not work well.

I have developed a simple ATtiny based convertor that works like this:

RSSI Output -> ATtiny Input Pin -> Arduino program measures RSSI pulse length -> I2C DAC chip MCP4725 -> 0 - 5 volt output

RSSI Pulse length = 1000 microseconds -> 0.0 volts out (0% RSSI)
RSSI Pulse length = 1500 microseconds -> 2.5 volts out (50% RSSI)
RSSI Pulse length = 2000 microseconds -> 5.0 volts out (100% RSSI)

I want to feed this 0 - 5 volt signal into the RSSI Analog input on my MultiWii flight controller.

Is this of any use to anyone here? I would be happy to release circuit and code.....

citykid
Radios: Taranis X9D with homebrew haptic and LiPo battery & Horus X12S (Beta Unit 34) now PROD spec.

Chairman of Greenacres Model Aero Club - North Birmingham, UK

User avatar
Rob Thomson
Site Admin
Posts: 4534
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Convert PWM to Voltage for RSSI

Post by Rob Thomson » Tue Oct 29, 2013 12:18 pm

Please do :)

Sent from my GT-I9300 using Tapatalk
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

User avatar
citykid
Posts: 21
Joined: Tue Oct 29, 2013 10:47 am
Country: United Kingdom
Location: Birmingham

Re: Convert PWM to Voltage for RSSI

Post by citykid » Tue Oct 29, 2013 12:45 pm

@Rob Thomson

Rob, the problem is that I don't actually have ANY Taranis hardware (RX or TX) yet to test on!

My design is based on beliefs and assumptions...

The circuit works fine on the bench when I use a PWM output from an old 72MHz TX / RX, which I believe produces the same kind of signal as the RSSI signal on an FrSKY Telemetry RX.

Could you (or anyone else) confirm 100% that the RSSI signal is indeed a 1000 to 2000 microsecond pulse train, and how long the gap between pulses are....?!

Thanks!

citykid
Radios: Taranis X9D with homebrew haptic and LiPo battery & Horus X12S (Beta Unit 34) now PROD spec.

Chairman of Greenacres Model Aero Club - North Birmingham, UK

User avatar
Ozzy
Posts: 74
Joined: Sun Jul 08, 2012 7:57 am
Country: -

Re: Convert PWM to Voltage for RSSI

Post by Ozzy » Sun Nov 03, 2013 8:00 pm

citykid wrote:I am yet to get an FrSky RX but I believe that the RSSI signal is a 1000 - 2000 microsecond pulse, once per frame.

This means that you should get a 2 millisecond (max) pulse with a large (18 - 20 millisecond) gap.

This would mean that the "charge pump" capacitor / resistor solution will not work well.

I have developed a simple ATtiny based convertor that works like this:

RSSI Output -> ATtiny Input Pin -> Arduino program measures RSSI pulse length -> I2C DAC chip MCP4725 -> 0 - 5 volt output

RSSI Pulse length = 1000 microseconds -> 0.0 volts out (0% RSSI)
RSSI Pulse length = 1500 microseconds -> 2.5 volts out (50% RSSI)
RSSI Pulse length = 2000 microseconds -> 5.0 volts out (100% RSSI)

I want to feed this 0 - 5 volt signal into the RSSI Analog input on my MultiWii flight controller.

Is this of any use to anyone here? I would be happy to release circuit and code.....

citykid
This is not how FrSky RSSI works. It's a PWM signal that is 0 to 100% on time (positive pulse width), not like a servo signal, I do not remember the frequency, but it is much higher than the ~18ms servo frame. Most seem to use a 1K resistor and 10uF cap to make an rc filter (not a charge pump) for this PWM signal. It's also 3.3v max, so most input (OSD, APM, multiwii) is 0 to 5v and you get ~63% of max, but I think you can use a multiplier in openTx to adjust. Or could use a simple level shifter IC in the RSSI signal with 5 volts out, then the rc filter.
Homer: Here's to alcohol, the cause of - and solution to - all life's problems.

User avatar
citykid
Posts: 21
Joined: Tue Oct 29, 2013 10:47 am
Country: United Kingdom
Location: Birmingham

Re: Convert PWM to Voltage for RSSI

Post by citykid » Mon Nov 04, 2013 10:49 am

@Ozzy

Ahh right! This is what I'll need to check when I finally get a Taranis setup.

My little circuit would however sort a few problems:

1) Move the 0 - 3v3 RSSI signal up to proper 0 - 5v signal level.
2) Have the ability to output a serial message / byte / packet to represent the RSSI value.

I will wait until SOMEONE has some FrSky Taranis transmitters SOMEWHERE! Damn you Hobbyking!

Cheers!

citykid
Radios: Taranis X9D with homebrew haptic and LiPo battery & Horus X12S (Beta Unit 34) now PROD spec.

Chairman of Greenacres Model Aero Club - North Birmingham, UK

User avatar
Ozzy
Posts: 74
Joined: Sun Jul 08, 2012 7:57 am
Country: -

Re: Convert PWM to Voltage for RSSI

Post by Ozzy » Fri Nov 08, 2013 4:24 am

Even simpler cmos buffer or dual inverter could work too
Homer: Here's to alcohol, the cause of - and solution to - all life's problems.

User avatar
skyscraper
Posts: 48
Joined: Tue Oct 01, 2013 6:54 am
Country: -
Contact:

Re: Convert PWM to Voltage for RSSI

Post by skyscraper » Sat Nov 30, 2013 6:39 pm

FWIW Here is the schematic for my circuit for converting the output from a D4R-II used in PPM sum mode.

Image

The FrSky RSSI PWM frequency was measured as 110 kHz. The output voltage varies between 0 and 3.3 V ( well actually the duty cycle is given between 1% and 99% so not quite full range).

To make an RC low pass filter for this PWM frequency, then any combination of resistors and capacitors whose product is greater than 1 / 100 should give a very smooth voltage with good responsiveness of the order of 1/100th of a second or whatever the RC constant is ( eg 10k ohm resistor * 1 uF capacitor ( 10000 * 0.000001) = 1/100)

My choice of RC was a 10 K resistor (R1) and a 10uF capacitor (C1). I put these at the RcRx end so that the digital signal doesnt have to travel down a long wire and cause interference.

In my wing the RC receiver is mounted way out in one wing. When signals travel down cables they can pick up RF interference (which can result in the Ato D changing randomly by a few bits) so I used coax to shield the signal wire. Since the signal is analog and varying slowly I decided its ok to use the shield as a ground. The small capacitor C2 is there because large value Electrolytic capacitors (C1) have quite a high resistance so some of the digital PWM would feed through to the cable otherwise. C2 is also there to provide an AC termination of 75 ohms to ground at the input to the coax. R3 and C3 provide a similar function at the other end. C3 also provides a low impedance for the DAC to read.

The circuit gives a very stable RSSI value in my Goggles .

regards
Andy

stpfl
Posts: 1
Joined: Thu Aug 14, 2014 9:32 am
Country: -

Re: Convert PWM to Voltage for RSSI

Post by stpfl » Thu Aug 14, 2014 9:50 am

very nice skycrapper!

Do you get a nice useful RSSI Reading? Or does it stay verylong at about 100% and dropping then very fast to 0% in some cases. A smooth curve until 0% would be very great do give an idea of the useful range you get.

cjapka
Posts: 9
Joined: Sun Sep 09, 2012 7:54 pm
Country: -

Re: Convert PWM to Voltage for RSSI

Post by cjapka » Wed Mar 02, 2016 1:55 pm

Helo man, good work!
Do you think, that this will be functional also with other RXs? ,,,,,orange RX?

Thanks! Ondrej

User avatar
Rob Thomson
Site Admin
Posts: 4534
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Convert PWM to Voltage for RSSI

Post by Rob Thomson » Wed Mar 02, 2016 1:58 pm

I have another solution. Stupid easy to do!

1 x aduino pro mini
1 x dac (MCP4725)

simple arduino sketch :-) (attached)
Attachments
pwmVoltage.zip
(245.5 KiB) Downloaded 166 times
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

jonathanyeo
Posts: 82
Joined: Sat Nov 14, 2015 12:26 pm
Country: -

Re: Convert PWM to Voltage for RSSI

Post by jonathanyeo » Thu Mar 03, 2016 5:57 am

Won't this be more costly then two stage low pass filters ?

User avatar
Rob Thomson
Site Admin
Posts: 4534
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Convert PWM to Voltage for RSSI

Post by Rob Thomson » Thu Mar 03, 2016 6:04 am

Guess it depends on how ichor soldering you want to do.

The dac is very smooth - and the code has a nice arduino kalman filter. So really a question of what you want.

Sent from my SM-G920F using Tapatalk
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

jonathanyeo
Posts: 82
Joined: Sat Nov 14, 2015 12:26 pm
Country: -

Re: Convert PWM to Voltage for RSSI

Post by jonathanyeo » Fri Mar 04, 2016 11:03 pm

Rob,

I may have to do this to get ensure a smooth output and more elegance. Can you show a diagram of how they are connected ?

I have these SparkFun I2C DAC Breakout - MCP4725 https://www.sparkfun.com/products/12918 , I think I can use this without nano, but I need to feed in a clock signal.
1) Any idea where I can get a clock within Taranis hardware ?
2) How would I use this board with nano to get to your solution ?

Jonathan

User avatar
Rob Thomson
Site Admin
Posts: 4534
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Convert PWM to Voltage for RSSI

Post by Rob Thomson » Sat Mar 05, 2016 8:12 am

Hello

The pins are all shown in the code...

It's a whole since I made one - if you give me a few days I will put one together and detail the build.

Rob

Sent from my SM-G920F using Tapatalk
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

User avatar
Kilrah
Posts: 9492
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Convert PWM to Voltage for RSSI

Post by Kilrah » Sat Mar 05, 2016 8:17 am

jonathanyeo wrote: I have these SparkFun I2C DAC Breakout - MCP4725 https://www.sparkfun.com/products/12918 , I think I can use this without nano
Nope, you need a processor to convert to the proper data format and interface in all cases.

User avatar
Rob Thomson
Site Admin
Posts: 4534
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Convert PWM to Voltage for RSSI

Post by Rob Thomson » Sat Mar 05, 2016 8:18 am

The actual wiring up is very easy.

Just 4 wires if I am correct.

Two between the dac and arduino on the i2c bus.
One pwm input.
One voltage output.

Rob

Sent from my SM-G920F using Tapatalk
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

jonathanyeo
Posts: 82
Joined: Sat Nov 14, 2015 12:26 pm
Country: -

Re: Convert PWM to Voltage for RSSI

Post by jonathanyeo » Sun Mar 06, 2016 12:13 am

Thanks Kilrah, Rob,
Rob,

I have two Arduino http://www.banggood.com/5Pcs-ATmega328P ... 51782.html
and 4 x SparkFun I2C DAC Breakout - MCP4725 . I need to make 4 DAC, two axis for each of the two Tx stick.

Can I use one Arduino for all 4 DACs ? ANd what changes do I need to make to the wiring and program ?

Jonathan

User avatar
Rob Thomson
Site Admin
Posts: 4534
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Convert PWM to Voltage for RSSI

Post by Rob Thomson » Sun Mar 06, 2016 9:18 am

In theory you can run multiple i2c devices on the same bus.

It will however depend on if the i2c dac allows you to change its id.

What exactly is it you are trying to do? It's entirel possible that this solution would be better achieved in a different way.

Sent from my SM-G920F using Tapatalk
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

jonathanyeo
Posts: 82
Joined: Sat Nov 14, 2015 12:26 pm
Country: -

Re: Convert PWM to Voltage for RSSI

Post by jonathanyeo » Mon Mar 07, 2016 2:19 pm

Rob,
This is what I was doing Jeti Gimbal on Taranis "viewtopic.php?f=96&t=8537".
The DACis my alternative method as I am using low pass filter now.
Thanks again for your response.
Jonathan

Post Reply

Return to “Other Electronic Projects”