PICAXE and RFM22 RF Beacon

srnet

Senior Member
This is the PICAXE code for an RF Beacon, actually the PICAXE in SPACE code with mission specific stuff removed. The code is for a PCB that uses a 40X2, but should run on a 28X2 also.

The objective was to see if it would be possible to produce a small low cost satellite using commercial components, and still be able to communicate with it in low Earth orbit.

The RF transmitter is the Hope RFM22, and this is used to transmit a number of different modes to see which are viable at such low powers, 100mW max. The RF transmission modes are;

Slow Speed Morse beacon – for messages and call signs. The slow Morse is transmitted as FM audio, the tone and rate is altered low\medium\high dependant on battery and solar volts.

Fast Morse – FM for decode via PC. Data sent is measured currents and voltages.

FSK RTTY – transmits the contents of a memory block as ASCII numbers.

RFM22 data packets, uplink and downlink. Uplink allows for various commands to control the beacon, turning transmit on \off, requesting data or slow Morse RSSI reports for incoming packets and remotely changing one of the messages. Command packets, such as to turn transmit on\off require an 8 byte key from the remote transmitter to match a key stored in the beacon, before they are acted on.

The software goes around in a loop. At the start it measures, battery and solar voltages, solar charge current and board current, measures RFM22 and PCB temperatures and does a check on a 512 byte RAM buffer for changes. All this data is put in a RAM buffer for transmission as RFM22 data packets and FSK RTTY. The software then transmits one of the 5 slow Morse messages, listens for an incoming command packet, transmits the fast Morse or FSK RTTY data and goes to sleep for a period. The sleep periods are used to power manage the beacon, longer sleeps for lower battery voltages. Battery is a single Lithium Ion battery.

The software keep track in EEPROM of the transmission state (on\off), number of processor resets (from an external watchdog or low volts supervisor) and the number of RFM22 resets detected.

Of particular interest to amateur radio enthusiast is probably the FSK RTTY. This does need a reasonable communications receiver to pick up or Funcube dongle but is highly efficient. In this implementation the block of memory between StartRAMdata1 and EndRAMdata1 is converted into ASCII numbers and transmitted in the form of a GPS NMEA formated string. See a typical decode below, taken form a PC screen;

$ABCDE,,,1,25,,88,255,65,255,17,255,255,40,5373,*58

If you cut and paste the bit between the $ and * into one of the on-line NMEA check sum checkers, you will see that the check sum (58) is correct.

The FSK RTTY send routine (sendRTTYpacket) builds up the ASCII data in the scratchpad, from location 0 onwards, replacing any leading zeros in the numbers with nulls (0) so that a word value of 1 gets sent as 1, rather than 00001. The routine that transmits the actual FSK shifts (sendRTTY) ignores the null characters. A $FF in the scratchpad signals the transmit routine to stop sending from the scratchpad and append the checksum.
 

Attachments

Its worth pointing out that the FSK RTTY produced by a RFM22\Si4432 is by no means perfect.

The RF chip has a a capacitance adjust register that allows for fine tuning of the RFM22 frequency. Unfortunately when the transmit is turned on for seconds at a time (its really only designed for short burst packets) the frequency drifts quite a bit, I presume due to heating of the capacitance adjust mechanism. The drift can be seen in the attached screen print of FLDIGI.

The drift shown is at 100mW, its a lot less at 10mW.

Fortunately FLDIGI has an AFC function in RTTY mode and is able to track the changes.

Nothing in life is perfect I guess, but given that the range should be 'considerable' , and the radios only cost $8, perhaps its not worth complaining too much.
 

Attachments

  • Clipboard02.jpg
    Clipboard02.jpg
    126.3 KB · Views: 92
Its not been directly possible to test the achievable distances for the various modes, especially at full power, the distances are simply too great.

However a direct LOS test of RFM22B to RFM22B data packets, using 1/4 wave TX and RX antennas only, gave a LOS range of 40km. The RFM22B has variable power output, so you can cut the power and compare results. At max power (100mW) I was getting 100% of packets at 40kM, 50% of packets at 50mW, and maybe 15% at 25mW.

With a baseline established, RFM22B data packets at 40km using 100mW, I then carried out a series of tests that ran the beacon loop with all the modes in use, but cutting the power with each subsequent loop over a short 4kM distance. In some cases attenuators were needed to cut the transmitted power below 1mW. You can then see at what power level the transmission of a particular mode fails, and you have a dBm relationship for the effectiveness of the various modes.

With RFM22B data packets at 0dBm the approximate improvements were;

RFM22B plus a masthead LNA, +12dBm
Fast Morse decoded on a CommsReceiver\HT +9dBm
Fast Morse on a Funcube Dongle +17dBm
FSK RTTY on a comms receiver (FT817 + Funcube Dongle) + 26dBm

So at 100mW fast Morse decoded by a comms receiver\HT ought to get you +9dBm x 40km = 120kM.

Note that the above 'improvements' are based on 1\4 wave antennas only, you would get a further 10dBm using just a modest yagi at the receiver end.

The FSK RTTY shows a 26dBm improvement over 40kM, so with a modest yagi at the receiver end there is a potential 36dBm improvement over the 40kM.

There is clearly a lot of estimations going on here, and until one of these beacons ends up in low Earth orbit I wont know for sure how effective the modes are in reality. The one report we do have is that the high altitude balloon guys say that they get around 450kM using FSK RTTY from a RFM22B at 10mW (the UK limit for airborne stuff), so 1000km plus for 100mW FSK RTTY does look practical.

The code I posted will also work on the big brother of the RFM22B, the RFM23BP, that has an output of 1W at 5v supply.

And yes, there are radios specifically designed for low power comms over long distances, but they dont cost $8, are not a 16mm x 16mm module and dont run from a 3v supply.
 
Bang for buck ?

What about a £6 USB DVB TV dongle and free PC software as a receiver ?

Not as good as the far more expensive comms receiver or Funcube Dongle, but they work ............
 
I made a very simple mod to the Morse code routines, and the RFM22 will now happily transmit slow speed FSK\LSB Morse.

I recall that when I was on a hilltop testing the RFM22 data telemetry, I could just decode the FM slow Morse ident when the TX was 40km away and transmitting a mere 1mW.

I just compared the FM Morse with the FSK Morse and you get around a 12dB improvement in sensitivity, using a FT817 rig.
 
Its not been directly possible to test the achievable distances for the various modes, especially at full power, the distances are simply too great.

However a direct LOS test of RFM22B to RFM22B data packets, using 1/4 wave TX and RX antennas only, gave a LOS range of 40km. The RFM22B has variable power output, so you can cut the power and compare results. At max power (100mW) I was getting 100% of packets at 40kM, 50% of packets at 50mW, and maybe 15% at 25mW.

With a baseline established, RFM22B data packets at 40km using 100mW, I then carried out a series of tests that ran the beacon loop with all the modes in use, but cutting the power with each subsequent loop over a short 4kM distance. In some cases attenuators were needed to cut the transmitted power below 1mW. You can then see at what power level the transmission of a particular mode fails, and you have a dBm relationship for the effectiveness of the various modes.

So at 100mW fast Morse decoded by a comms receiver\HT ought to get you +9dBm x 40km = 120kM.

And yes, there are radios specifically designed for low power comms over long distances, but they dont cost $8, are not a 16mm x 16mm module and dont run from a 3v supply.


Ok, maybe I don't live a very exciting life, but the thought of getting two micros to communicate at 40kms, really quite excites me! :-)

So on the weekend I went off an bought a couple of RFM22B breakout boards, http://modtronicsaustralia.com/shop/rfm22b-s2-rf-transceiver-breakout-board-v2/, with SMA connectors so I can give this a whirl. Next on my list is to find myself a couple cheap yagi's and I'll be up and running. Hopefully!!

Thanks very much for posting the details of all the work you've been doing on this.
 
Ok, maybe I don't live a very exciting life, but the thought of getting two micros to communicate at 40kms, really quite excites me! :-)

So on the weekend I went off an bought a couple of RFM22B breakout boards, http://modtronicsaustralia.com/shop/rfm22b-s2-rf-transceiver-breakout-board-v2/, with SMA connectors so I can give this a whirl. Next on my list is to find myself a couple cheap yagi's and I'll be up and running. Hopefully!!
Thanks very much for posting the details of all the work you've been doing on this.

Well path loss at 40kM line of sight is -117dB.

So if you add cheap yagis (10dB each ?) at either end thats 20dB of extra gain, the path loss calculator says you should get 400kM.

And the FSK RTTY will get you about the same distance using only 1/4 wave antennas at either end, although the FSK RTTY is one way only.

Communications at UHF are massively dependent of terrain, testing the same transmitter with it lying on the ground in a forest, the range for RFM22 packets was only 205M versus 40kM LOS, so a variation of 200:1.
 
Anyone who wants to listen to how far low power FSK Morse will get you should listen out for SWISSCUBE, 120mW, 437.505mhz;

http://www.n2yo.com/?s=35932

You will hear it on the ground with just an omni antenna, no gain antenna or low noise amplifier required.

I have a Quadrafilar helix as an omni and have heard SWISSCUBE at 2,500km or so.
 
There is indeed some interesting stuff out there.

The RFM22B transceiver is an FSK device, you can either use it for its own FSK digital data, or direct FSK modulation (for RTTY style comms) or in direct mode does a reasonable emulation of FM Morse Audio. I did the FSK RTTY because it was so easy to implement in PICAXE code and is easy to receive using a ham transceiver and a PC.

What I cant see is how you would do a form of phase shift keying with the device, needed for more advanced modes. There may be other modules out there that will do PSK, but the size and cost of the RFM22 is hard to beat.

However, the PICAXE should cope with slow data rates, especially if run at higher than 64Mhz, so suggestions welcome .........

See picture of the various size 'beacon' boards I have done, far right is the newest yet to be built PCB, and I cant see it getting any smaller.
 

Attachments

  • Beacons Different Sizes.jpg
    Beacons Different Sizes.jpg
    29.9 KB · Views: 76
Back
Top