RSSI Indicator

Goeytex

Senior Member
I have developed a working RSSI indicator using a Dorji DRF4431F13 and a Picaxe 20X2. The code will also work with a Hope RFM23B.
The RF Module is set up as a receiver only and sweeps through the 433 MHz band, looking for signals and displaying the RSSI and Frequency.
It will work with FSK, GFSK and OOK/ASK transmitters. Can be adapted for other frequency bands.

If enough folks are interested, I will do a complete write up and post schematic & code in finished projects.

Goey
 

lbenson

Senior Member
>If enough folks are interested, I will do a complete write up and post schematic & code in finished projects.

Please do so.
 

manuka

Senior Member
Naturally I'm also interested, so please post at least some brief details. How is the info. displayed however-an attached PC screen perhaps? I've run across similar low UHF band scanners before, but don't recall any PICAXE based, so bravo on the project.

(FWIW I've just penned a review for the May "Silicon Chip" on the handheld RF Explorer. The same issue will be covering SDR (Software Defined Radio) hacking of cheap USB tuner modules). Stan.
 

john2051

New Member
Hi, an interesting project, i would like to see a write up. How fast can it scan the 433MHz band? say 2MHz bandwidth.
I'm sure something like this would be equally welcome to most amateur radio enthusiasts.
Thanks john
 

Goeytex

Senior Member
...How fast can it scan the 433MHz band? say 2MHz bandwidth....
Thanks john
Hi John.

With the Picaxe operating at 16Mhz, it can scan the 433 ISM band from 433.050 MHz to 434.70 MHz in ~ 185 ms using 10KHz steps in frequency. With the Picaxe operating at 32 MHz this is cut in half to ~ 92 ms. Not blazing speed but should be able to catch a lot of signals over multiple scans.

My dilemma is what features to include and determining actually what it should do when it locates a carrier signal. I originally did this for testing DORJI RF Modules where It searched for a valid preamble and then displayed RSSI. But that only works with signals that use a 01010101 preamble format.

So I turned packet handling off and set the module to read RSSI in a loop and found that it works quite well at detecting a carrier signal. I was able then to determine the center frequency and relative output of the cheap ASK modules by reading RSSI while shifting the receivers frequency. This led to the idea of a general purpose RSSI indicator to be used as a tool for setting up & testing RF modules, but not necessarily as a Wide Band Scanner with a graphic display and a bunch of bells & whistles. However, the possibilities are almost endless with the right code. The RF module is quite capable.

Right now I have an LED bar graph that show relative RSSI. There is a "squelch" pot that sets the RSSI threshold to only process signals above a certain RSSI level. The frequency and actual RSSI level in dBm are displayed on the PE terminal, but could just a easily be done on an OLED Display. I could possibly add a switch to reduce sensitivity. There could be one mode for Packet Sensing and one mode for Carrier Detect. In packet sensing,mode, we can select from OOK/ FSK & GFSK.

Whats nice about all this, is that I have written an extensive Picaxe Basic library of "functions" (subroutines) for the SI4431 that drastically simplify Picaxe programming for just about anyone.

For example to set the RF Module to Receive mode:

Gosub RX_ON ....instead of:

------------------------
reg_addr = $07
reg_val = $05
setbit reg_addr,7 'write bit
low nsel
hspiout (reg_addr,reg_val)
clearbit reg_addr,7 'restore
high nsel
-------------------

This is just one example of many. The idea was to make the SPI stuff simple and almost seamless so that anyone could work with these modules , without having to pour over the Datasheet, Applications Notes and the somewhat confusing Configuration Spreadsheet.

So you guys tell me what you think would be good for the Picaxe community and I'll work it up. Please no graphic displays. If you want that, then adding it should be rather straight forward. For those of us in the USA, there are functions for operating in the 915 MHz Band ( Can cover 868 as well).
 

srnet

Senior Member
Whats nice about all this, is that I have written an extensive Picaxe Basic library of "functions" (subroutines) for the SI4431 that drastically simplify Picaxe programming for just about anyone.
It is worth pointing out that in some places in the World the Hope RF modules, which are functionally the same as the Dorji ones, are more widely available.

I too have a whole list of generic subroutines for using the SI4431\32 modules, which by now have had a very considerable amount of testing.
 

Goeytex

Senior Member
Yep,

Dorji has shot themselves in the foot with their shipping requirement of only using an insured major carrier like DHL or Federal Express. This means small quantities (direct from Dorji) are cost prohibitive for the hobbyist. With a $2000 order, it's not a problem but with just a few modules it's cost prohibitive. Who wants to pay $30 - $45 shipping for a $10 RF module? My best guess is that they are only really interested in large quantity buyers. Too bad, because they have really good stuff.

Since there is no Dorji Distributor in North America, Dorji products are not a good deal here, even though the modules are of excellent quality and the Chinese contact, Mark Yao, is a pleasure to do business with. Also, Dorji does not stock any 915 Mhz modules and requires a large minimum qty to get a decent price on these. But they did do a special run for me in some 915 Mhz modules that I wanted to test.

So Dorji does not seem very interested in the US market at least not from low quantity buyers. I am using Dorji Modules because of the good quality and because I ordered a significant quantity a while back so shipping was not an issue.

On the other hand you can get a Hope RFM23B in the US for $10 HERE. Shipping is $5 and if you order 5 the shipping is free.

I have never ordered directly from Hope RF, so have no idea of their prices or shipping policy.
 
Last edited:

srnet

Senior Member
I have never ordered directly from Hope RF, so have no idea of their prices for shipping policy.
They will ship direct to you if there are no local suppliers.

I had some of the RFM23BP from them, Qty of 5 at $9 each, DHL shipping $25. Which I thought was quite reasonable. That price for the more expensive RFM23BP (1Watt) was cheaper than the local price for the RFM22B
 

John West

Senior Member
The RFM23BP looks like a good deal, as I'm an amateur radio op, and the module looks like it will work withing the licensed 70 cm band. I'll just need to look into the operating modes to see if it will be legal for radio control purposes. However, the work Goeytex has done makes it worthwhile even if it's only used in receive mode.
 

srnet

Senior Member
The RFM23BP looks like a good deal, as I'm an amateur radio op, and the module looks like it will work withing the licensed 70 cm band. I'll just need to look into the operating modes to see if it will be legal for radio control purposes. However, the work Goeytex has done makes it worthwhile even if it's only used in receive mode.
Indeed it will work in the 70cm band, I have in front of me a PCB (working !!) that has both RFM22 (100mW) and RFM23BP (1W) on it. Both devices will operate in FSK\GFSK and OOK, but have a direct mod pin also so you can generate FM tones (thus a Morse callsign ident). One of the gotchas with the RFM23BP is that the power output level cannot be varied by more than 2 or 3dB, which is sometimes not very spectrum friendly.

The devices are legal to use in the UK at full power under an Amateur License, with the usual restrictions and likely a low pass filter to suppress the third harmonic. Remote control I have working, together with simple flow control. By using one of the header bytes to define a packet type, so you can have ready and ack packets, without needing to read the actual packet from the FIFO.

Range of the RFM23BP (for remote control) I would guess at around the 100kM mark for true LOS and slow bit rate packets, based on 1\4 wave antennas, more for directional gain antennas of course.
 

srnet

Senior Member
There is an open source project that can uses the RFM23BP for RC model remote control, but I get the impression that those using 1W for RC model control are not that concerned as to whether its legal or spectrum friendly to use that power or not. Cant recall anyone mentioning checks for band splatter or harmonic emissions.

1W for RC model control will get you way beyond what you can see with the unaided eye, so the only practical use of that much power is for FPV (remote flying by video link) and in the US at lot of the states are introducing legislation to control the use of such 'drones'.
 

manuka

Senior Member
-introducing legislation to control the use of such 'drones'.
Increasingly justified! FPV (First Person View) is incredibly popular,& many hosting model aircraft (mostly now near silent Li-Po powered) are almost up to military duties. The "pilot" in the picture below (who is a licenced ham) uses a ham band slot at ~1.3GHz for his analog. FPV video links- the P-51 "Mustang" shown is not so fitted.

SiLab’s thumbnail sized Si4432 is a popular RF engine in many current UHF devices, & Dorji use them in diverse 433 MHz data transceivers. Dorji's recent DRF4463D20 however uses a newer Si4463, but although SiLab's consider this as superior it apparently has coverage "holes".
 

Attachments

Last edited:

Buzby

Senior Member
Increasingly justified -FPV (First Person View) is incredibly popular,& many hosting model aircraft (mostly now near silent Li-Po powered) are almost up to military duties. The "pilot" in the picture below (who is a licenced ham) uses ~1.3GHz for his analog. FPV video links- the P-51 "Mustang" shown is not so fitted.
At the end of last year I was on the 6th floor of an office block in Norway, next to a fjord.
I was sat at my desk, when out of the corner of my eye I saw something move slowly and silently downwards past the window.

By the time I got up to look it had landed in the carpark.

It was a octocopter, about 5ft diameter, judging by the cars and people around it.

When I asked the locals in the office what was going on, I was told that the 'Flying Eyes' are used to inspect the sides of tall buildings in awkward places.

IMG_20121127_121035_01.jpg
 

Goeytex

Senior Member
and in the US at lot of the states are introducing legislation to control the use of such 'drones'.
The states as well as the Federal Government .... Attempting to ban the use of "drones" for private citizens while many states and the FEDs are going full bore to develop the most technically advanced drones possible to be deployed in the "Homeland" for surveillance & control of the citizens. They can watch us, but we can't watch them.

Just recently a guy who for many years had been doing small scale commercial aerial photography using an RC plane was shut down by the FAA. There is no provision on the regs that allows for commercial use of "unmanned aircraft". However there was no new change in regulations. FAA reasoned that since it was not specifically allowed, then it was illegal. It's starting to get bad here.
 

Paix

Senior Member
The French philosophy used to be, that which is not explicitly forbidden is therefore permitted! Presumably because it's easier just to say sorry :)

Look at the power of SDR in amateur hands, thanks largely to a number of clever and generous souls. It does make you wonder exactly what the NSA and GCHQ have up their sleeves.
 

papaof2

Senior Member
The states as well as the Federal Government .... Attempting to ban the use of "drones" for private citizens while many states and the FEDs are going full bore to develop the most technically advanced drones possible to be deployed in the "Homeland" for surveillance & control of the citizens. They can watch us, but we can't watch them.

Just recently a guy who for many years had been doing small scale commercial aerial photography using an RC plane was shut down by the FAA. There is no provision on the regs that allows for commercial use of "unmanned aircraft". However there was no new change in regulations. FAA reasoned that since it was not specifically allowed, then it was illegal. It's starting to get bad here.
There's way to much hysteria and paranoia in the people who want to keep us 'safe'. "Improved" gun safety legislation that won't allow you to pass along a family heirloom shotgun to your descendants? I can only wish my crystal ball had been tuned to this 20 years ago...

Maybe the aircraft should be a bit larger and armed? At least the pilot would have a fighting chance.
 

Goeytex

Senior Member
I could rant all day ...... but back on topic.

Here's the Schematic using a 20X2. Code to follow.

I suppose a 20M2 could work but SPI would have to be bit banged and pins changed for normal interrupts instead of hardware interrupts. Performance would be slowed / degraded by the agonizingly slow bit-banged SPI. If you attempt to use a 20M2 you are on your own.
 

Attachments

srnet

Senior Member
Good Oh, I await the code with interest.

Enclosed is a shot of my own test packet receiver\transmitter and RSSI meter, its single frequency, but handy for checking antennas and the like.
 

Attachments

Goeytex

Senior Member
Hey,

That's a nice looking setup. What kind of display is that?

I said no graphic display, but that means I am not going to write code for various displays. I may eventually incorporate a 4D Systems uLCD-144-G2 that I have laying around here somewhere. If I do, I'll add that code later because I'll either have to get rid of the LED's or upgrade to a 28X2 to get the extra needed pins. A serial 16x2 OLED would probably be adequate.

I am updating the code now to allow scanning multiple bands. Right now it only scans in the 433 ISM band. But to make it more useful l can have it scan a wider range. However, I am not sure how well it will do when it gets to far away from 433 MHz. I operate Dorji 868 MHz Modules at 915 MHz with only about 3 dBm performance hit so maybe it will do ok with a wide band antenna. I'll have to do some testing with a TX and RX module operating away from 433 Mhz and see how they behave.
 
Last edited:

hippy

Senior Member
That looks like a Nokia 3120 ( or similar ilk ).

With a 16x2 text display having a 16 channel, spectrum equaliser style, bar graph display for various frequency bands ought to be pretty easy and universal for all displays. With an OLED 16x2 you could have 16 or 32 bar graphs per line and have them uniformly spaced so it looks good.
 

srnet

Senior Member
Its from a Nokia 5110, you can buy them on a PCB like that on eBay, about £10 for 5.

Its graphic display and a 20X2 drives it as a character serial LCD, 14 chars x 6 lines.

Happy enough at 9600 baud.

The PCB will break in half, the transmitter and LCD display can be then used separately.
 

Goeytex

Senior Member
@srnet

Can you tell me what GPIOs are used for PA switching on the HOPE RFM modules that have a PA switch?

The Dorjis use GPIO-0(TX ) and GPIO-1 (RX). However, I have seen some reference schematics that use GPIO-1 & 2. HOPE does not provide a schematic so I am not sure and want to make the code universal for both brands.

Please Disregard: I looked at the Hope Datasheets and see that the Hope modules bring the PA switch connections out on external pins where they can be controlled either directly by the Microcontroller or by routing them to GPIOs.
 
Last edited:

Goeytex

Senior Member
UPDATE:

I am cleaning up the code and doing extensive commenting. I am also changing some routines to try to improve the speed of scanning through various frequency bands. Also adding code for a display.

Testing has shown that a 433MHz DRF4432F20 module receives just fine across the entire frequency range from 240 MHz-960MHz with a matching antenna attached for the frequency band being received.
 

srnet

Senior Member
The Hope modules will receive, and transmit, across the whole 240-960mhz also.

The Hope modules are sold in one of 4 bands, 315,434,868,915mhz.

So whilst they do operate outside these bands, they do so at reduced input\output.
 

Goeytex

Senior Member
Attached is some demo code.

This is just a sample that scans from 425 MHz to 435 MHz looking for a carrier. If a signal is detected that is above a certain RSSI threshold then the Frequency, RSSI level, and dBm are displayed.

The most important part of the code is the sub routines which I will call "functions". With these functions just about anything can be easily done with either a Dorji DRF4432F20 or a Hope RFM22B / BP. With the Hope module some pin changes may be needed.

I will post more code snippets later, such as an interrupt driven mode that blinks leds based upon rssi strength, a packet sniffer routine that looks for valid preambles, or valid sync words, or for actual valid packets.

This code has been extensively tested in the real world on Dorji 4432 modules and I believe it to be bug free. However if a bug is found please contact me via PM.

And for all of the Dijkstra worshipers out there, there is not a single "goto" in the code. :rolleyes:

Goey
 

Attachments

Last edited:

srnet

Senior Member
Very interesting, I will check some of those routines out.

Your GET_FREQUENCY: routine looks far more elegant than the one I came up with,

Code:
displayfrequency:
	'Calculates the frequency the RFM22 is set to. Does not allow for any frequency hopping setting (registers $79, $7A)
	' does not account for frequency offset or the offset sign bit.
		
	low NSEL 				
	HSPIOUT($75) 			
	HSPIIN(var1,var2,var3)
	high NSEL
		
	var4 = var1 AND $20

	if var4 > 0 then 
		hbsel = 1
	endif 
	
	var1 = var1 AND $1F 		'isolate the bottom 5 bits
	var1 = var1 + 24 			'add base band of 24
	wvar2 = var1 * 10 		'now have high part of frequency in Mhz

	if hbsel = 1 then
		wvar2 = wvar2 * 2
	endif
	
	wvar4 = var2 * 4

	wvar5 = var3 * 100 		'multiply by 100 to avoid loosing precision

	wvar5 = wvar5 / 64

	if hbsel = 1 then
		wvar4 = wvar4 * 2
		wvar5 = wvar5 * 2
	endif

	var3 = wvar5 / 100 		'isolate the high bits
	wvar4 = wvar4 + var3

	wvar1 = var3 * 100 		'need this to calculate the remainder
	wvar5 = wvar5 - wvar1

	var3 = wvar4 / 100 		'isolate the high bits, need this to calculate the remainder
	wvar2 = wvar2 + var3
	wvar1 = var3 * 100
	wvar4 = wvar4 - wvar1

	wvar1 = wvar2
	gosub convertword
	serout TX, baud, ("TXfreq,",ascii3,ascii2,ascii1,".")
		
	wvar1 = wvar4
	gosub convertword
	serout TX, baud, (ascii2,ascii1)
	
wvar1 = wvar5
	gosub convertword
	serout TX, baud, (ascii2,"Mhz",CR,LF)
return
Although they above routine does display the frequency set to the nearest 1khz.
 

Goeytex

Senior Member
I thought that 10 kHz resolution was good enough and it made the maths a bit easier. Also since it uses channels I needed to account for registers $79 & $7A.

The idea was to make the routine as fast as possible given the limitations of integer only 16-bit math and relatively high command processing overhead.
 

Armp

Senior Member
Attached is some demo code.

This is just a sample that scans from 425 MHz to 435 MHz looking for a carrier. If a signal is detected that is above a certain RSSI threshold then the Frequency, RSSI level, and dBm are displayed.

The most important part of the code is the sub routines which I will call "functions". With these functions just about anything can be easily done with either a Dorji DRF4432F20 or a Hope RFM22B / BP. With the Hope module some pin changes may be needed.
Do you have similar Hope functions that I could use as a basis for coding an RFM69 implementation of this code?
 

Goeytex

Senior Member
Do you have similar Hope functions that I could use as a basis for coding an RFM69 implementation of this code?
Hi Armp,

I'm afraid the register settings and therefore the math will be different since the RFM69 uses a Semtech SX/SX1231H Transceiver IC.

Did you get my email from a week or two ago ?


Bill
 

Armp

Senior Member
Hi Armp,

I'm afraid the register settings and therefore the math will be different since the RFM69 uses a Semtech SX/SX1231H Transceiver IC.
I understand that Bill. I have downloaded your Dorji code and am in the process of remapping to the RFM69.
I'll keep you informed!
 
Last edited:

Goeytex

Senior Member
I did complete a Picaxe controlled Graphic RSSI indicator that swept the entire frequency band of the SI4432 Chip looking for signals. If a carrier was detected it showed the frequency & signal strength in text and also a bar graph for RSSI. The code is specifically for use with a 4D Sytems Graphic Display.

It was too slow to be practical, because of processing overhead (Those 100 us delays add up when doing thousands of commands), but it works good, even detecting the carriers of the local DTV stations.

If you want I will send the code via Email. Not to keen on posting it here as I think it may generate to many questions that I do not have time to answer. It is a large program.
 

srnet

Senior Member
If you want I will send the code via Email. Not to keen on posting it here as I think it may generate to many questions that I do not have time to answer. It is a large program.
Number one question I can predict, 'can you make it go any faster ?'

There is code out there (not PICAXE) that will turn a RFM22 and a PC into a resonably effective 'spectrum analyser', just search on Google for 'openLRS'. Its actually a Radio Control system, but the software has a spectrum analyzer option.
 
Top