Building a radio modem, how to get it done? - Page 1
Forum section: electronics / beginners

author: Nerobro
author_rank: Contributor
timestamp: September 16, 2013, 07:37:13 am
content: Hello All,I have a few arduinos, and a few FRS radios. I want to use them as low cost serial radio links. With the ultimate goal of running a PPP link across them. (2400bps would be the lower practical limit.)By using a FRS radio, I get "proven" radio gear, and I don't need to learn RF.The mechanical part of me, likes the whole CW thing. Where I could use one radio to key up, and key down the FRS radio. That method would be very, very slow, and I'd be depending on the carrier detection of the radio to tell me when there's a signal or not. I don't like that method.So, the next method that comes to mind, is sending tones. Just like a normal modem does. But using an arduino, how does one decode them at the other end? And then there's error correction. Does an ATmega328 have the horsepower to do it? Or do I need to find a modem to patch into the radio? I'm not even sure how one would do the signal conditioning. I suppose a high (or low) pass filter would let me filter for 1's or 0's. But how do I carve out the 1200hz carrier?Looking at the HAM radio people, it seems to me like it's moderately common to (or was...) to hack a normal telephone line modem to their radio to send, or receive data. Would this be my best bet? The interface at that point would just be to the serial input on the arduino. Or PC, as the case may be.Just for the wow factor, these guys sell a v.92 modem WITH rj11 jack, that's not much bigger than the jack itself.http://www.radi.com/modular51.htmWell I apreciate all comments, good or bad. Send me down a road people. :-)

author: ve7xen
author_rank: Super Contributor
timestamp: September 16, 2013, 08:32:53 am
content: QuoteBut technically you're breaking the law. It is not legal to use a modified FRS radio, and I believe there is also some verbiage about digital modulation.QuoteIt shouldn't be too difficult to do in an ATmega, though you may not have the horsepower to do some of the better DSP-based demodulators. The modulation part is trivial. Look for APRS trackers and packet radio TNCs. They basically do all of this already, there's plenty of code out there to look at and products to buy if that's what you want. OpenTracker+ is one all-in-the-micro, source code available example. You can of course also use more traditional modem techniques if you don't want to do the signal processing in software. A phone modem should work too, I think. Anyway, this is a pretty well covered problem, read the ham literature on packet radio.Since you're already breaking the FRS rules, you probably don't care, but be aware most ham gear on UHF/VHF uses a deviation of 5khz, while FRS channels use 2.5khz deviation, so some instructions may need to be modified... You should get a ham license and do it legally.If you want to do much better than 1200bps you will probably need to modulate the carrier directly rather than modulating the audio going through the existing signal path as in these techniques. This will definitely require you to modify your radios.

author: Rigby
author_rank: Super Contributor
timestamp: September 16, 2013, 03:46:13 pm
content: You don't mention what country you're in. If you're in the US, Canada, EU, UK, AU, NZ, or ZA, the likelihood of this being legal is very low.Look into whitespace radio boards. They use frequencies freed up by the analog -> digital TV switch. They have high bandwidth. Most importantly, they're probably legal.

author: Nerobro
author_rank: Contributor
timestamp: September 16, 2013, 05:26:18 pm
content: I am KB9WSA, and I'll be doing this on the Ham overlap channels. :-) Guess I should have mentioned that eh?Hmm.... The opentracker+ has potential. ax.25 seems to blow a lot of bandwidth on the headers. But I think the important parts there is that it's got the modem bits for me.

author: olsenn
author_rank: Frequent Contributor
timestamp: September 16, 2013, 05:57:24 pm
content: It will be incredibly slow after you take into account data validity checks. Look into APRS (a form of packet radio). Radios like the Yaesu FT1DR are leaders in digital communications, and even these are limited to less than 10kbps (little over 1kB/s) and that is a best case scenario.

author: AG6QR
author_rank: Frequent Contributor
timestamp: September 16, 2013, 06:30:21 pm
content: Quote from: Nerobro on September 16, 2013, 05:26:18 pmThere are no "Ham overlap channels". FRS channels are all in the 462MHz and 467MHz range. The closest ham band is 70cm, which is 420 - 450 MHz in the USA.There are some channels which overlap between FRS and GMRS, but both FRS and GMRS forbid data transmission, and your ham license doesn't give you any privileges on GMRS, anyway.Since you're a licensed ham, I'd suggest you stay off the FRS frequencies where you risk your Ham license for unauthorized data transmission. Ditch the FRS idea, and get a pair of ham HTs to handle the radio part (there are cheap chinese ones available for $30 or so these days). Keep the power turned way down for your initial experiments. You can legally transmit data with them, in many ways. Look at the ARRL band plan for the authorized data frequencies. Search for "Packet Radio" for some ideas.I've built a TinyTrak4 from a kit by Byonics, which is a radio modem intended for handling APRS packets, but it can also serve as a general purpose KISS packet TNC. There are many other options. Ham radio operators have done a lot of work on packet radio; there's no need to reinvent the wheel unless you want to. The proliferation of cell phones and internet means that a lot of packet radio equipment is going unused these days, and it shows up very cheap at hamfests and swap meets.

author: ve7xen
author_rank: Super Contributor
timestamp: September 18, 2013, 04:03:58 am
content: Quote from: Nerobro on September 16, 2013, 07:37:13 amQuote from: olsenn on September 16, 2013, 05:57:24 pmSo, yeah, I think the OP is aware...Just to nitpick, APRS isn't a 'form of packet radio', it's a protocol for position reporting that runs on top of AX.25, and there isn't really a well defined physical layer. 1200bps AFSK ("Bell 202") and 9600bps FSK ("G3RUH") are both fairly common, and there are other weirder modes that maybe people still use? Both modes operate on off-the-shelf (ie. designed for voice) radios using voice width channels. Nothing precludes you from using wider-bandwidth radios or more advanced modulation to get much better performance (other than not having an Advanced license, anyway). These techniques are used because they're popular and relatively easy/cheap to implement and understand using existing voice equipment, not because they offer the best performance.Anyway back on topic, I'm with AG6QR, get a couple cheap Chinese HTs to play around with and start with a simple 1200bps AFSK modem, for which there are many implementations. You might be able to run PPP over such a link if you ditched the AX.25 stuff, but I'm not sure there are any PPP implementations that handle half-duplex links like your radio link would be (unless you had two radios per station). You might be able to hack some buffers into the firmware, but it might be hard to get it reliable, especially if your aim is to transport thinks like TCP/IP over it, the T/R delay might kill you.Of course, you could probably just do this with a pair of cheap ISM-band transceivers like the nRF24L, depending on what kind of range you want.

author: Nerobro
author_rank: Contributor
timestamp: September 18, 2013, 07:36:02 am
content: A big reason for going with FRS radios, is buying four radios is a $40-60 proposal, and they're disgustingly common. (and to cheat, I have two already...)So, if I want to go on conventional HAM bands, the cheapest I am seeing is $34 per radio, and I'm still going to need modems.Point taken though. I'll work on "what radio" later. I'll keep the radios roughly in the 70cm band.I have three goals for this project. One, is to "just get a two way radio serial link" working. Two, is to have a reason to do signal leveling, both getting to the modem from the radio, and from the radio to the modem again. Third, is short range telemetry. (which would work with just a pair of radios..) Range, in all cases, would be less than 1 mile. But more than a few hundred feet.Time to dive into the packet radio pages I think.

author: amyk
author_rank: Super Contributor
timestamp: September 18, 2013, 11:22:23 am
content: Quote from: AG6QR on September 16, 2013, 06:30:21 pmSo all you can transmit is noise?

author: Nerobro
author_rank: Contributor
timestamp: September 18, 2013, 05:28:59 pm
content: You, you're a funny one!Hmm... transmit data via voice. :-) Home made numbers stations!

author: Marco
author_rank: Super Contributor
timestamp: September 18, 2013, 06:04:10 pm
content: Why not use 433 MHz modules and make some amplifiers? (With CC1101 you should be able to use a channel bandwidth <100 kHz and baud rate below 56k, that should make it legal right?)

author: w2aew
author_rank: Super Contributor
timestamp: September 18, 2013, 06:53:09 pm
content: Quote from: Marco on September 18, 2013, 06:04:10 pmIf you add an amplifier as you suggest, then it might not be legal anymore.

author: AG6QR
author_rank: Frequent Contributor
timestamp: September 18, 2013, 06:56:33 pm
content: Quote from: Marco on September 18, 2013, 06:04:10 pm433 MHz isn't in a ham band, so hams have no special rights there (and anectdotally, I've heard the FCC comes down harder on licensed hams than on the general public when they violate the rules outside of the ham bands, because hams are supposed to know better.)Unlicensed operation is permitted in the 433 MHz band, under part 15.231. There's not a limitation on baud rate, but there is one on bandwidth. More importantly, continuous transmissions aren't allowed.An excerpt from 15.231(a):"(Operation is) restricted to the transmission of a control signal such as those used with alarm systems, door openers, remote switches, etc. Continuous transmissions, voice, video and the radio control of toys are not permitted. Data is permitted to be sent with a control signal. The following conditions shall be met to comply with the provisions for this periodic operation:(1) A manually operated transmitter shall employ a switch that will automatically deactivate the transmitter within not more than 5 seconds of being released.(2) A transmitter activated automatically shall cease transmission within 5 seconds after activation.(3) Periodic transmissions at regular predetermined intervals are not permitted. However, polling or supervision transmissions, including data, to determine system integrity of transmitters used in security or safety applications are allowed if the total duration of transmissions does not exceed more than two seconds per hour for each transmitter. There is no limit on the number of individual transmissions, provided the total transmission time does not exceed two seconds per hour."15.231(e) allows an alternate way of operating, with lower power limits, but "the duration of each transmission shall not be greater than one second and the silent period between transmissions shall be at least 30 times the duration of the transmission but in no case less than 10 seconds."In any case, there are very low power limits, so amplifiers are out.Since the 433MHz area is so widely used for garage door openers, wireless thermometers, car keyfobs, and other common consumer gadgets, it's likely that a continuous high power transmission in this frequency would jam somebody's device and be discovered pretty quickly. And that's why the rules are set up the way they are -- Brief collisions and interference are likely in crowded neighborhoods, but since everyone has such a low duty cycle, things usually work OK when you push the button a second time.I'd say that, if you want to operate a data link using unlicensed frequencies outside the ham bands, an XBee or similar is probably the easiest way to go.But ham gear offers more options for high power long range communications.

author: Marco
author_rank: Super Contributor
timestamp: September 18, 2013, 07:55:47 pm
content: Quote from: AG6QR on September 18, 2013, 06:56:33 pmAFAICS it's part of the 70 cm band which is a HAM band, and data is allowed with the caveat of 56 kBaud and 100 kHz.http://www.w5yi.org/page.php?id=137http://www.w5yi.org/page.php?id=139You'd probably want to avoid the EU ISM bands, because so many modules crowd it, but the CC1101 modules can cover the entire 70 cm band AFAICS.

author: Marco
author_rank: Super Contributor
timestamp: September 18, 2013, 08:03:10 pm
content: Quote from: w2aew on September 18, 2013, 06:53:09 pmHams can use 50 Watt in the 70 cm band, I think he can amplify the output of a CC1101 (10 mW) just a little and stay legal.

author: AG6QR
author_rank: Frequent Contributor
timestamp: September 18, 2013, 08:17:34 pm
content: Quote from: Marco on September 18, 2013, 07:55:47 pmOops, my mistake, you're right. I'm so used to seeing 433MHz as a part 15 unlicensed frequency, and I don't normally use 70cm, so I overlooked the obvious.

author: Nerobro
author_rank: Contributor
timestamp: September 21, 2013, 03:21:22 am
content: So back to the mechanics of the whole thing. I suppose it's a "lets develop a protocall" question.To send a signal, I use a carrier, and send a tone across that carrier. By watching for the carrier, I know that there's "A" signal there to lock on to. General RF noise, can intrude on that... So instead of modulating the carrier, we modulate a signal carried on the carrier. IE sending the 1200hz tone, like a conventional modem.So how do we break the signal out? FFT and watch for the moving frequency spike? Or could it be done more simply, with two band pass filters, and a guess of a clock signal?

author: ve7xen
author_rank: Super Contributor
timestamp: September 21, 2013, 05:24:47 am
content: The only reason direct modulation isn't used is because it's harder to retrofit voice equipment to carry it. It's a better technique (and probably easier to implement) if available to you.This is all well covered in the literature, there are quite a few articles in various ham magazines and online that cover this stuff. Lots of (DSP) demodulation techniques are available for a simple binary FSK.- Time zero crossings - this will work for good signal quality and is practically trivial to implement- Filter twice as you suggest and compare power (essentially an optimized FFT)- PLL and derive the incoming frequency from the PLL parameters. This is more an analog technique and probably isn't that easy to do with a poor man's DSP- Mix the input with artificial signals at the FSK frequencies and look for correlationThere are others, I'm sure. Locking the bitstream is called 'slicing' and typically requires periodic sync frames, which you detect and align your demodulator to.

author: G7PSK
author_rank: Super Contributor
timestamp: September 21, 2013, 09:28:07 am
content: If you want to get cheap radios that will convert to HAM frequencies there are a lot of of ex police radios on the market. Obviously you are not permitted to operate on the police frequencies but as a licensed ham you are permitted to alter any radio to operate on allocated frequency.

author: Nerobro
author_rank: Contributor
timestamp: September 21, 2013, 10:29:56 pm
content: re-programming police radios is a pain in the butt. ... My first radio was a HT300, followed by a HT1000. And then interfacing with Motorola's proprietary interfaces. Then the risk of bricking them. *shivers* That said Motorolla has their own fancy data protocol that virtually all of their Jedi series radios use. I'll bet kenwoods stuff is easier to play with.So.. things to research "Time Zero Crossings"I don't know enough about PLL to do that on my own now. :-(FSK?

author: ve7xen
author_rank: Super Contributor
timestamp: September 22, 2013, 07:43:45 pm
content: I had a good article from a Ham magazine on implementing the mixing approach, but I can't find it now. I had been collecting literature on this and planned to implement a TNC but never got around to it. Now I seem to have lost my collection of documentation.TI has this:http://www.ti.com/lit/an/slaa037/slaa037.pdf

author: madsci
author_rank: Regular Contributor
timestamp: September 25, 2013, 02:32:24 am
content: Go to a hamfest, pick up some used HTs. It's hard to beat the old Icom IC-T7H for durability if Motorola isn't your thing.Or get on eBay and grab one of those Chinese business radios; the things are freeband (i.e., no MCU based lockouts) and allow transmission on amateur bands. Quansheng and Woxun are the popular ones.

author: Nerobro
author_rank: Contributor
timestamp: September 30, 2013, 04:19:21 am
content: Quote from: ve7xen on September 22, 2013, 07:43:45 pmWell that's really useful. Thank you.