Wireless BASIC Stamp Communication using 2-meter HT Radios
Ken Gracey
Posts: 7,392
Interfacing the RTX-12 Modem to a BASIC Stamp
Wireless Communication for Microcontrollers using HT Radios
General Description
The Tigertronics (www.tigertronics.com) RTX-12 Radio Modem and a set of 2-meter handheld radio transceivers offer a functional solution for long-range data transmission between microcontrollers. With 5W power on standard 2-meter handheld radios it is quite·easy to send data several miles or many more depending on antennas and line-of-sight, and whether or not repeaters are used. In this project we were able to send and receive valid data packets at a distance of three miles using 5W radios and HT antennas.
You must have an Amatuer Radio License (available through www.arrl.org) to try this project, though you could also attempt the same using the Family Radio Service radios if they have mic/speaker connections.
This example uses the BASIC Stamp, though it may be substituted with any microcontroller. The example includes two sets of programs: a simple version that lacks error checking and a more complete example with checksums.
The reason I am experimenting with this project is because I plan on porting it to the Propeller for use in my outdoor robots for telemetry. Specifically, this platform: http://forums.parallax.com/showthread.php?p=654636.
Required Parts
Schematic
Use the same schematic for transmitter and receiver. The receiver BASIC Stamp will be connected to your PC for DEBUG.·
Hardware Setup
Below are some general suggestions about the hardware setup:
Example PBASIC Programs
The RTX-12 Simple Transmit.BS2 and RTX Simple Receive.BS2 programs have no checksums or other error checking built into them. They are only provided to check your setup. To test them, program one setup as a transmitter and disconnect. Program the other setup as a receiver and leave it connected to the PC. Press "reset" on the transmitter and the receiver should display the following in the DEBUG window:
The RTX-12 Transmit.BS2 and RTX-12 Receive.BS2 programs have a 16-bit checksum to verify data integrity. These programs are documented for ease of use. You can simply change the data in the EEPROM to send different strings or values.
Resources and Downloads
Contributors
Chris Savage helped significantly by writing the complete code example and debugging the hardware. John Olson from Tigerbotics provided a quick review of my project for accuracy, too. Jim Ewald (IT Guy) on the forums is an experienced·ham operator and was most helpful in the tests we conducted at Parallax. Jim recently set up a ham station and antenna on the roof of our building so you'll probably see more radio projects from us in the future.
Post Edited (Ken Gracey (Parallax)) : 10/23/2008 4:33:04 PM GMT
Wireless Communication for Microcontrollers using HT Radios
General Description
The Tigertronics (www.tigertronics.com) RTX-12 Radio Modem and a set of 2-meter handheld radio transceivers offer a functional solution for long-range data transmission between microcontrollers. With 5W power on standard 2-meter handheld radios it is quite·easy to send data several miles or many more depending on antennas and line-of-sight, and whether or not repeaters are used. In this project we were able to send and receive valid data packets at a distance of three miles using 5W radios and HT antennas.
You must have an Amatuer Radio License (available through www.arrl.org) to try this project, though you could also attempt the same using the Family Radio Service radios if they have mic/speaker connections.
This example uses the BASIC Stamp, though it may be substituted with any microcontroller. The example includes two sets of programs: a simple version that lacks error checking and a more complete example with checksums.
The reason I am experimenting with this project is because I plan on porting it to the Propeller for use in my outdoor robots for telemetry. Specifically, this platform: http://forums.parallax.com/showthread.php?p=654636.
Required Parts
- (2) RTX-12OEM Radio Modems (Tigertronics #RTX-12OEM)
- (2) BASIC Stamp 2 Modules (Parallax #BS2-IC)
- (2) Super Carrier Boards (Parallax #27130) or other project area
- (2) Amateur Handheld Transceivers (Yaesu #VX-6R used in this example though a variety of HT models are suitable)
- (2) Radio Adapter Cables (Yausu #CT-91 for the above radio)
Schematic
Use the same schematic for transmitter and receiver. The receiver BASIC Stamp will be connected to your PC for DEBUG.·
Hardware Setup
Below are some general suggestions about the hardware setup:
- Two duplicate setups are required to run the sample programs; the schematic is the same for the transmitter and receiver. The receiver will remain connected to the PC via serial or USB cable to display data from the transmitter.·
- Tigertronics offers a ribbon cable to easily connect to their RTX-12. We suggest you purchase this cable since connecting to the RTX-12’s individual pins can be difficult without it. Tigertronics provides only one end of this cable terminated with the connector. You will need to locate some female 2x5 IDC connectors to wire the cable to your microcontroller.
- 2-meter HT radio manufacturers have vendor-specific cables to connect the mic and speaker port. The mic is commonly a 2.5mm cable and the speaker is 3.5mm. These are often joined for a single connection to the radio.
- You will need to make a cable to connect the radio’s mic and speaker cable to the microcontroller project board. These are both mono cables, available from RadioShack and other electronic suppliers.
- Critical attention should be paid to wiring. Diagnosing problems between the modem, radio and BASIC Stamp can be quite tedious if mistakes are made to the wiring.
- Tune both of your radios to the ARRL’s 2-meter “miscellaneous and experimental modes” of 145.50-145.80 (MHz). Set your radios to the lowest power mode necessary for transmitting and receiving.
Example PBASIC Programs
The RTX-12 Simple Transmit.BS2 and RTX Simple Receive.BS2 programs have no checksums or other error checking built into them. They are only provided to check your setup. To test them, program one setup as a transmitter and disconnect. Program the other setup as a receiver and leave it connected to the PC. Press "reset" on the transmitter and the receiver should display the following in the DEBUG window:
The RTX-12 Transmit.BS2 and RTX-12 Receive.BS2 programs have a 16-bit checksum to verify data integrity. These programs are documented for ease of use. You can simply change the data in the EEPROM to send different strings or values.
Resources and Downloads
- RTX-12OEM modem documentation from Tigertronics web site www.tigertronics.com
- American Radio Relay League web site www.arrl.org for licensing and band plan
- Example BASIC Stamp 2 Source code (in this post, zipped)
-·Full demo source code RTX-12 Transmit.bs2 and RTX-12 Receive.bs2
-·Simple demo source code RTX-12 Simple Transmit.bs2 and Simple Receive.bs2 - Amateur radio equipment reviews on eHam.net http://www.eham.net/reviews/
Contributors
Chris Savage helped significantly by writing the complete code example and debugging the hardware. John Olson from Tigerbotics provided a quick review of my project for accuracy, too. Jim Ewald (IT Guy) on the forums is an experienced·ham operator and was most helpful in the tests we conducted at Parallax. Jim recently set up a ham station and antenna on the roof of our building so you'll probably see more radio projects from us in the future.
Post Edited (Ken Gracey (Parallax)) : 10/23/2008 4:33:04 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~~ dRu ~~
A quote from the article:
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
-Phil
And?
@Leon
I just did a quick search and it seems you are correct. Even still you are not allowed to connect any device to the radio unless it is Fcc APROVED. Here is the Url of the info. http://www.provide.net/~prsg/frs-faq.htm#Q15 To me it seems cheaper to get a ham ticket then to get a device FCC aproved. LOL
Edited: The URL is the same as the link in Leons post.
Bonus!! you dont need to use that modem inbetween. The Digi modules have an integrated microcontroller/modem within the radio. And its error correcting!! They create networks that are SELF HEALING. If youve got a network and a module drops, it automatically heals itself. If you have more than 2 modules which source and destination modules are out-of-range, they'll use each other to route AUTOMATICALLY. Like a bucket brigade almost. Oh yeah, its got a integrated development environment for your pc, plugs right into an FTDI chip for your usb pleasure.
PLUS! The Digi radios use DIRECT SEQUENCE SPREAD SPECTRUM! 16 channels. AND , the digi modules have 128 bit AES encryption! Good luck hacking that.
PLUS! The modules are their own repeaters! End devices act like routers when they AUTOMATICALLY figure out the easiest way for themselves to re-organize a dynamic network, and do it on their own. They also do cyclic sleep routines! Which modules in the network sleep and wake synchronously for updates according to a sync signal from a designated sleep coordinator. Super low power... just 50uA current while sleeping. THE LOWEST expense in juice you can imagine.
AND- modules have multiple analog (and digital) in's. 250,000bps transfer rate max, down to 1200bps, remotely selectable. 2 PWM output channels. I just looked at the RTX-12, it says the modem doesnt do 4800bps?!? ..... what?....they cant do standard 4800bps gps signals?!?... How do you expect to do telemetry? Time of flight doesnt seem possible? ADXL321 and dead reckoning?.... lol.. They must expect you to walk around with a laptop in a backpack.
WOW, i almost forgot, they are 3.3v modules! It looks like youve got to use 7.4v for that radio of yours. Yikes! A Digi Zigbee and a propeller host makes such a nice 3.3v combo.
It seems pretty straight forward... 3.3v, longer range, lower power, faster, LEGAL, smaller and lighter, integrated modem, automatic repeater/routing, automatic acknowledge/checksums, sleep modes, automatically healing networks, OEM modules, and a heck of a lot cheaper. BUT HEY, WITH HT YOU CAN MOONBOUNCE, which seems like the only advantage of HT i can come up with. ( You might be able to moonbounce zigbee modules too, but i dunno. )
I can hook it up....keep your cellphone close today...
15 miles on 100 milliwatts. Thats with a 24dbi gain antenna and clear LOS. Even then it would be flaky at times. NLOS you would be reduced to about 300'. 900Mhz does work better and you can get up to about 4 miles NLOS provided that you only use about 5 Mhz bandwidth. Anything more and you drastically reduce the range. Both require high gain antennas. With the 2 meter HT you don't need high gain antennas and can achieve 40+ miles LOS. In most cases you would run the HT on low power which tends to be 100mw to 1 w depending on HT. Depending on location 900Mhz and 2.4gig bands can be quite crowded
In the end 2.4 gig is ideal for high bandwith LOS /Fixed station communication or short range omni directional NLOS. It is about the most enexpensive way to do things.
900Mhz (4watts PEP Max) improves distance over 2.4 gig at a reduced bandwidth. In NLOS conditions you need to reduce the bandwidth to 5Mhz to really get penetration. This should not be a problem seems how the BS can only handle about 9600baud anyway. With 5Mhz you can get about 900KB datarate. The price goes use quite a bit here. To get the best range you really need 15dbi antenna's which add about $75 bucks per unit although if you are willing to go the home brew method there are some nice designs on the net that can drop the cost to around $25. Over all the cost would be about the same as if you were a Ham using 2 meter or 430Mhz.
Unless your a Ham I think 430Mhz is out of the question unless you happen to fall into the legal data transmittion criteria. Even then everything has to be FCC approved. As far as I know you can run data such as RFID at very low wattage to only transmit a few feet. You can probibly get away with using the FRS handy talkies but it would be illegal.
2 meter is not a public band but offers the most reliable choice of all. It is limited to no more then 56k baud which is really expensive to get into. People have already been using the band for applications which the BS2 would easily fall into. It would cost about $155 or less per unit if you pick up the HTs used. (now where did my HTX 202 go?)
The basic rule of thumb is that the lower the Freq. the better it will preform but will be limited in baud rate. But with the Stamp baud rate is low enough for any of the bands in question. You can Moon bounce on 900 Mhz as well. You can also bounce off of Mountains if they are rocky.
civilian FRS/amateur radio is limited to 500mW, so ken is already over by a factor of 10. (dont "microwave" anyones brain!) Zigbee is limited to 1 watt, so its double the legal FRS power output values values. Ive heard reasonable quotes on distance NLOS right around 1-1.5 miles, around where the best zigbee modules are in realistic terms.
In the digi radios, the repeater costs you the same as a module, because the repeaters ARE modules. The antennas are relatively small and light. However, HT repeaters ive seen seem something the size of a refrigerator, or a car, with antennas the size of the washington monument, whereas you can put a zigbee module on a balloon and FLY the thing as a repeater/router. Its legal under a certain height to fly a module like that (i cant remember exactly) and under 15 lbs. Those HT repeaters cant do that in the same outline.
The direct sequence spread spectrum takes care of the "flakyness" by altering penetration signatures and traffic/collisions by shifting through the bandwidth of available wavelengths with a noise carrier to acquire acceptable readings, re-assembling the data by cancelling or "de-noising" the "chips" (which are going to chirps) does somewhat of a "differential measurement", like DGPS. The "chirps" of the new zigbee protocol are fabled to do ranging within a meter. Narrowband interference of HT is bad, whereas the large bandwidth of the Zigbee module's spread spectrum is highly invunerable to interference. We're dealing with data here, so one mistake can be catastrophic. Your cell phones do something similar to DSSS, called frequency hopping spread spectrum, but they hop randomly instead of predictably. The idea behind FHSS and DSSS are practically the same, its just a bit harder to hack FHSS. The spread spectrum jumps through samples it puts on its "noise" carrier, and has such a large bandwidth that it can actually exceed the width of the data being sent. The signal looks like white noise. HT looks like a normal FM signal, and is easily heterodyned or hacked. Phase shifting from travel can mess up HT because it does lie in such a strict bandwidth. In the DSSS, each frequency shift "error" should "average" out over the noise "carrier" signals. A bad way to explain it, but kind of correct.
GPS baud rates are 4800bps generally and the RTX-12 can only handle 2400. Thats the biggest problem with trying to get "high" bitrate signals (like a GPS module) on the HT radio as you said. Plus, the amount of modulation from heterodyne traffic in such a small amount of data could cause GPS readings to be faulty, and you wouldnt even know! If a zigbee communication goes bad, it retries automatically, and then drops if there's complete failure after a few more attempts, and acknowledges it. With HT you'd get stuck with accepting a bad reading. RFID tech these days shows this principle. Its intuitive that a higher frequency signal has greater invunerability to interference, but greater vunerability to shielding, HOWEVER, since zigbee uses the same 2.4ghz and 900mhz frequencies as does generation two RFID readers/tags, BUT SPECTRUM SHIFTS, you dont run into the shielding problems so much as with RFID in the same band, and you still get to reap most of the distance benefits of the higher frequency. Theres just not enough bandwidth for HT to do the same, and to avoid all the traffic. With zigbee spectrum shift, you get something like 10 million separate virtual channels, which CANT phase shift each-other coherently, due to their "white noise" look. I sound like a broken record now. If you could just get a reliable noise carrier signal over the FRS bands to lay the data on, and linear feedback shift register somehow.
Why not put them both together
Post Edited (Sleazy - G) : 5/23/2009 5:26:49 PM GMT
I imagine you could get a great moonbounce with the zigbee modules on a clear day, and with little problems with the noise carrier differential calculation behaving almost like a GPS sattelite. You could probably put a few modules on the moon, and use them as repeaters, with some solar cells maybe. [noparse]:)[/noparse]. Thats what 802.15.4a is going to be, but in shorter distance, with "chirp" instead of "chip"
OK... I THINK I just found HOW KEN INTENDED ON DOING THE TELEMETRY. Automatic packet reporting system! I just read this. I know something similar had been done before, but i couldnt remember what it was called. The signals were just transferred so many times that the differential of its path history was resolved. This is actually a differential systems like GPS, but the APRS worked like zigbee module networks, where nodes hop in proximity, which in itself provides information. About speed ...
"
...Ways to achieve higher speeds than 1,200 bit/s, include using telephone modem chips via the microphone and audio out connectors. This has been proven to work at speeds up to 4800 bit/s using fax V.27 modems in half-duplex mode. These modems use phase shift keying which works fine when there is no amplitude shift keying, but at faster speeds such as 9600 bit/s, signal levels become critical and they are extremely sensitive to group delay in the radio."
Custom modems have been developed which allow throughput rates of 19.2 kbit/s, 56 kbit/s, and even 1.2 Mbit/s over amateur radio links. However, special radio equipment is needed to carry data at these speeds, and their adoption has been limited. In these special radios, the interface in between the "modem" and the "radio" is at intermediate frequency -part of the radio disregarding parts of the radio that were used for voice modulation production and detection.
In commercial data radio uses the intermediate audio stage is dispensed with, and bits are transmitted by directly altering output frequency in between two distinct frequencies (in case of FSK modulation, other alternates do exist). Such radio modem chips are now available, but as they are incompatible with previous Amateur Packet Radio technologies, they have not been adopted into amateur radio use."
..... so you can use the audio channels as a modulation signal on top of the 145mhz pre-FM data. Tricky. Thats what you need to do. More from what ive been reading.....
"Byonics has introduced an all-in-one device combining a GPS receiver, TinyTrak controller and synthesized 2m radio called the Micro Trak AIO which requires no assembly by the user.
ArgentData now has a 5-Watt VHF Transceiver with Integrated Tracker2 in one compact package. With a non-display GPS receiver connected, the T2-301 can be used as a tracker. With compatible display-type GPS receiver, received position reports can be output as waypoints. With a Garmin Nuvi 350 GPS receiver connected, it can send and receive APRS messages as well as display other stations as wayoints. The Nuvi 350 can be used this way with a stand-alone Tracker 2 (OT2m) or connected to a T2-135 which mounts in an Alinco DR-135 radio. The T2-301 can also be used as a stand-alone digipeater. Just connect an antenna and power, and program it, and it's ready to go.
The aprs SkyTracker is an APRS Beacon at 144.800Mhz which includes a 8W RF Transmitter, programmable PIC & u-bloc GPS receiver all on one 72x56mm PCB."
Sounds like what youve got there.
Oh, and as I was saying earlier, that putting the 2 meter radios with the 2.4Ghz and 900Mhz zigbees cooperatively CAN WORK, CHECK THIS OUT
"One notable detail is that 2.4 GHz WLAN band is partially overlapping amateur radio band, and thus WLAN hardware can readily be used by amateur radio licensed operators with higher power radio gear than what the general population "license free" usage allows. ("Free to receive by anybody", "transmit only between licensed radio amateurs", and "no encryption" rules usually make these very unappealing to spend time on.) Regulation details differ around the world.
So maybe we can work around the law... :P SO YOUve got an APRS NODE - DIGIPEATER in CALIFORNIA - callsign
N6EX-4 San Joaquin Hills, California [noparse][[/noparse]show location on an interactive map] 33°36′21″N 117°48′38″W
Maybe something to test off of. I think we should make something together with this now, mix the best of 2.4Ghz/900Mhz and 2 meter. You'd think if one was failing, the other could "come through" for you. And if you can get around FCC power regulations by using 2.4ghz/900mhz equipment with the 2 meter wavelength, theres no sense in NOT multiplexing them.
Jeez... im thinking about this way too hard now. More later.
LOL Wow just skim over your two posts, I will have to reread them later because it appears you made some interesting comments. It does seem like getting the full 56k baud on 2 meters should be easier then the current method. You can go up to 9.6k easy enough.
I think Ken has a great Idea here where you can communicate to a robot over long distances. Or you can even using it to control X10 devices remotely. I would really like to see this ported onto the Propeller as then you can handle higher data rates and string lengths. I have been toying with the Idea of building an APRS Propeller station for my car which would allow me to connected a display/Keyboard to a Kenwood D700 to create a full APRS station. But right now I have other pokers in the fire which need to get completed.
Antenna towers hold the antenna in position, raise it above surrounding objects on the ground to improve transmission and reception, keep transmitting antennae away from people/animals that could be harmed by the radiated energy, and provide a way of pointing directional antennae. Antenna towers are typically just sections of metal pipe with cross reinforcing pieces and mounting hardware at the top and bottom.
56k is impossible on 2m!
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
-Phil
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Post Edited (Leon) : 8/18/2009 11:49:45 AM GMT
-Phil
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
I had though about using the Parallax 433 MHz RF Receiver/Transmitter modules, but we need a range of 0.5 to 1 mile. I had also thought about using FRS radios, but there are problems with the interface, especially activating the PTT switch.
Are there any simple Rx/Tx modules that have the range? Will the XBee-PRO be easy to interface to the BASIC stamp?
Thanks!
Andy
··· Digi (formerly Maxstream) makes some really nice 900 MHz, 1 Watt standalone wireless modems that interface easily with Stamps and will allow your required 2-way data flow. Have a look on the Digi website for the XTend products. Also available through DigiKey.
· If you want to discuss further, we can move over to the Sandbox.
··
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Thanks for the reply. I think the Digi modules may well do the job.
Thanks again,
Andy