Arduino Forum

Community => Exhibition / Gallery => Topic started by: zitron on Feb 25, 2012, 09:10 pm

Title: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Feb 25, 2012, 09:10 pm
I was inspired by the OpenLRS project to make my own UHF remote control and telemetry for my FPV planes, but much cheaper!

You can get the RF22B 100mW (20dbm, many km range) tranceiver modules from HopeRF very cheaply, I got 6 for ~30 Euro. They are great transceivers, and there is a arduino library for them: http://www.open.com.au/mikem/arduino/RF22/ (http://www.open.com.au/mikem/arduino/RF22/). In the example code, there is a spectrum scanning demo. I changed the code a bit and wrote a PC program to make it easier to use:

250MHz to 960MHz sweep:
(https://sites.google.com/site/iluvtocnc/250960.png)

Close up at 434MHz:
(https://sites.google.com/site/iluvtocnc/434.PNG)

Pictures of the board:
(https://sites.google.com/site/iluvtocnc/IMG_8347.JPG)
(https://sites.google.com/site/iluvtocnc/IMG_8346.JPG)
(https://sites.google.com/site/iluvtocnc/IMG_8342.JPG)

The PC program (in C#, a modified version of my plotting program: http://arduino.cc/forum/index.php/topic,80462.0.html (http://arduino.cc/forum/index.php/topic,80462.0.html)) and arduino code are attached.

Have fun!


Edit: The arduino code posted here may have some problems, see this post for the new code: http://arduino.cc/forum/index.php/topic,93777.msg767772.html#msg767772

New version of PC program: http://arduino.cc/forum/index.php/topic,93777.msg767889.html#msg767889

Update on potential board problem: http://arduino.cc/forum/index.php/topic,93777.msg989562.html#msg989562

New version with telemetry support: http://arduino.cc/forum/index.php/topic,93777.msg1000972.html#msg1000972
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Mar 13, 2012, 08:09 am
Interesting, so this is a spectrum analyser....Have you also made the openlrs tx and rx yourself?
I would like to try and make my own openlrs boards and need some help, since the guys at the flytron forum are not answering my questions  :)..
Firstly, one the original openlrs board, he is running the atmega328 at 3.3V and 16MHz right? Since he needs 3.3V for rfm22..Do I see correctly in the schematic?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Mar 13, 2012, 04:12 pm
Yeah he uses 3.3V at 16MHz, which is not recommended, I run mine at the normal 5V. Also, he uses software spi which I find kind of weird, I use hardware spi...

I've made some boards (see attached picture) I tested to 600m range on the ground, through some houses. I also tested it on my helicopter last weekend, works great!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Mar 14, 2012, 08:39 am
Very nice lookin' boards really  8).... So you have some LLC to convert the 5V to 3.3V or so to not damage the rfm22b? I see the pcb is soldering friendly :D..
Did you have to modify the code in anyway to make it work on your boards, are is the board layout, per schematic and per code - just that it runs on 5V?
Are you willing to contact me by mail with some more details?

Do you sell the pcbs?

Another question about Melih's boards,...Does he have to use a 3.3V ftdi basic breakout to upload code or can he use 5V? I'm asking this because I don't know if current is flowing through the circuit while uploading a sketch, in that case 5V would damage the rfm22b.

A online friend of mine also build a spectrum analyser using openlrs...you guys are smart....I would  need one for 5.8ghz but he said it would be  hard to source parts for 5.8ghz... =(
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Mar 15, 2012, 12:18 am
My boards are laid out completely differently compared to the OLRS, I did not used his code at all, but wrote my own code using the arduino RF22 library instead. I have attached my schematics. Flytron's code will not will on mine without significant modifications, and vice versa. My atmega328 runs at 5V, and the RF22 runs at 3.3V from a SMD regulator on the back of the board, the 5V SPI commands from arduino are sent to the module after going through a voltage divider.  My boards are a little to big, I'm planning to make them smaller the next time.

I can send you a couple of the boards free if you pay for the postage, but please understand that I don't really want to start a business selling boards!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Mar 15, 2012, 03:59 pm
Thanks for the schematics! I would be interested :) in a few (3 or 4), I don't care about size, for me bigger is better since its easier to solder slightly bigger stuff..Very nice!

Would you also share the code? Is your code also frequency hopping? Do you have failsafe implemented? Do you have rssi implemented (would it be possible to have an audible alarm, if I connected a buzzer to the board), can rssi be taken from the board (on the plane or heli) to an osd? Is it possible to configure the power output of the module - for example to use a booster.

Are you familiar with multiwii (http://code.google.com/p/multiwii/ , http://www.multiwii.com/ )? Probably it would be possible to incorporate multiwii in your design, because the relevant pins (SDA and SCL) for interfacing with sensors are free right?
I would like to have my plane stabilized and autolevel,...Since your board is 5V unlike Melihs, I can use a original wii-motion+ as a gyro,...and as a accellerometer I will use a adxl345 which has already an LLC and voltage reg. on board.

Instead of using a SMA connector like on your photo, could I just solder the coax directly to the pins? (central conductor+shielding)

Are those two leds on the board useful for diagnostic if the boards are working, for example uploading blink sketch?

How far away did you go with your heli :D?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Mar 15, 2012, 11:57 pm

Would you also share the code? Is your code also frequency hopping? Do you have failsafe implemented? Do you have rssi implemented (would it be possible to have an audible alarm, if I connected a buzzer to the board), can rssi be taken from the board (on the plane or heli) to an osd? Is it possible to configure the power output of the module - for example to use a booster.


Ok lots of questions...

I yeah I will share the code, there are some problems with it. The arduino servo library creates weird glitches, so I had to use software servo. I would also like to test it some more before I give to other ppl. I don't have FH right now, but the RF22 library supports it, so will not be too difficult if you want to add it yourself. RSSI yes, you will have to use analogWrite and low pass filter it if you want to output a voltage though. I actually have a header to add a switch to change the power from 1db to 20db for range testing.


Are you familiar with multiwii (http://code.google.com/p/multiwii/ , http://www.multiwii.com/ )? Probably it would be possible to incorporate multiwii in your design, because the relevant pins (SDA and SCL) for interfacing with sensors are free right?
I would like to have my plane stabilized and autolevel,...Since your board is 5V unlike Melihs, I can use a original wii-motion+ as a gyro,...and as a accellerometer I will use a adxl345 which has already an LLC and voltage reg. on board.

Instead of using a SMA connector like on your photo, could I just solder the coax directly to the pins? (central conductor+shielding)

Are those two leds on the board useful for diagnostic if the boards are working, for example uploading blink sketch?


Ok a bit of bad news. I planned to use the arduIMU for stabilization, so I did not really want to use I2C. So although you can use SDA and SCL, they are also used for the LEDs! So if you want to use I2C, you can't use the on-board LEDs.

Yeah you can definitely just solder coax directly to the board, that's what I did on my prototype.


How far away did you go with your heli :D?


Not very far, maybe 25m. It's a small HK450, I can only see it that far...
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Mar 16, 2012, 06:16 pm
Hi.. What about failsafe? Do you have it already implemented, could it be implemented that one would preconfigure the arduino sketch to a certain level of rssi, and it would go in to failsafe then...

Did you make your own antennas for your LRS? Are you planning to make a LOS test? People get about 4km with openlrs on omnidirectional antennas..

Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Mar 17, 2012, 02:10 am
No I do not have failsafe yet, I've only just started the project! I have the bare minimum: a tx which reads PPM and a rx that drives servos (and some basic mixing). If you want failsafe you will have to do it yourself. Are you able to write code for arduino?

I did make my own antennas, see the pictures in the first post. I want to do a LOS test but it will be difficult where I live.

I have another person ask me for some boards, I only have 4 boards left, if he still want them, you can each have 2. PM me where you live I'll look up how much it costs to post from the UK. Or I can give your the gerber files so you can have boards made yourself. Make sure you can source all the components, I have attached a bill of materials.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Mar 17, 2012, 03:26 am
Here's a scanned picture of the board, so you can see the details. Note that there is a mistake, R1 should connect to the atmega reset pin (the square pin), not to C5. It still works, but if you have problems with serial auto-reset, you should cut the trace and connect R1 to reset directly.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Mar 19, 2012, 09:30 am
It looks nice zitron!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Mar 21, 2012, 02:15 am
Good news, I decided to make a new version of the board (just smaller and fix the reset resistor). So if you guys still want the current boards you can all of them (3 each).
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Mauzer on Mar 21, 2012, 08:09 am
I want  :)
I've sent you PM.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on Mar 21, 2012, 10:34 am
Hello Zitron,

Great work and very interesting that you made your own design boards.

I see you are in the UK, have you seen the FPVUK forum post(s) regarding 459MHz use?
It would be good to see you over there.

http://www.fpvuk.org/forum/index.php?topic=2551.new;topicseen#new

What are your plans for the smaller PCB?

I'd be very interested in a couple of smaller (Futaba module compatible) boards - I'm willing to assist with costs.

Regds,

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Mar 21, 2012, 04:31 pm
Devonian are you willing to modify the interesting features of openlrs firmware (failsafe, rssi etc.) to work on this nice hardware?

Edit: Zitron hope you received my pm with my address. Zitron hope you retain the same connections on your board so more code fluent friends on this forum can help me out with the code :D
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Mar 21, 2012, 11:10 pm

I see you are in the UK, have you seen the FPVUK forum post(s) regarding 459MHz use?
It would be good to see you over there.

http://www.fpvuk.org/forum/index.php?topic=2551.new;topicseen#new


The ability to use 459MHz was partly why I started the project! I have been reading the fpvuk and openlrs forums for a while, but I don't really want to go in and be seen as competing with OpenLRS. This is just a personal project. Although it would be nice to have some local RC people help with some testing. I don't really have many friends near me that enjoys going out to do range tests!!


What are your plans for the smaller PCB?

I'd be very interested in a couple of smaller (Futaba module compatible) boards - I'm willing to assist with costs.


They are only slightly smaller. Rev1 was 50x50mm, Rev2 will be 50x43mm. Right now they don't quite fit inside my 9x radio, the new ones should just fit. They are not designed to fit into Futaba modules, and because they run at 5v you will need to modify your radio slightly to get a 5V wire out. I attached some pictures to show how ghetto my mounting method is!

I would like to keep the large DIP 28 atmega328, because it's easier to get, solder, program bootloader and because I have a lot of them! Making boards is really cheap, I don't really need any financial support for that. What I plan to do is release the gerber files, so that if anyone want some boards all they have to do is to send the files to a PCB fab. It would be really nice to have more people help with the software though.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Mar 21, 2012, 11:27 pm

Devonian are you willing to modify the interesting features of openlrs firmware (failsafe, rssi etc.) to work on this nice hardware?

Edit: Zitron hope you received my pm with my address. Zitron hope you retain the same connections on your board so more code fluent friends on this forum can help me out with the code :D


I will reserve 3 for you and send 3 to Mauzer. So now I don't have any more to give away.

I have attached my Tx code, an Rx test code (no servo) and the code used on my HK450 heli, which is a little bit complex because it has CCPM and PID governor. You need to install the arduino RF22 library, and software servo library (I'm having some glitching problems with the default hardware servo library). Please understand that this is just my personal project, not yet a proper ready to use general purpose tx/rx, I have only implemented the things I wanted.

Right now the software only supports transmission on a single frequency (I set it at 459.5, but you can change it to whatever you want), 8 channels at ~50Hz. The Tx takes PPM.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 10, 2012, 06:16 am
Great stuff!  It is the most simple and cheap Lrs that I have seen, just amazing.  Zitron, Did you have an additional pair of boards that could sell me? Where I live I can not get anyone to manufacture pcb's with that professional look in few quantities. I was thinking of trying to do a diy Openlrs, but now I saw this topic ... no way!
Next project: Zitron lrs cheap!  :)

Thanks in advance,

Daniel
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 11, 2012, 12:49 am
Yeah I can send you the 3 rev 1 boards msev wanted. I can send him the new boards if he still wants them.


BTW I don't know if anyone would be interested in this, but I have found that the RF22 library is not compatible with timer based hardware servos. Very weird and hard to debug. It is because the interrupt driven read function takes too long, messing up servo PWM timings. I had to modify the library quite a bit, but now I have hardware servos! If anyone else have problems with the servo library I'll let you know what to change.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Mauzer on Apr 11, 2012, 08:17 am
Hi Zitron,

Discover the secret - where do you manufacture the PCBs?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 11, 2012, 11:00 am

Yeah I can send you the 3 rev 1 boards msev wanted. I can send him the new boards if he still wants them.


Zitron, this is great!  Glad to be able to get into your project. I'll send you a pm.

Thanks ;)
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 11, 2012, 06:37 pm

Hi Zitron,

Discover the secret - where do you manufacture the PCBs?


I use iteadstudio.


edit: BTW did you manage to get it working?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 11, 2012, 06:44 pm
OK guys sorry I can't keep giving away boards for free. From now on I will charge a small fee (£2 per board) just to cover my costs.

Before you decide to start this project, make sure you can write code for arduino, ideally have some knowledge about SPI communincations, can solder SMD packages, and can find all the components that you need, listed in the BOM pdf attachted in a previous post. I can help, but I don't have time to answer all the questions.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 11, 2012, 06:52 pm
Oh also if you want to know where to get the RF22 module, have a look at the HopeRF resellers, find one near you: http://www.hoperf.com/agent.htm (http://www.hoperf.com/agent.htm)

I get mine from Germany.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 11, 2012, 07:58 pm

OK guys sorry I can't keep giving away boards for free. From now on I will charge a small fee (£2 per board) just to cover my costs.


More than fair! 


Before you decide to start this project, make sure you can write code for arduino, ideally have some knowledge about SPI communincations, can solder SMD packages, and can find all the components that you need, listed in the BOM pdf attachted in a previous post. I can help, but I don't have time to answer all the questions.


I can solder SMD and get all the components needed; I have lots of open source arduino projects done but... I don't write arduino code... if you do not mind sending me the actual code, as well as any updates, I think I'll have no problems. If you do not mind that your project is shared, I think it might bring some progress in the project through some friends. But as I said before ... I do not write code...
Zitron What do you think? It is worth I join the project? 
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Apr 11, 2012, 09:14 pm
Zitron sorry for the late response.. You can send/sell the pcbs that you reserved for me to other guys...
I'll probably make my own diy single layer boards and use an arduino nano..I'll make the connections per flytrons schematic so that I won't need to tinker too much with the code..I'll make the nano removable so that I could remove it from the board when uploading new sketches (since 5V would kill the rfm22b)..

I would take yours if there would be a possibility to easily port openlrs code...but its a bit too complicated for me..
Hope you continue with your nice project and post code...Hope then when you write your code for lrs you'll still have some pcbs to sell :D.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on Apr 11, 2012, 09:35 pm
Hi Zitron,

I'm still interested, I'll PM you over on FPVUK.

Regds,

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 11, 2012, 10:40 pm

I can solder SMD and get all the components needed; I have lots of open source arduino projects done but... I don't write arduino code... if you do not mind sending me the actual code, as well as any updates, I think I'll have no problems. If you do not mind that your project is shared, I think it might bring some progress in the project through some friends. But as I said before ... I do not write code...
Zitron What do you think? It is worth I join the project? 


You/anyone can use my design files and code for whatever purpose. Just make sure you know what you are getting into, it's not a fully featured product, and will likely to have many problems.


Zitron sorry for the late response.. You can send/sell the pcbs that you reserved for me to other guys...
I'll probably make my own diy single layer boards and use an arduino nano..I'll make the connections per flytrons schematic so that I won't need to tinker too much with the code..I'll make the nano removable so that I could remove it from the board when uploading new sketches (since 5V would kill the rfm22b)..

I would take yours if there would be a possibility to easily port openlrs code...but its a bit too complicated for me..
Hope you continue with your nice project and post code...Hope then when you write your code for lrs you'll still have some pcbs to sell :D.


I think that is probably the best thing for you to do. Trying to port someone else's code will be very time consuming, especially if you have limited experience! Also bear in mind that by the time you bought your nano, all the components and boards I think you might as well buy direct from Flytron! It would be really nice if they released a DIY OLRS kit.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 12, 2012, 12:42 am
Here are some pictures of the new Rev 2 board. It's 50x43mm compared to 50x50 Rev 1.

If you are building one I suggest soldering the SMD components first, and use a bigger cap in C7 (I said 100uF in BOM, probably should be 470uF) especially if you use a lot of servos.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Apr 12, 2012, 09:25 am
Looks great Zitron, a piece of art!

Using those cheap chinese nano clones, i think i can get bellow the price of one Melih's receiver and I also save for a ftdi, since they have an onboard ftdi (I would remove the nano from the headers when uploading)..

I'd be interested in buying a booster pcb from you (same layout as Melih for the same chip), maybe if you could design it in a way that the resistors, caps, diodes,  etc would be of a bigger size, for easier diy work...Do you manufacture these pcbs by yourself?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Mauzer on Apr 12, 2012, 09:51 am

edit: BTW did you manage to get it working?


Not yet. Waiting for RFM22 boards...
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 12, 2012, 01:18 pm
These boards looks great! 


BTW I don't know if anyone would be interested in this, but I have found that the RF22 library is not compatible with timer based hardware servos. Very weird and hard to debug. It is because the interrupt driven read function takes too long, messing up servo PWM timings. I had to modify the library quite a bit, but now I have hardware servos! If anyone else have problems with the servo library I'll let you know what to change.


Can you upload your modifyed library or explain here what to change?  Did you solved the glitches issue with this mod?

Regards
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 12, 2012, 06:22 pm

I'd be interested in buying a booster pcb from you (same layout as Melih for the same chip), maybe if you could design it in a way that the resistors, caps, diodes,  etc would be of a bigger size, for easier diy work...Do you manufacture these pcbs by yourself?


Yeah except I really don't know much about RF design... If I tried to make one of those high power amps it would probably catch fire!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 12, 2012, 06:29 pm

Can you upload your modifyed library or explain here what to change?  Did you solved the glitches issue with this mod?


Well I fixed the glitch problem awhile ago by using software servos, now hardware servos are also working, which is more processor efficient.

I will try to release a simple "reference" code sometime next week, it will include all the libraries, and will be a simple PPM->Tx->UHF->Rx->Servos thing.

Edit: Important notice, please make sure that you can find a 5V source on your radio, this board does not have a voltage regulator for the arduino, so you can not power it direct from your TX battery. 
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 12, 2012, 07:53 pm


te]
Edit: Important notice, please make sure that you can find a 5V source on your radio, this board does not have a voltage regulator for the arduino, so you can not power it direct from your TX battery. 


Well, my TX is a Graupner MC-19, I think that a LM7805 can solve the problem dont?  Anyway, I do intent to use your tx uhf with a joystick that generates the ppm signal from another arduino (details here: http://www.ianjohnston.com/content/index.php?option=com_content&view=article&id=30:project-rc-ppm-trainer-port-joystick) I have done this on my homemade console that you can see here at work:
http://www.youtube.com/watch?v=wIUw7Lfdme4

The joystick will be a old but cool "Top Gun" , and a pair of old T2m rudder pedals, all for FPV obviously.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 12, 2012, 08:53 pm

Yeah except I really don't know much about RF design... If I tried to make one of those high power amps it would probably catch fire!


Don't worry man, i have a uncle that is firefighter ... :D     If you make one RF booster, I'll test for you!  XD 
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Apr 12, 2012, 11:37 pm


Yeah except I really don't know much about RF design... If I tried to make one of those high power amps it would probably catch fire!


No need to worry about that since at would be runing it at 1/7 of its total output power and in such conditions you dont even need a heatsink for the chip..
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 12, 2012, 11:40 pm

The joystick will be a old but cool "Top Gun" , and a pair of old T2m rudder pedals, all for FPV obviously.


Wow that is pretty cool, and yes LM7805 will work fine, that's what I use. The board draws very little power.


Also I thought I should update the schematics and bill of materials, there are some slight changes. See attached.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 12, 2012, 11:43 pm

No need to worry about that since at would be runing it at 1/7 of its total output power and in such conditions you dont even need a heatsink for the chip..


One step at a time, let me get this simple board working properly first!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Apr 13, 2012, 10:29 am


One step at a time, let me get this simple board working properly first!


You are right! It will take me a lot of time till I'm at the stage to start building olrs....since I intend to first try and play with a diy 2.4ghz booster based on rf2126 chip...

In the meantime I'd like to ask you, which vreg could be a suitable replacement for the one Melih uses - mic5205...I read the datasheet and saw it has a really low dropout voltage or something like that..Is there any other which has a low dropout voltage but a higher maximum current?

So you use LM1117?

Regarding Melihs design besides powering the atmega and rfm22, does anything else use power (maybe the driving of the servos? and if so do they use such a small amount)? Because that mic5205 has a small max current..
Thanks!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 13, 2012, 08:07 pm

In the meantime I'd like to ask you, which vreg could be a suitable replacement for the one Melih uses - mic5205...I read the datasheet and saw it has a really low dropout voltage or something like that..Is there any other which has a low dropout voltage but a higher maximum current?

So you use LM1117?

Regarding Melihs design besides powering the atmega and rfm22, does anything else use power (maybe the driving of the servos? and if so do they use such a small amount)? Because that mic5205 has a small max current..
Thanks!


The RF22 only draws 85mA at full power, plus maybe 20mA for the atmega. Also the transmission only happens in quick bursts so it's not always on. The mic5205 should be plenty, since servos are powered separately from the BEC. I think any regulator will work as long as the drop out voltage is not much more than 1V, obviously lower is better to prevent brownouts.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Apr 13, 2012, 08:22 pm



The RF22 only draws 85mA at full power, plus maybe 20mA for the atmega. Also the transmission only happens in quick bursts so it's not always on. The mic5205 should be plenty, since servos are powered separately from the BEC. I think any regulator will work as long as the drop out voltage is not much more than 1V, obviously lower is better to prevent brownouts.


Thanks! you gave a very clear answer :D...Why does flytrons TX module have 2 vregs, mic5205 and a LM2937?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 14, 2012, 06:18 am
What you think about a integration of the RFM12BP with your circuit in the future? Seems to be very similar to rfm22 but with 500mw. It is possible without modifications on your code?

Regards
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 14, 2012, 01:34 pm

Thanks! you gave a very clear answer :D...Why does flytrons TX module have 2 vregs, mic5205 and a LM2937?


They use 2 at the same time?? I really donno, will have to look at their schematics...


What you think about a integration of the RFM12BP with your circuit in the future? Seems to be very similar to rfm22 but with 500mw. It is possible without modifications on your code?


No the RFM12BP (and lower power RFM12) uses a completely different RF chip. Although there are probably arduino code for it somewhere on the intarwebs since it's been around for a while.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Apr 14, 2012, 02:22 pm
Yep two vregs, one normal and one ldo...Is it because of the buzzer, since thats the only additional element added.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 14, 2012, 10:37 pm

No the RFM12BP (and lower power RFM12) uses a completely different RF chip. Although there are probably arduino code for it somewhere on the intarwebs since it's been around for a while.


Ok, will be easier to maintain rfm22 and when everything is operational, use the rf2126 booster mentioned by msev (datasheet says it is compatible with 433MHz).
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Apr 14, 2012, 11:09 pm
What would I have to modify in the circuit to use it for 433MHz? In regards to that example circuit for 2.4GHz?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 14, 2012, 11:23 pm
Take a look in the attached file. 
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: msev on Apr 15, 2012, 09:46 am
Thanks, I must have had a "shortened" version of the datasheet... That looks great..hope these chips will still be available once I get to the stage of building a booster...Dfidalgo if you build it be sure to post some pics of it, a tell where you got the chip  :)
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on Apr 16, 2012, 03:56 pm
Today I received the Zitron PCB's, look much better in my hands than here in the pictures !   :D
Now just need to buy the RFM22.

Thanks Zitron ;)
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on Apr 16, 2012, 04:30 pm
My PCB's are in the post as well :)

I ordered my HopeRF modules here
http://rf-store.com/index.php?s_phr=rfm&pv=search&view=2

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Mauzer on Apr 16, 2012, 04:42 pm
What differences are between RFM22-S1 and RFM22-S2? Only the crystal size?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on Apr 16, 2012, 04:48 pm

What differences are between RFM22-S1 and RFM22-S2? Only the crystal size?


Yes, as far as I am aware, plus €0.50 better price !!

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 16, 2012, 05:25 pm

Today I received the Zitron PCB's, look much better in my hands than here in the pictures !   :D
Now just need to buy the RFM22.


Cool! Let me know how it goes!


What differences are between RFM22-S1 and RFM22-S2? Only the crystal size?


I heard someone mention that the bigger crystals have better frequency tolerances, but that could be just a rumour.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 18, 2012, 07:13 pm
Hi guys,

For those of you building the board, here's a test code to make sure that the ATMEGA is working. It simply blinks the red and green LEDs:

Code: [Select]

#define OUTA 18
#define OUTB 19

unsigned int duration = 500;

void setup()
{
  pinMode(OUTA, OUTPUT);
  pinMode(OUTB, OUTPUT);
}

void loop()
{
    digitalWrite(OUTA,HIGH);
    digitalWrite(OUTB,LOW);
    delay(duration);
    digitalWrite(OUTB,HIGH);
    digitalWrite(OUTA,LOW);
    delay(duration);
}


Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on Apr 20, 2012, 07:57 pm
I got my parts together now for a build of Zitrons latest board.

Works fine with the 'blink' test program.

When trying to compile the specan.pde - I get lots of errors due to missing files...
FastSerial.h
RF22.h
C++.h
Menu.h  -- and many more.

@ Zitron,
I guess you use other library files when making your specan & Tx/Rx firmwares.

Is there some single download I can get the required lib files or do I need to hunt them down individually?

EDIT
Tracked down a bunch of missing lib files and now the only remaining compile error is:

C:\Arduino\arduino-0023\libraries\RF22\RF22_Specan.cpp:379: error: prototype for 'boolean RF22::setFrequency(float)' does not match any in class 'RF22'
C:\Arduino\arduino-0023\libraries\RF22/RF22.h:813: error: candidate is: boolean RF22::setFrequency(float, float)

What do I need to change/add??

/EDIT


So close and yet so far !!

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Rustie0125 on Apr 21, 2012, 02:08 pm
Hi Great Find this Good work !!!!!!!

I downloaded the programs and Pde. but i get compilation errors almost so much that it looks like im missing a library , can some one please confirm this ? i have played with the RF22 modules alot so i have the RF22.h libraries but i cant get this source code to compile

any help would be great
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 21, 2012, 02:55 pm
Hi,

I knew there would be problems!

Which version of arduino are you using? I'm using 0023, I have not tested it on version 1.0.

Try this version of the specscan without the fastserial stuff:

Code: [Select]
// rf22_specan
// A simple spectrum analyser for the RF22
// Uses the RSSI measurement to plot signal strength
// against frequency
// Specify the start and and requencies and the step size below.
// The output is suitable for a VT100 terminal emulator
// Note the baud rate is set to 115200 for better performance,
// but you can change this to suit your needs
//
// TO DO: add some interactivity
// Copyright Mike McCauley

// modified to work with PC program
// Zitron

#include <RF22.h>
#include <SPI.h>
#include<stdlib.h>

#define redLED 18
#define greenLED 19

char temp[51];
uint8_t rssi;
// Singleton instance of the radio
RF22 rf22;

void setup()
{
  pinMode(redLED, OUTPUT);
  pinMode(greenLED, OUTPUT);
 
  Serial.begin(115200);
  if (!rf22.init())
    Serial.println("RF22 init failed");

  rf22.setModemConfig(RF22::GFSK_Rb2Fd5);
  rf22.setModeRx();
  // Defaults after init are 434.0MHz, modulation GFSK_Rb2_4Fd36
  digitalWrite(greenLED, HIGH);
}

float Start = 430;
float End = 460;
float Step = 0.1;

float freq;

void loop()
{
  ProcessRx();
 
  for (freq = Start; freq < End; freq += Step)
  {
    rf22.setFrequency(freq);
    digitalWrite(redLED, LOW);
    delayMicroseconds(6000); // Let the freq settle
    digitalWrite(redLED, HIGH);
    rssi = rf22.rssiRead();
   
   
    Serial.print(rssi, DEC);
    Serial.print(",");
   
    //Serial.println(dtostrf(freq,0,3,temp));
  }
  Serial.println();
  //Serial.println("");
}

void ProcessRx() {
  byte n = 0;
  byte m = 0;
  char* sptr1;
  char* tempstr;

  if (Serial.available()) {
    temp[n] = Serial.read();
    while ((temp[n] != '\n')&&(n<50)) {
      if (Serial.available()) {
        n++;
        temp[n] = Serial.read();
      }
    }

    //Serial.println(temp);

    tempstr = strtok_r(temp,",\n",&sptr1);

    do
    {
      switch (m) {
      case 0:  // Wheel 1
        Start = atof(tempstr);
        break;
      case 1:  // Wheel 2
        End = atof(tempstr);
        break;
      case 2:  // Wheel 3
        Step = atof(tempstr);
        break;
     
      }
      m++;
    }
    while (tempstr = strtok_r(NULL, ",\n",&sptr1));
  }
}



I have also uploaded my modified version of the RF22 lib.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Rustie0125 on Apr 21, 2012, 04:02 pm
Hi

I loaded both versions now and they seem to work great . thanx , one question , they PC application seem to very slow updating the graph
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 21, 2012, 04:17 pm

Hi

I loaded both versions now and they seem to work great . thanx , one question , they PC application seem to very slow updating the graph


Update speed depends on how many steps you are scanning. By default it scans from 430-460MHz at 0.1MHz step (300 samples), which is a bit slow. You can make it faster by increasing the step size or reducing frequency range.

BTW are you using your own board??
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Rustie0125 on Apr 21, 2012, 04:20 pm
yes im running a RF22 on a R3 UNO .
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Rustie0125 on Apr 21, 2012, 04:35 pm
just few questions to clarify if what im seing is correct.
below is a picture of a test running currently running on the bench.


if you look at the picture with only the RF22 switched on that is working as the receiver it would appear that there is a very high signal detected in the UHF range where i stay ? or am I seing it wrong ?

also the labeling of the dBs on the left hand side would it not make more sence if it started form -120 at the top and -20 at the bottom? I arleady made the mistake at looking at the spike but in reality if i understand it correct is actually the lowest detected frequency that im looking at , can it be swapped ?

other question is , I have a 17cm antenna on my receiver this would offcourse make a differences for freq. in the 800 or 900 range . what then ? or is this meant to  be used with Rf probes only and not general area scanning ?

thanx for any advice , really keen on useing this more
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on Apr 21, 2012, 04:45 pm
Hi Z,

I'm also using 0023.

I made a clean install on netbook and copied your RF22 library (from your post above) into the clean libraries folder.
Copied the code (from above) and made a new pde called 'rf22_specan_simple' and veried it.
It compiled OK.

Ran up your RF22SpecScan.exe and it runs fine.

I'll try some more later on my main PC and Laptop as this is where I want to mostly use it.

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 21, 2012, 05:38 pm

Hi Z,

I'm also using 0023.

I made a clean install on netbook and copied your RF22 library (from your post above) into the clean libraries folder.
Copied the code (from above) and made a new pde called 'rf22_specan_simple' and veried it.
It compiled OK.

Ran up your RF22SpecScan.exe and it runs fine.

I'll try some more later on my main PC and Laptop as this is where I want to mostly use it.

Nigel.


OK that's good.


if you look at the picture with only the RF22 switched on that is working as the receiver it would appear that there is a very high signal detected in the UHF range where i stay ? or am I seing it wrong ?

also the labeling of the dBs on the left hand side would it not make more sence if it started form -120 at the top and -20 at the bottom? I arleady made the mistake at looking at the spike but in reality if i understand it correct is actually the lowest detected frequency that im looking at , can it be swapped ?


That looks pretty normal.  The RF22 is not meant to be a spectrum analyzer, it will only work properly for the frequency range the module and antenna is made for. You can force it to whatever frequency you want, but results will not be accurate.

RSSI is a logarithmic scale, you are reading it wrong. See http://en.wikipedia.org/wiki/DBm (http://en.wikipedia.org/wiki/DBm)

I just remembered that that I have made some small improvements to the PC program, I have attached the new version.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Rustie0125 on Apr 21, 2012, 06:24 pm
Okay

thanx for confirming that . so for example if the RF22 radio max output is 17-20dBs then if i transmit next the the analyzer i will see a 20 dB jump in the graph but so if it was -120 it will  be -100 or around there.

regarding the Antenna issue , all i really wanna test with these unit is if RF equipments is working or not. for example if i have a 433mhz remote i just want to Tx next to it and see a jump in the graph so Accuracy is not that big of a problem. what i think i would do is make a small Antenna relay board with antenna's made for 900mhz, 433mhz and 600mhz and when i switch between them the reply will latch to the correct antenna Automatically i know its not the best but i think it will be best this setup can do.

are you planning on upgrading the Pc app with more functions ?

like to see if you can set a start line on the average incoming signal and the app will update the max output line at the top of the graph and under the setting just show a tab that updates the dB difference between the two lines.

but thank you for all the advice and info looking forward hearing form you regarding the boards
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on Apr 25, 2012, 10:18 pm
This is and excellent project! :)
I really want to try it out in my FPV quads.

Does anyone has PCB's to sell?
Unfortunately I have no way to make them.
(well I could but I'd probably ended up sleeping in the balcony)

Thanks!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on Apr 25, 2012, 11:54 pm
This is exactly what this is - a DIY project.

It would be nearly the same cost to make a few by hand and sell to you as it would be to buy commercially.

Have you seen this?
http://flytron.com/16-openlrs

Forum support as well
http://forum.flytron.com/viewforum.php?f=7&sid=5794eb0b6f028f25cacb8b980bba52fa

HTH

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 26, 2012, 11:25 am

thanx for confirming that . so for example if the RF22 radio max output is 17-20dBs then if i transmit next the the analyzer i will see a 20 dB jump in the graph but so if it was -120 it will  be -100 or around there.


You will only see a 20dB jump if you were perviously transmitting at 0dB! Theoretically, if you are transmitting at 0dBm (1mW), and connect the tx directly to the rx with a coax cable (do not do this!) you will see 0dBm on the receiver. However in real life and if you are using antennas, you will see the rx RSSI change from about -20 (the RF22 will not report RSSI higher than -20) to -100 as you move the rx away from the tx.


regarding the Antenna issue , all i really wanna test with these unit is if RF equipments is working or not. for example if i have a 433mhz remote i just want to Tx next to it and see a jump in the graph so Accuracy is not that big of a problem. what i think i would do is make a small Antenna relay board with antenna's made for 900mhz, 433mhz and 600mhz and when i switch between them the reply will latch to the correct antenna Automatically i know its not the best but i think it will be best this setup can do.

are you planning on upgrading the Pc app with more functions ?

like to see if you can set a start line on the average incoming signal and the app will update the max output line at the top of the graph and under the setting just show a tab that updates the dB difference between the two lines.


That will probably work ok, but you will need to write your own code. I might add more to the PC program, but it's not really a priority. You can do your own data processing by collecting the serial data and plotting them in MS Excel or MatLab or even do it on the arduino chip.



This is and excellent project! :)
I really want to try it out in my FPV quads.

Does anyone has PCB's to sell?
Unfortunately I have no way to make them.
(well I could but I'd probably ended up sleeping in the balcony)

Thanks!


Basically what Devonian said. If you want one or two boards that work right out of the box, you are better off getting the openlrs. I only have the bare pcbs.

BTW, Nigel did you get the thing working on your main PC? If your boards are working properly I'll put together some RC PPM code this weekend for you to test. I've not really been motivated to do much this past week because of the terrible weather!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on Apr 26, 2012, 12:09 pm
Hi Z,

My first board works just fine as a spec analyser.
I've yet to build my other boards.

I'm a bit like you, no big motivation for UHF at the moment (I have OpenLRS for UHF R/C), plus I have a couple other projects - including weather monitoring, maybe with an RFM22B and an Arduino ;)
With the British weather, you should get on it !

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on Apr 26, 2012, 12:30 pm

Basically what Devonian said. If you want one or two boards that work right out of the box, you are better off getting the openlrs. I only have the bare pcbs.


My problem sorry, I wasn't that clear.
I'm more of the soldering station type, I prefer to assembly my own gear. :)

I know about Flytron gear I actually bought some other parts from them, but yes my intention is to get bare PCB's.
I have all the remaining parts just the PCB that is missing.

I got some time ago some similar RFM boards (RFM21 I believe) to do a telemetry project but got sidetracked and ended
going for BlueTooth and developing an app for it. And the the boards are still here getting dust.

But what you share here is on a another level  (special in what concerns range) and rather interests me, so I eager to try it
and put my hands on the code as well. :)

PS: I got you guys on the weather (Ireland here)
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on Apr 28, 2012, 07:48 pm
Hi zitron,

Where did you get your RFM22B? The only that I can find seem to have the emitting power locked and can't do the 100mW.

Thanks
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 28, 2012, 08:25 pm

Hi zitron,

Where did you get your RFM22B? The only that I can find seem to have the emitting power locked and can't do the 100mW.

Thanks


http://arduino.cc/forum/index.php/topic,93777.msg756875.html#msg756875


I know about Flytron gear I actually bought some other parts from them, but yes my intention is to get bare PCB's.
I have all the remaining parts just the PCB that is missing.

I got some time ago some similar RFM boards (RFM21 I believe) to do a telemetry project but got sidetracked and ended
going for BlueTooth and developing an app for it. And the the boards are still here getting dust.

But what you share here is on a another level  (special in what concerns range) and rather interests me, so I eager to try it
and put my hands on the code as well. :)


Oh, does that mean you can help with the code?? I have 4 boards left, Rustie0125 wants 1, so you can have the last 3. PM me your address, email and how many you want.


My first board works just fine as a spec analyser.
I've yet to build my other boards.

I'm a bit like you, no big motivation for UHF at the moment (I have OpenLRS for UHF R/C), plus I have a couple other projects - including weather monitoring, maybe with an RFM22B and an Arduino ;)


Cool. I can help you with the code if your weather telemetry project is something simple, like tx/rx of serial data or something.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on Apr 28, 2012, 08:46 pm
Hi Z,

I'm gathering together some bits as the data is apparantly sent over 433.92MHz AM radio by OOK (On-Off-Keying) and there is some info on the 'tinterweb about the protocols used.

I may just get another weather station with serial out on the receiving consol and do it that way.

I also have a Raspberry Pi on order (for ages now), maybe a low power web server and automatic weather station??!!

Too many projects and not enough time...!

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on Apr 28, 2012, 10:24 pm
Thanks zitron, I'll send you a PM.
Yes I do plan to help with the code. :)

In regards to the RFM22B I've talked to someone that is trying to get some as well and the only ones he could find
available were the RFM22B-868-D, will those work?
Does it need to be the 433 model or it's possible to change the frequency.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Rustie0125 on Apr 29, 2012, 08:10 am

Okay  one thing iv noticed between the different in graph that you postted and the one i posted yours seems to be a lot cleaner and not as jagged spiked like mine . but that said mine is set to max output.

once i get my board from you i would like to use it to test home made 433 radios . what would be the best set of settings for use with RF probes and not antennas? i would image i would set the Tx/Rx power right down to minimum ?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 29, 2012, 04:49 pm

Hi Z,

I'm gathering together some bits as the data is apparantly sent over 433.92MHz AM radio by OOK (On-Off-Keying) and there is some info on the 'tinterweb about the protocols used.

I may just get another weather station with serial out on the receiving consol and do it that way.

I also have a Raspberry Pi on order (for ages now), maybe a low power web server and automatic weather station??!!

Too many projects and not enough time...!

Nigel.


The RF22 can certainly do OOK, but it will not be trivial to do the software to read whatever protocol they use... Maybe it's possible to intercept the data before it gets to the transmitter on the weather station, and use your own tx rx? I also want a Raspberry!


In regards to the RFM22B I've talked to someone that is trying to get some as well and the only ones he could find
available were the RFM22B-868-D, will those work?
Does it need to be the 433 model or it's possible to change the frequency.


The 868MHz version should work just fine. I can even change my 434 module to 960MHz, but obviously it won't work very well. You might need to make sure that 868MHz is a legal frequency in Ireland!


Okay  one thing iv noticed between the different in graph that you postted and the one i posted yours seems to be a lot cleaner and not as jagged spiked like mine . but that said mine is set to max output.

once i get my board from you i would like to use it to test home made 433 radios . what would be the best set of settings for use with RF probes and not antennas? i would image i would set the Tx/Rx power right down to minimum ?


Did you leave it alone to gather data for long enough? The peak value should smooth out over time.

I think the best way to test radio output would be to connect the tx to rx directly with an attenuator, so you don't have to worry about antenna weirdness. Then again, I am definitely not qualified to answer any RF related questions!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Apr 29, 2012, 05:07 pm
Here is the code for a standard 10 channel PPM RC tx+rx for my boards. You must use my modified version of the RF22 library!

On the TX you need to connect 5V PPM to header D3. You can put a switch or jumper on the header next to the RF22 (GPIO2) to switch between low power (1dBm, 1.3mW) and high power (20dBm, 100mW, red LED on). You can easily change the frequency in the code (remember to change rx as well!).

On the RX the LEDs indicate RSSI values: Green > -70dBm, Green+Red > -85dBm, Red > -100dBm, else/no signal = no LED.

Be careful not to connect servos the wrong way around. I didn't use current limiting resistors on the arduino pins to save having to solder 10 more SMD resistors, so it is possible to damage the output pins if they somehow get stuck on and end up powering your servo!

Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Dfidalgo on May 02, 2012, 02:17 am
Great improvements!!!  Very nice Zitron ;)
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on May 21, 2012, 02:39 pm
For the ones that ordered the RFM22 from RF-store how long did it took to arrive?
I have all the parts to build the boards (except some solder paste) but I'm still waiting for the RFM22.
I made the order on the 4th of this month. :(
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Devonian on May 21, 2012, 07:33 pm
Mine took less than 1 week from Germany to England - not bad for just a few Euro's postage.
You should be able to log in to your account and check your order status.

Nigel.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on May 22, 2012, 04:25 pm
I've sent them an email.
They replying saying that it got out of stock in the mean time... and haven't sent it yet.
Maybe still during this week they'll received more.

As I got the order stuck there, I was wondering about this: http://rf-store.com/index.php?view=2&pv=showart&prod_id=RFM70-S
If I can build the same frequency scanner with it as well for 2.4Ghz. From the specs it seems so as the frequency can be selected up to
a 1Mhz interval.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on May 24, 2012, 01:22 am

As I got the order stuck there, I was wondering about this: http://rf-store.com/index.php?view=2&pv=showart&prod_id=RFM70-S
If I can build the same frequency scanner with it as well for 2.4Ghz. From the specs it seems so as the frequency can be selected up to
a 1Mhz interval.


That is pretty cheap, but I don't see a register for the RSSI value anywhere.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on Jun 02, 2012, 09:43 pm
It's register 05 for the RSSI.

Btw, after almost a month I got an email saying that my RFM22 were shipped...
I had asked to include one of these cheap 2.4Ghz... but got no reply. :S

We'll I'm going to start assembling the boards as yesterday I got the solder paste and I expect the RFM's to arrive during next week.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Jun 02, 2012, 11:08 pm

It's register 05 for the RSSI.

Btw, after almost a month I got an email saying that my RFM22 were shipped...
I had asked to include one of these cheap 2.4Ghz... but got no reply. :S

We'll I'm going to start assembling the boards as yesterday I got the solder paste and I expect the RFM's to arrive during next week.



That's a long time to wait! I have been flying my plane with the RFM22, it's working great so far.

Register 05 is write-only,  it's "RSSI Threshold for CD detect". You can't read the RSSI value from it.
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on Jun 02, 2012, 11:32 pm


That's a long time to wait! I have been flying my plane with the RFM22, it's working great so far.

Register 05 is write-only,  it's "RSSI Threshold for CD detect". You can't read the RSSI value from it.


Yes it is.. :(
And if I hadn't contacted them I wouldn't even knew what was going on.

That's right, I totally ignored the 'W'. :)
But if it allows to seat RSSI report or not, it must have a way to read it.

Seems more are looking for it. :)
http://arduino.cc/forum/index.php?topic=107699.0
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on Jun 06, 2012, 12:40 am
Almost ready to start testing.
I forgot about the switch, so instead I'll use a jumper on this one.

(http://i1097.photobucket.com/albums/g359/nandox7/2012-06-05233029.jpg)

This is really good stuff, super easy t build.
Great work zitron!


if I can give an idea. On the pin rows it would be good to have them all at equal spacing. I always have 2x3 or rows
of single pins and if the distance was equal it would be easy to solder them.
This way I have to split them all in single 3 pins.

Quick test made with my 900Mhz FPV vTX on chan 0.

(http://i1097.photobucket.com/albums/g359/nandox7/ScreenShot2012-06-06at004850.png)
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Jun 07, 2012, 06:13 pm
Looks great! Glad you got it working!

Good point on the pin spacing. I found that it was quite annoying trying to solder 10 3x1 pins as well.

You only need the switch if you plan to use my RC transmitter code, in which the switch changes output power. If you do use a switch like the one I used, make sure the metal parts of don't short out the pins under/around it like I did!

Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: Nandox7 on Jun 23, 2012, 03:21 am
I'm back home and ready to finish the other boards.
I do plan to make this a TX/RX set, using it as a Frequency scanner was just an extra and a easy way to test.

I'll see if I can finish a second board during the weekend to give it a try. :)
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Jun 25, 2012, 03:02 am
It could be quite nice to have the boards act as a wireless serial bridge. Telemetry boards with similar performance are usually much more expensive.

Please share your code when you get it working!
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Jul 01, 2012, 03:44 pm
Hi guys,

Since I have sold and/or used all of my boards, I decided to make a batch of new ones.

The major updates of the Rev 3 boards will be:

- Smaller: 37x48mm, vs. 43x50mm Rev 2
- Will use a slightly better LDO for 3.3V: MCP1825S. With only 210 mV drop out, so may benefit people like myself that using lots of servos powered from 5V.
- 0.1 inch pin spacing for servos!!!!111

See attached pictures.

I will be making a new batch of 10 boards, mostly for my own use. If you want any please let me know. Also if you have any suggestions/comments I will be interested to hear. I have a choice of different board colours and thicknesses too...
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: florinc on Jul 01, 2012, 05:32 pm
Nice little board. How much are they?
Title: Re: Cheap UHF spectrum analyzer using RFM22 module
Post by: zitron on Jul 02, 2012, 03:20 pm

Nice little board. How much are they?


Probably £2-3 each depending on whether you want them coloured, and thickness.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 02, 2012, 10:39 pm
Hi Zitron,

I'll take one of your new boards as it'll just about shoehorn into the Futaba T9C module cavity.
PayPal OK?
I have enough components to build onto the board.
Real shame you couldn't get it to fit inside a Futaba Tx module case ;)

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 02, 2012, 11:58 pm

Hi Zitron,

I'll take one of your new boards as it'll just about shoehorn into the Futaba T9C module cavity.
PayPal OK?
I have enough components to build onto the board.
Real shame you couldn't get it to fit inside a Futaba Tx module case ;)

Nigel.


Have you got the inside dimesions of the Futaba module? Is it the same as the 9X ones? I haven't sent the files to be manufactured yet so it is possible for me to change the designs and make it even smaller.

I can also try to make a tx only version, which will be much smaller.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 03, 2012, 12:31 am
Futaba Tx module:
http://www.hobbystores.co.uk/default.asp?itemid=Y-MA2214

A Tx only board would be great, but it would need to fit inside the module case to make it 'nice'.

I haven't built a Tx as yet, but will mash something together to try out on one of the boards I have from you.

I'll get you some dimensions from my Flytron board/module...

At a guess, the width will need to be around 33mm and the length is around 55mm.

EDIT

How about a Tx board that would fit inside the width of a Futaba case, and fit inside a JR module case as well (by making the length of the PCB fit the width of the JR case as they are wider than a Futaba case)?

JR case
http://www.jrradios.com/Products/Default.aspx?ProdID=JRPA615

Could be do-able by using coax for the antenna and short ribbon 'jumper' cable for Tx inputs?

Just a thought...

/EDIT

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 04, 2012, 09:18 pm
Well, I went ahead and got a couple of the Futaba Tx module cases.

The internal dimensions are:
Width 34mm & length 54mm

Zitron, If you are willing to make a PCB that will fit the case, I can send you one of my spare cases as a pattern.
A Tx only board could then be made to fit a Futaba, a JR or just a 'hack module board' for 9X etc.
As I said before, I'm happy to assist with board costs.
An SMD mount Atmega would make the board size a doddle, albeit more difficult to solder (not a problem for me as I have an SMD hot air solder station) ;)

This is the kind of thing I'd like...
http://blog.ckdevices.com/?p=119

What do you think Zitron?

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 05, 2012, 12:38 am
I think I can do 50x34 with the 28 DIP package. If I make a board 34mm wide, will it fit? Or should I make it 33mm just to be safe? If it needs to be much smaller I will have to go SMD.

I will need to redesign the board completely though. I pretty sure I need to add a 5V regulator as well. It might take a while...

Also you probably will have to drill holes and what not in your case to mount the connectors, LEDs and switch externally.

Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 05, 2012, 01:00 am
Wait are you sure you measured the Futaba modules?

I have a 9X which I think uses JR modules, but also measures 54x34??
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Ngakuta on Jul 05, 2012, 09:50 pm
I would really like to build your Spectrum Analyser. Could you please tell me where to find the component layout etc of your board. I see a comment in this forum that the schematic is "attached", but i cant see where it is attached. Sorry to be so stupid. You also offered to send a copy of the board to someone. I would really appreciate this. My email is Ngakuta1@xtra.co.nz Thanks a lot.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 05, 2012, 10:30 pm

I would really like to build your Spectrum Analyser. Could you please tell me where to find the component layout etc of your board. I see a comment in this forum that the schematic is "attached", but i cant see where it is attached. Sorry to be so stupid. You also offered to send a copy of the board to someone. I would really appreciate this. My email is Ngakuta1@xtra.co.nz Thanks a lot.


Unfortunately I don't have any boards left right now. I will let you know I I get the new ones back from China.

You should be able to see the attached files now that you've joined the forum!
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 05, 2012, 10:33 pm

Wait are you sure you measured the Futaba modules?

I have a 9X which I think uses JR modules, but also measures 54x34??


Just re-checked and the absolute maximum space inside the Futaba module case is 34mm wide and 53mm length.
I can just get an Arduino Pro Mini board inside the case, positioned with the length of the Pro Mini across the case, so giving ~34mm of available space inside the case.
5v version
http://proto-pic.co.uk/arduino-pro-mini-328-5v-16mhz-new/
or
3v3 version
http://proto-pic.co.uk/arduino-pro-mini-328-3-3v-8mhz-new/

Maybe I'll hack a Pro Mini and RFM22B onto a bit of Vero board and see what happens...

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 05, 2012, 11:12 pm
Huh so futaba and JR use the same size boards...

A 50x33mm board is definitely doable with through hole 328, I can start working on it if you still want one. We can split the cost of ~£20 for 10 boards.

Which pro mini do you have? If you have the 5V version you will need to use a 3.3V reg for the RF22, and some resistors to divide the arduino SPI output to 3.3V. It could be quite simple if you have the 3.3V version, but I am not sure if my code will work at 8MHz.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 05, 2012, 11:33 pm
I have a 5v Pro Mini that I used on an early WiiCopter - still have a couple of Jussi's PCB's if you want one FOC?

I'm happy to split board costs with you for something that will fit both Futaba and JR.

Look at the case photo I posted a couple of posts back, it would be great if the board would fit and be able to connect the Tx pins into the board.
It will need a 5v reg as the Futaba Tx has battery supply voltage on one of the pins.
I can send you a spare Futaba case for testing.

Flytron makes a JR to Futaba adapter board for the Tx
http://www.flytron.com/123-futaba-jr-module-adapter.html

Perhaps we can continue this by PM and personal email exchange?

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Jul 10, 2012, 01:00 am
A Futaba module would be perfect. (I have a 9C) :)
If needed I can measure the module box.

The only thing is that the module has a odd pin spacing for the connector.


Btw one cool thing would be to have a smaller RX pcb, will less pins to be able to easily fit into a plane, quad,...

Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 10, 2012, 08:29 pm
If you can confirm that a 50x33mm board will fit inside your Futaba module it will be great.

I think you will have to solder your own connectors, because I'm pretty sure JR and Futaba pins are different.

I may look into smaller SMD versions if there people are interesed.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Jul 10, 2012, 09:48 pm
I opened my 35Mhz module and inside I find a PCB covered with a metal casing.

Measuring: 34.08 x 53.75 x 17mm

Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 10, 2012, 11:13 pm
Hold fire on a new Tx PCB for a bit Zitron.
I'm building a test Tx rig to fit inside the module case.
I'm going to try it with an Arduino Pro Mini board at 3v3 & 8Mhz (wired 'dead bug' style) as the board will just fit across the Tx module case.
Should make the design simpler if it works out.
I'll post my findings here...

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 17, 2012, 10:53 pm
OK, I built my ghetto Tx with an Arduino Pro Mini @ 3v3 and get no output from it.

Built one of Zitron's boards as a Tx and get no output from it.

Checking with one of Zitron's boards as an Rx and running the Spectrum Analyzer software, I see nothing from either of the above boards.
Using my OpenLRS module, I see a nice fat signal on the Spec An software.

My Tx is a Futaba T9C (FF9).
I scoped the PPM module pin and see nearly no signal output on my ghetto board or Zitron's board, but, with my OpenLRS module installed I see 2.3 volts on the 'scope.

So, how do we 'trick' the Futaba T9C into outputting a PPM voltage??

So near and yet so far!!

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Jul 18, 2012, 12:35 am
The original Futaba module has a trick to tell the radio that the module is plugged.

See here: http://www.rcgroups.com/forums/showpost.php?p=3954001&postcount=2
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 18, 2012, 09:06 am
That doesn't work, pin 3 just needs pulling low to turn on the RF LED on the front panel of the Tx (a 1k resistor works fine).
For example, OpenLRS controls pin3 via Arduino and code.

I can use a 10k pullup resistor between pin1 (PPM) and pin2 (Tx battery voltage) and get around 10v PPM - waaay too much!

I think I'll try a pullup resistor between PPM and the 3.3v onboard regulator of my ghetto module.


Any other ideas? (other than using the trainer port, which is not an option for module useage).

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 18, 2012, 04:21 pm

That doesn't work, pin 3 just needs pulling low to turn on the RF LED on the front panel of the Tx (a 1k resistor works fine).
For example, OpenLRS controls pin3 via Arduino and code.

I can use a 10k pullup resistor between pin1 (PPM) and pin2 (Tx battery voltage) and get around 10v PPM - waaay too much!

I think I'll try a pullup resistor between PPM and the 3.3v onboard regulator of my ghetto module.


Any other ideas? (other than using the trainer port, which is not an option for module useage).

Nigel.


Wait so you are able to get PPM out but it's 10V? So can't you just use a voltage divider to drop it to 3.3V?

Edit:
OK ignore that. So basically the PPM output is active low or open collector or something? It's probably not good for the radio if you feed 10V through it. In that case pulling it up to 3.3V will work, or alternatively you can add "digitalWrite(3, HIGH)" inside the PPMInitialization() function after "pinMode(3,INPUT)", to turn on the 328's internal pull-up.

Also I just got my new boards back. They are 37x48mm, and seem to fit into my 9x module box (34x54) if I put them in at an angle. I'll put some pictures up later.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 19, 2012, 09:32 am
Hi Zitron,

I understand the Futaba PPM signal on the module pin is open collector.
So, using your PCB, I added "digitalWrite(3, HIGH)" to the code and it now works -- sort of...!
The spec-an software shows a nice signal.

The servo I had attached to the Rx is jittering something awful and was crashing the gear against the end stop, so I stopped testing pretty quick.
I'm using your RF22 code from here:
http://arduino.cc/forum/index.php/topic,93777.msg767772.html#msg767772

On my ghetto 3v3 version, I loaded the same Tx code and the Rx gives a short flicker on the red LED as if it receives something then stops, also no signal appears on the spec-an software.
Will there need to be any code change to make a 3v3 Pro Mini work ?
I have this board, which has the addition pinouts
http://proto-pic.co.uk/arduino-pro-mini-328-3-3v-8mhz-new/

On your board, which way does the switch/jumper give low/high power?
Jumper across 3v3 and GPIO2 gives high power??

Sounds good reference your new PCB's.

We're getting there!!

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 19, 2012, 11:40 pm
Oops. I have a feeling that the jitter is caused by the negative PPM used by Futaba. You can try changing "attachInterrupt(1, ppm_fun, RISING);" in your Tx PPMInitialization(); function to "attachInterrupt(1, ppm_fun, FALLING);". I didn't think about that since my 9x uses positive PPM.

You should confirm that works by connecting your Rx to the computer and start serial monitor at 38400 baud. It will print the first 8 channel values in us*2 (0.5 us resolution). If all the values are stable and in the 2000 to 4000 range then it should be safe to connect a servo to it. You can use my plotting program http://arduino.cc/forum/index.php/topic,80462.msg607817.html#msg607817 to visualize and noise and/or jitter.

I'm not sure what's up with your Pro Mini board. Does it work in spectrum analyser mode? 3.3V to GPIO2 is the high power (20dB) mode, with the red or whatever colour LED you soldered to D1 as an indication. I think if you leave the jumpers unconnected, it defaults to high power mode, which I added as a safety feature.

Edit:

Oh, also all of my code seem to work fine with arduino 1.0.1. I would suggest everyone change to that, since they fixed hardware serial and some servo bugs.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 20, 2012, 12:06 am
Thanks for the info Zitron.

Unfortunatley, I might have run out of time for now as I am on holiday the next week and when I get back I have to start packing our house up (and my workshop/hobby room) ready for a house move.
That also means I will be unlikely to do any R/C for several months as the 'new' place is a bit run down and needs quite a bit of work to be to my liking - great really as I can make it just what we need for the rest of our lives.  I am well into single digit numbers of years until my retirement, and it can't come soon enough!

I'll try to do some work as and when I can, but I really think my 'spare time' will be limited for quite some months ahead.

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 20, 2012, 12:54 am
No worries! Good luck with the house move!

Hopefully in the next couple of months I will have done some definitive in-flight range tests, using a modified ardupilot code that runs on this RF22 board and log RSSI vs distance. It is more or less working, just waiting for better weather for a proper test: https://vimeo.com/43210881 (https://vimeo.com/43210881)
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Jul 20, 2012, 09:21 am
Great work and nice video.
Was that with UHF R/C ?

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jul 20, 2012, 06:35 pm
Yes, it's a v2 board. I have converted all my RC aircraft to UHF. Working great so far, although I've only been flying line-of-sight.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: msev on Oct 04, 2012, 11:04 pm
Guys can you help me out with a hardware question... Is the new rfm23bp http://www.hoperf.com/rf_fsk/fsk/rfm23bp.htm , directly compatible code-wise...Like if some arduino code works for rfm22b it will work also for rfm23bp if I make the correct hardware connections.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Oct 05, 2012, 02:30 am
Hmm... very interesting... looks like they use the same SI chip with some RF power amp or something, so it should work. There are probably a few things that need to be changed in the code, obvious stuff like power level setting. You do need to be aware that the thing draws 550mA during transmit, so you will need a switch mode BEC or something to power it. It can run on 3.3 to 6V, so that's good.

It is possible to use a RFM23 as the tx and the (probably cheaper) RFM22 as the rx, so you can reuse the rx boards. This is very cool!

Any ideal on prices and availability??


Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: msev on Oct 05, 2012, 08:56 am
Thanks for the answer, nope no idea...Melih says he will use these in the new version of Openlrs, but there is a long time with no activity...He says he will also probably sell the modules, so could be nice as a dealer for us who diy boards...

Modules output power probably varies with the voltage used right....Currently we use 3.3v right? I can't find info in the datasheet on how much power this module outputs at 3.3V, if its about 500mW that would be nice...I wouldn't even ramp it to 1W.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Oct 07, 2012, 03:14 am
I'm not sure you can change output power with voltage. Some versions of the datasheet says you can change power from 1dBm to 30dBm with register settings, just like the RFM22, however, the datasheet on hoperf website has incomplete info...

Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Devonian on Oct 23, 2012, 09:20 am
Although I have recently moved home and have no workshop or modelling facility (yet!) I'm still watching what is going on.
I see Flytron has announced their 1W modules...
http://www.flytron.com/openlrs/212-openlrs-m3-1w-tx-module-for-futaba.html

Would be useful to be able to fly with 100mW and hit a 'get out of jail button' for 1W.

Nigel.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: msev on Oct 25, 2012, 10:54 am
Unfortunately he hasn't yet posted the correct schematics and source code :(.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Oct 25, 2012, 11:25 pm
$110 is a lot of money. I don't think he will be able to sell many at that price considering that you can just get this: http://www.hobbyking.com/hobbyking/store/__24965__RMILEC_TS4047_10CH_2_5W_UHF_Module_System_w_Receiver_JR_module_.html $180 with diversity receivers.

A bit of a update, I lost my glider while testing autopilot. Stupid mistake, pulling too hard out of a dive. So I had to get a new one, spent all summer trying to get that flying. During that flight I was able to log RSSI vs distance, you can see the plot. I didn't go very far, only 200m, but if I extrapolate the trend I will probably start to get occasional packet drops at 1km and lose signal completely at 10km.

On the RF22 front, I have managed to get telemetry working on my boards, and fixed some bugs, unfortunately also introduced some new ones that causes the board to lock up randomly and other weird problems.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: msev on Oct 26, 2012, 10:39 am
Yeah for us who know how cheap it is to actually build such an unit 110$ is very high.. That Rmilec unit is crap people say..

Thanks for the progress report, sorry about the glider.
Title: Problem with my board!
Post by: zitron on Nov 09, 2012, 05:59 pm
Hi guys,

Just to let you know that I found a problem with my board design. It the way I am using the resistor dividers to shift 5V from arduino to 3.3V for the RFM22. Because I have modified the RF22 library to run at very high speed, the resistors and the capacitance of the traces begin to act like a RC filter. This can corrupt the SPI data, causing lockups. This means that the SPI bus is operating very close to the limit, voltage problems with power supply can easily cause a lockup, especially if you run a lot of servos. If you only use the board for spec scan or telemetry you may not have this problem at all.

As you can see here, the SPI clock out from arduino (blue) is distorted when it gets to the RF22 module (yellow). This screen shot is a bit exaggerated because I was using X1 probe, it's better with X10.

(https://sites.google.com/site/zitronfiles/NewFile1.gif)


Solutions:

1. Software solution: reduce SPI speed, change the SPI speed down to 2MHz in the RF22.cpp file. Change the line in RF22::init() to SPI.setClockDivider(SPI_CLOCK_DIV8);
2. Hardware solution: reduce resistor values. I tried halving the resistor divider values (R2 - R7), and it works much better. Replace 1K with 470 Ohm, and 1.5k with 680 Ohm.
3. Both. <-- I recommend this for best reliability
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zachwiej on Nov 10, 2012, 05:38 pm
Hello
Can you show yours antennas ? :)
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Nov 11, 2012, 03:44 pm
I'm not really a RF person. Actually, I'm not even really a electronics person! I just made simple dipoles from a SMA connector and coax cable.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 12, 2012, 09:55 am
Funny, I had to put this project on hold. But yesterday I picked it all up and finished to assemble the boards.
Seems I'll have to do some more modifications. :)

@zachwiej, check here for example: http://fpvlab.com/forums/showthread.php?3156-433MHz-Half-wave-dipole-for-LRS
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 13, 2012, 06:08 pm
@Zitron, I see that you mentioned you've added telemetry to the code. Is that a custom implementation?

I was considering using the FrSky protocol, I have a 9X modded to get FrSky telemetry as well as a Android app in the works.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Nov 14, 2012, 03:57 pm
I donno much about the FrSky protocal, but that would be pretty cool. I was thinking about making an android app as well, but my app making skills is at the "hello world" stage.

How would you transfer data from the 9x to the phone? I was thinking some kind of bluetooth?

My telemetry is basically the same as my RC link, passing data structures directly, I will upload some example code this weekend. But if the FrSky is easy enough to implement and standard we should use it or at least have it as an output option. Being able to use the 9X to display telemetry is something I am also interested in.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 14, 2012, 04:30 pm
There is already implementations of the protocol in the Multiwii Flight controller that run in arduino so it would be basically copy/paste.
I've hacked the current code to add it and it fits perfectly in 328p already full with the Mwc code.
I'll upload it to my site later today so that you can give a look.

I'm currently using BT like you said, on my 9x I made a converter from RS323<>TTL and I plug it in the back of the radio.
And at the same time you still have it showing in the 9X LCD.
(http://i1097.photobucket.com/albums/g359/nandox7/IMG_20121101_231854.jpg)

On my 9C because it has a FrSky DIY kit inside I actually placed the BT dongle also inside the radio. So it becomes a much cleaner solution.

So far I've hacked one fo the existing frsky apps to add what I needed, log rssi:

(http://www.rcgroups.com/forums/attachmentNew.php?attachmentid=5250043)

But I'm not too happy and I have some other ideas on what I want to do.

PS: I was also looking into putting a buzzer in the TX PCB to signal low RSSI as FrSky does. I've received today a spare ATMEGA from Farnell along with the resistors to swap. So I'll be giving total attention to this in the upcoming weeks. :)
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 14, 2012, 10:19 pm
Here it is: http://www.xrotor.net/wp-content/uploads/2012/11/FrSky_Telemetry_Mwc.c

This is the main code for the FrSky telemetry. The data sources are mostly the sensors from the Multiwii board.

Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 14, 2012, 10:20 pm
Here it is: http://www.xrotor.net/wp-content/uploads/2012/11/FrSky_Telemetry_Mwc.c
This is the main code for the FrSky telemetry. The data sources are mostly the sensors from the Multiwii board.


I'm currently updating the code from thUndeadMod v.4 for the openLRS to be able to use it with these boards. Hope to
run the first tests next weekend. :)

Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Nov 18, 2012, 06:48 pm
Here is the new code with hardware servo, hardware tone, telemetry, and updated RF22 library

By default, pin 5 generates a tone for RSSI warning and bad packet. I'm using a piezo buzzer in series with a 1k resistor.

Currently the tones are:
4000Hz tone for bad packets
2000Hz tone for RSSI warning

Frequency and duration of the tone can be changed.

You can easily send more data back by modifying the telemetry data structure which is currently:

Code: [Select]
struct TELE_DATA_STRUCTURE{
  byte RSSI;
  byte RxBad;
  float Alt;
};


Just add your own variable in there.

Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 18, 2012, 07:31 pm
Thanks.
In the mean time went back to some code you had shared before and changed it to include downlink telemetry. (I really didn't like openLRS code)
But I'll use the one you shared now that is better tested than mine. :)

One question, on your old code that you shared I was getting servo glitches at a regular interval, any idea what was it (I suppose it was the RF22 irq messing the servo library?
I didn't spent much time as I need to generate instead a PPM signal (for the Multicopters FC's) but I was curious about it
seems like the

One other thing, do you get a stable RSSI reading? I'm getting something like 104, 80, 70, 90, 60,... ended up adding a moving avg filter to help. I was expect some fluctuation but not so big as this.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Nov 19, 2012, 03:45 am
Hmm... are you using my modified version of the RF22 lib? Because I thought I solved that particular problem, my servos seem fine. Try the new code, and see what you get. I will investigate a bit more. I guess I could think about adding PPM out, but because I implemented autopilot directly on the receiver, I never had the need... It might be simpler to have the receiver talk to multicopter FC directly over serial port instead of the convoluted digital->PPM->digital thing.

Also, my new telemetry code is not fully tested!! Make sure you don't put it on something expensive! And because the rx defaults to transmit telemetry data at full power, make sure you have an antenna on the receiver all the time!

My RSSI values are very stable, down to the last digit. The trick is the read RSSI right after receiving a packet, otherwise it will be wrong.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 19, 2012, 04:07 am
I started using your new code and the issue was fixed. But I was curious about was causing it in the older version.

I already implemented PPM but it makes the RF22 stop working.
I've set the timer1 to do the work, similar to what the Servo library does, so shouldn't be any issue...

If there is interest maybe host this somewhere, google code or github.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Nov 19, 2012, 06:34 pm
The key to good interrupt handling is to make sure the code in the interrupt handler is as small as possible. IIRC the original RF22 lib had all kinds of stuff in their interrupt handler function, including reading data from the module, which meant everything else (like servos) had to stop when it receives a packet. When this coincides with a servo pulse, you have a glitch. I move the data reading outside so the actual interrupt takes almost no time.


Does you PPM code work on its own? Debugging these interrupt and timer issues are quite difficult! If you share your code I will have a look at it sometime this week. Can't promise anything though...
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 19, 2012, 07:33 pm
Thanks, I noticed that you're not using the latest version of RF22 so I wanted to check the changes to port it to the latest version.

My PPM code it running fine on it's own, I set some static values and the signal generated is clean. I matched the time intervals to what FrSky receivers do. (I'll post some screenshots later)
Is still not optimal as I lock it during the signal generation, but I saw a good example on how to release the control between the intervals of the pulse shifts. As soon as I made the current model work I'll try the better one.

I'll create a Google code page later and share it there.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 20, 2012, 12:44 am
Here it is: http://code.google.com/p/zlrs/

That version the PPM sum runs fine on pin D8, perfect 18ms like FrSky but no RF22...

This is the output from a FrSky D4FR
(http://www.xrotor.net/wp-content/uploads/2012/11/FrSky_D4FR.png)

And this is from the code of the LRS
(http://www.xrotor.net/wp-content/uploads/2012/11/LRS_02.png)

The channels interval is showing the ~1500ms the default value I've set because it can't get data from the RF22.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: MGeo on Nov 20, 2012, 12:26 pm

Hmm... are you using my modified version of the RF22 lib? Because I thought I solved that particular problem, my servos seem fine. Try the new code, and see what you get.


Hello zitron.  Can you summarize what modifications you have made to your RF22 lib?  What problems did you need to fix?

Best Regards,
George
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Nov 21, 2012, 11:54 pm
Code: [Select]
Here it is: http://code.google.com/p/zlrs/

Sorry I don't know how to use google code, where is your code?


Hello zitron.  Can you summarize what modifications you have made to your RF22 lib?  What problems did you need to fix?


I am really bad at documenting stuff, I think I basically moved the read data stuff from the interrupt handler to only run when you call the receive function.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 21, 2012, 11:59 pm
There you go: http://code.google.com/p/zlrs/source/browse/#git%2Frf22_RCrxHWS_tele

I prefer GitHub but I decided to give a try to Google Code GIT hosting.


Got some time today to look into this, seems the way I've set it is consuming too much time not allowing the RF22 to process data.
I've changed the timer to only trigger and even on the pulse shift and the RF22 started to work. Now I need to correct the PPM output as it's not been generated correctly.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 22, 2012, 11:56 pm
...and it's fixed! :)
Took some ideas from openLRS code and ended up only using Timer1 as overflow interrupt.
I'll be submitting the updated code soon and start adding a failsafe feature.


Update1: Code submitted and video made of the test  
http://www.youtube.com/watch?v=OgGD2ToWznY

Update2: FrSky telemetry support added. RSSI+Voltage levels working on a modded 9x radio.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Nov 24, 2012, 06:53 pm
Wow awesome! I like the changes.

Which version of the 9x firmware do I need?

I'm thinking about building a tricopter, I might just copy your setup!
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 24, 2012, 08:26 pm
I'm using the er9x, but I think open9x will work as well they use the same mods for telemetry.

In multicopters and for FPV I just love the tricopter, the super responsive tail makes it really fun to fly.
If you need any details just let me know.

I'm trying to determine with platform will be the one making the first test running the LRS. :)
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 29, 2012, 05:16 pm
Just a video showing the maiden flight. :)
Next step is to make some proper antennas, you can hear the drop packets beeps (as well as me speaking loud).

http://www.youtube.com/watch?v=wegtl8UFZx4&feature=g-crec
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Nov 29, 2012, 10:48 pm
Nice! Were you flying on 1mW? 1mW Should be good for 100m with normal antennas.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Nov 29, 2012, 11:38 pm
arghh... thanks for that!

I remembered seeing that code but when checked I saw that it was using the full power, 20dBm!
Problem was I checked on the RX and forgot to check on the TX side, so yes I was only using 1dBm
on the TX side. ;-)
If the weather keeps good, I'll test it again with more power.

PS: What have you used to power the TX module? Both Futaba and 9X output 12v so it needs to be converted. For testing I ended up using a ESC+LiPo. So I was wondering if you have a new board layout that includes a voltage level converter.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Dec 01, 2012, 01:17 pm
I couldn't tell from your video, but make sure you also check the hardware power selector/switch next to the RF22. You shouldn't need to change the software if you just add a jumper.

For power I just soldered a wire from the 5V reg on my 9X.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Dec 01, 2012, 04:37 pm
I've disabled the jumper check code, so it's always using the same power.
What I had forgotten to do was check the initialization settings on the TX.

As for the power regulator I recalled I had here a tiny pcb with a voltage reg from a old Wireless camera kit.
(http://img5.imageshack.us/img5/6436/img0617te.jpg)


Couldn't be better, it converts from 12v to 5v and has place to solder two more wires that I'm using for the PPM and Serial TX.
It's a 78L05 so It's pushing it a bit, but I let it on for quite some time and it didn't burnt.
(http://img19.imageshack.us/img19/5830/img0620gxn.jpg)
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: striker121 on Dec 10, 2012, 05:18 am
How does one change the frequency easily on this? I'm looking at http://www.futurlec.com/Radio-433MHZ.shtml (and also the one from Sparkfun) and they all seem to indicate that the parts on the board constrict it to specific frequency and it wouldn't work on others, yet you guys seem to be able to switch along the entire range with no problem.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Dec 11, 2012, 06:51 pm
You can change normally using the registers. It can work all over the full range allowed by the SIL chip.
What happens is that hoperf adds some filters that will make it work better on model range. So don't expect to have the same
performance on 866Mhz if you're using a model for 433Mhz.
Example, for the purpose of acting as a frequency scanner is it ok for a LRS I'd stick to the model frequency to get the maximum performance.

Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Jan 17, 2013, 12:33 am
One update on the testings.
Last weekend tried it with the power set to 20dbm and indeed the range is nothing compared to before.
The day was not the best, cold, wet grass and foggy so definitely not the best conditions for RF, still it
went up to 350m with signal and I just didn't went more coz I was freezing. :)
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Jan 18, 2013, 04:03 pm
Cool, I just test flew my multiwii tricopter last weekend, it's pretty awesome! I didn't bother with the PPM, too lazy. I think I will add a battery voltage warning to the telemetry when I have time.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Jan 18, 2013, 04:17 pm
Are you planning FPV?

My next step was to add RSSI out, probably use Timer2 to generate a 50hz pulse.
So it can either be used directly with some OSD's or with the buffers commonly used with FrSky and others RX's.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Feb 05, 2013, 10:24 pm
Been using it for some time but just realised I had forgot to share here. :)

Added support for output FrSky telemetry code from the TX module, so that I can use it with my modded 9X radio and see the RSSI levels from both RX and TX.

The yellow wire (seen in the picture above) goes from the pcb TX pin into the 2nd pin that after the radio mod works as RX for the FrSky module.
At the moment is only sending that data, but could potentially send anything that FrSky telemetry provides.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Feb 07, 2013, 01:20 pm
That is sweet! I will have to check it out. Do you lose your model settings if you flash different firmware to the 9x? I hope not.

I haven't done much because of the crappy weather and I have too many projects going on. Flew my tri for a bit, it's not properly tuned, but is still very nice. I am terrified of my HK450, but I can hover the tri around the kitchen. I will definitely setup FPV on it eventually. There's no way I will fly the 450 FPV. I have a 2.4GHz FPV system, but every time I turn it on to test it my house mates (probably neighbours too!)  lose wifi. Maybe I will get a 5.8 system. If you are thinking about DIY OSD, I have made my own ages ago, before kg4wsv made his MAX7456 lib (check out this very old and long thread http://arduino.cc/forum/index.php/topic,8785.0.html). You can probably use the same code in any of the arduino-MAX7456 OSDs sold everywhere.

I finally got around to edit the video of my autopilot test crash last year, you can see my OSD in action although replaying logged data: https://vimeo.com/58801611

Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Feb 07, 2013, 04:02 pm
Do you already have a different firmware or you're using the stock one?

Between different versions of er9x or open9x is possible to save them and after re-upload. I do that every time I update it just in case.
But try with the eepe tool it might even be able to save the ones from the stock fw.

Ehehe that is funny. :)
What's the power on that 2.4 vTX??? I also have helis (several... ) but never even tried to put FPV in them. For me FPV just in multicopters
with the tricopter been the best due to the fast tail response.
At the moment all the fun is going to my micro quad I converted to FPV: http://www.youtube.com/watch?v=7znVsR75TVc
I'm using a really old 1.3Ghz vTX so the range is super short and really bad video.

About the OSD I'll check it out, I have two E-OSD from HK and I'm using that but was considering getting one of the Arduino based ones with the
MAX7456. Last month almost lost my quad when I flew way out and got lost. :(
Btw, what tool did you used to overlay the OSD in the video? Or was just normal video overlay?
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Feb 08, 2013, 05:30 pm
I think I have er9x. Flashing the firmware was the first thing I did when I got the radio, can't remember the option to save model memory. If er9x is compatible I will definitely give it a try.

My FPV Tx is 500mW, not that powerful, but much more than the 47mW or whatever the wifi router puts out! My next goal is to set up my tri for FPV, they look like so much fun to fly!

I'm pretty sure the HK Mini OSD is arduino and MAX7456 based: https://www.youtube.com/watch?v=hMUvrjivOQM. It's only $24.99 INCLUDING the GPS! That is ridiculously cheap. When I made my OSD they cost ~$100 without GPS. I wouldn't bother making my own these days.

Also did you see the HK 433MHz Open LRS thing? I guess Melih is not happy. I wish they copied my design so I can just buy it from HK instead of getting all the parts and building it myself  :D. It's fun soldering the first couple, now it's just annoying.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Feb 08, 2013, 06:30 pm
The option to save the models memories is with the PC tool EEPE (http://code.google.com/p/eepe/).

True, I was forgetting that. When I'm testing the gear at home I often have the radio next to the WiFi router but FrSky does hopping so it doesn't get too much into
the router. Now a vTX static in one frequency emitting with 500mW...
For video I've been using 900Mhz up to now, but I'm goign to try 5.8Ghz because the antennas are smaller and easier to fit in the multicopters.

I got a HK Mini OSD, it's using some custom FW. The problem is that they have a AtMega88, so there is very few space. I've loaded in mine the alternative FW cl-osd and it runs fine but even tried to port the arduino OSD code from Dennis @ RCG but was no good due to the size.
But the version with GPS is pure trash... including me I saw several people where the wires in the GPS were loose of badly soldered. I had to open mine to fix it.

I did saw. I actually got one... and I don't want to talk about it!  8)
Such a headache, my goal was more the TX as it fits nicely in the radio but it was a headache, tons of problems... eventually found out that during assembly someone
dropped a ball of solder on top of the RFM22B of the RX. :(
And I'm not the only one having problems, all sorts happening mainly due to bad soldering work.

Btw, have you ever tried the antenna diversity in the RFM22B? I was thinking in making a PCB with 2 antennas. It will require a RF switch.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: zitron on Feb 08, 2013, 09:04 pm
Oh yeah EEPE I remember that now!

That's a shame about the quality issues. Did they really use a Atmega88? Damn my OSD code is 14k with arduino bootloader... Maybe able to squeeze out some stuff like the artificial horizon and make it below 8k... It's almost worth replacing the MCU with a atmega168.

Oh BTW I forgot to say that video I posted was done by recording just the OSD output while replaying logged data and overlaying it on the key chain camera video in the video editor.

I did think about diversity, but I don't know anything about RF to design a RF stage with switches. I was thinking about having 2 RFM22 modules on one PCB, which could also allow you to transmit and receive at the same time.
Title: Re: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module
Post by: Nandox7 on Feb 11, 2013, 12:28 am
Thanks, when I saw the video i was like.. ouch! :S That was nasty. Glad you managed to retrive the gear.
I do like the OSD layout, the AHI seems to work quite well too.

I looked into the RFM22B docs, and they mentioned a RF switch.
Eventually I found that switch that works on 459Mhz and the design was rather simple. (making it work may prove different)