Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module

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: RF22: RF22 library for Arduino. 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:

Close up at 434MHz:

Pictures of the board:



The PC program (in C#, a modified version of my plotting program: 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: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module - #58 by system - Exhibition / Gallery - Arduino Forum

New version of PC program: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module - #64 by system - Exhibition / Gallery - Arduino Forum

Update on potential board problem: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module - #126 by system - Exhibition / Gallery - Arduino Forum

New version with telemetry support: Cheap UHF spectrum analyzer (and RC tx rx) using RFM22 module - #135 by system - Exhibition / Gallery - Arduino Forum

RF22SpecScan.zip (193 KB)

rf22_specan.zip (1.24 KB)

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?

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!

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... =(

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!

RF22 RC Board - Rev3.pdf (68.5 KB)

Thanks for the schematics! I would be interested :slight_smile: 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 (Google Code Archive - Long-term storage for Google Code Project Hosting. , 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?

msev:
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.

msev:
Are you familiar with multiwii (Google Code Archive - Long-term storage for Google Code Project Hosting. , 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.

msev:
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...

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..

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.

BOM.pdf (28.9 KB)

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.

It looks nice zitron!

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).

I want :slight_smile:
I've sent you PM.

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.

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.

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 :smiley:

Devonian:
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.

FPV UK - Flying Model Aircraft and Drone Membership, Advice & Support

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!!

Devonian:
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.

IMG_8373.JPG

IMG_8372.JPG

msev:
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 :smiley:

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.

rf22_RC.zip (5.64 KB)

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! :slight_smile:

Thanks in advance,

Daniel

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.

Hi Zitron,

Discover the secret - where do you manufacture the PCBs?