Silicon ChipHalf-Duplex With HopeRF’s HM-TR UHF Transceivers - April 2009 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Everyday solvents can be dangerous
  4. Feature: Digital Radio Is Coming, Pt.3 by Alan Hughes
  5. Feature: Wireless Networking With Ubuntu & Puppy Linux by Greg Swain
  6. Project: Multi-Function Remote-Controlled Lamp Dimmer by Mauro Grassi
  7. Project: School Zone Speed Alert by Jim Rowe
  8. Project: USB Printer Share Switch by Jim Rowe & Greg Swain
  9. Project: Build A Microcurrent DMM Adaptor by David L. Jones
  10. Review: Tektronix MSO2024 Mixed Signal Oscilloscope by Mauro Grassi
  11. Vintage Radio: The Airzone 520/550 5-valve mantel receiver by Rodney Champness
  12. Feature: Half-Duplex With HopeRF’s HM-TR UHF Transceivers by Stan Swan
  13. Book Store
  14. Advertising Index
  15. Outer Back Cover

This is only a preview of the April 2009 issue of Silicon Chip.

You can view 33 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Digital Radio Is Coming, Pt.1 (February 2009)
  • Digital Radio Is Coming, Pt.1 (February 2009)
  • Digital Radio Is Coming, Pt.2 (March 2009)
  • Digital Radio Is Coming, Pt.2 (March 2009)
  • Digital Radio Is Coming, Pt.3 (April 2009)
  • Digital Radio Is Coming, Pt.3 (April 2009)
  • Digital Radio Is Coming, Pt.4 (June 2009)
  • Digital Radio Is Coming, Pt.4 (June 2009)
  • Digital Radio Is Coming, Pt.5 (August 2009)
  • Digital Radio Is Coming, Pt.5 (August 2009)
Items relevant to "Multi-Function Remote-Controlled Lamp Dimmer":
  • Intelligent Remote-Controlled Dimmer PCB [10104092] (AUD $10.00)
  • PIC18F1320-I/SO programmed for the Intelligent Dimmer [1010409A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC18F1320 firmware and source code for the Intelligent Remote-Controlled Dimmer [1010409A.HEX] (Software, Free)
  • Intelligent Remote-Controlled Dimmer PCB pattern (PDF download) [10104092] (Free)
  • Intelligent Remote-Controlled Dimmer panel artwork (PDF download) (Free)
Items relevant to "USB Printer Share Switch":
  • Manual 2-Way USB Device Switch PCB [07104091] (AUD $5.00)
  • USB Print Share Switch PCB pattern (PDF download) [07104091] (Free)
  • USB Printer Share Switch front panel artwork (PDF download) (Free)
Articles in this series:
  • Amateur Radio (November 1987)
  • Amateur Radio (November 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (February 1988)
  • Amateur Radio (February 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (January 1989)
  • Amateur Radio (January 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (February 1990)
  • Amateur Radio (February 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (July 1990)
  • Amateur Radio (July 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (January 1991)
  • Amateur Radio (January 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (January 1992)
  • Amateur Radio (January 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (January 1993)
  • Amateur Radio (January 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (February 1994)
  • Amateur Radio (February 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (January 1995)
  • Amateur Radio (January 1995)
  • CB Radio Can Now Transmit Data (March 2001)
  • CB Radio Can Now Transmit Data (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • Stressless Wireless (October 2004)
  • Stressless Wireless (October 2004)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Dorji 433MHz Wireless Data Modules (January 2012)
  • Dorji 433MHz Wireless Data Modules (January 2012)

Purchase a printed copy of this issue for $10.00.

Half Duplex with HopeRF “TTL” HM-TR UHF data transceivers By STAN SWAN Our introductory second-generation UHF data transceiver article in October 2008 showed that using a PICAXE to drive HopeRF’s HM-TR 433MHz programmable data transceivers works well. In subsequent months, these well-priced units have become very popular! F OR THOSE WHO have just come in, these Chinese-made UHF FSK data transceivers, selling locally for ~$25 (via MicroZed, the Australian PICAXE distributors) offer tempting programmable features in a 6-pin SIP “one-stop” package. They have been found well-suited to more professional 433MHz ISM applications. Thanks to a quality-fitted antenna socket, even the supplied “rubber ducky” antenna allows line-of-sight (LOS) ranges of up to 1km, with performance in demanding conditions superior to cheap classic individual 433.92MHz transmitter/receiver offerings – many of which unfortunately have insensitive receivers. Conditions in crowded Asian cities apparently favour the 433MHz UHF band for the likes of slow wireless utility data from water and electrical SUPPLIED “RUBBER DUCK” ANTENNA CON1 D9 (TO PC SERIAL PORT) 6 7 8 9 1 I/O PINS (CHANNELS) 2 3 5 10k SERIAL PROGRAMMING LEAD 22k HOPERF HM-TR UHF DATA TRANSCEIVER (TTL VERSION BEST) ANT 1 2 3 4 5 6 ON 2 1 7 IC1 3 6 PICAXE-08M 4 8 0 ENABLE CONTROL 1 5 DTX 4.5V5V SUPPLY DRX 2 330 8  ENABLE STATUS LED 4 1 Fig.1: This simple PICAXE-08M circuit gives half duplex control of the HMTR 433MHz data transceiver and has very low hibernation current. siliconchip.com.au meters. Microwave level 2.4GHz data links do not have the necessary punchthrough for numerous obstacles and so quickly suffer attenuation. We focused on the more versatile RS232 versions in the initial SILICON CHIP article but this month the “barebones” TTL transceiver types will be considered. These TTL versions offer very low (µA level) supply current “sleep” benefits and may also be slightly cheaper, as a MAX232 IC is not fitted to them. However, even before “on-air” data transceiver use, initial set-up configuration of these HM-TR/TTL units requires logic level conversion and inversion. Although still referred to as TTL (Transistor Transistor Logic), modern low-power consumption circuitry is now largely CMOS-based and operates in the logic range of 0V to +5V, with increasingly +3.3V or even lower values emerging. Classic RS-232 signals use negative voltages (as great as -15V) to represent a logic high, with logic lows covering a range to perhaps +15V. However, many laptops, especially when battery operated, have much lower serial voltages. In contrast, TTL assigns 0 to ~1V as logic low and signals ~2-5V as a high. True RS232 signal levels are thus far too great for TTL electronics and the April 2009  85 Transmitter (TX) frequency deviation and receiver (RX) bandwidths may especially be worth investigating – narrow TX and wide RX bandwidths have shown merit. Power level attenuations (PA) however may be academic, as at only 5mW the maximum TX output is hardly going to burn holes in the ether! Although data can be fed at a standard PICAXE 2400 bps, reducing the “on air” data transmission rates may also improve communications under noisy conditions. The modules transparently handle any speed conversions but buffering issues (just 32 bytes) may arise in some configurations. EXPERIMENT! Application Solderless prototyping (with the PICAXE-08M in its now standard breadboard layout) suits HM-TR evaluation. Add-on transducers, such as a DS18B20 or LDR, can easily be monitored as well. Two identical set-ups are needed for halfduplex operation. “high” negative RS232 voltage can’t be handled at all. Consequently, TTL serial data requires logic level conversions when presented to an RS232 interface and lows and highs also must be inverted, meaning logic 1 becomes 0 and vice versa. RS232-TTL level converting circuits abound, with TI/Maxim’s purposebuilt MAX232 16-pin dual driver/ receiver IC long recognised as the standard approach (see Fig.2). However, this high-performance IC can be an overkill for pedestrian needs such as ours, especially since we’re only occasionally dealing with a handful of settings at 9600 bps. As only half the MAX232 is needed for the HM-TR/TTL set-up, Maxim’s 8-pin DS275 line-powered RS232 transceiver IC may appeal instead. This derives power from the data line itself and provides a lower cost and extremely low-power serial port interface. Of course, such specialised ICs are often just the thing that your stockist will be fresh out of when you want one! Rest easy: numerous discrete conversion “poor man’s” workarounds have evolved, typically using NPN/ PNP transistors or 2N7000 N-FETs. The simple 2 x NPN discrete approach 86  Silicon Chip suggested by a fellow Kiwi has shown itself to be very effective and should appeal to those on skinflint budgets (see Fig.3). Inverting the logic sign can be easily handled during later PICAXE HopeRF TTL communications with T2400 “true” style signals (which idle high), rather than N2400 “inverted” serial. PICAXE serial code will then be in the form SEROUT 2,T2400,b0. Because set-up of the TTL HM-TR’s may be just an infrequent need, it’s suggested that a simple dedicated programming breadboard be used. Final RF PC board circuitry can have a 6-pin in-line socket fitted for the HMTR, allowing the data transceiver to be lifted out and configured externally on this breadboard as needed. Such a versatile approach additionally allows use of new software that’s on HopeRF’s menu. The HM-TR setup program (recently upgraded to Ver 1.1 and now featuring English as the default language), can be downloaded from their website www.hoperf.com/rf_fsk.asp Aside from occasional reports of these HM-TR modules resetting themselves (perhaps due to power supply removal during data handling) and thus needing reprogramming anyway, numerous “cut and try” transceiver set-up tweaks are available. Naturally these TTL units could be just used as a convenient “one stop” package for either simple data transmission or reception but their unified capabilities are better suited for something more demanding than such simplex work! Two transceiver units set up identically can enter into a half duplex relationship, much in the classic two-way radio, one-at-a-time style of “Hello 1 this is 2, can you hear me, over”. Abundant scope exists for considerable half-duplex tinkering of course, just as in the radio analogy where issues such as band watching, time scheduling, power supply drain, interference and simultaneous use of the channel may arise. The introductory example shown here, using a popular high-level PIC­ AXE-08M microcontroller, involves sending a simple transmitter beacon, composed of the usual SEROUT ASCII “U” (10101010) wake-up and a qualifier (“ttl”). When the PICAXE controlled receiver awakens and receives this, an acknowledgement is sent in return. At this point, the units swap roles, with the original transmitter (and PICAXE) then hibernating at µA level currents. It’s quite entertaining to watch the units talking to each other “ping pong” style like this but serious data (such as temperatures from a DS18B20) could instead be sent and verified. As the educational PICAXEs have a non-timed-out SERIN command, the units could hang up awaiting serial data. A simple pre-data alert has been instigated with the PULSIN command, siliconchip.com.au as this pulse-measuring command usefully does time out. In the code example shown, the duration is of trivial interest, as it’s the complete absence of any pulse that’s being used to cycle the beacon loop. Only when something is detected does the program move to SERIN data reception. Naturally, the approach is not foolproof as it stands, since 433MHz channel noise may be interpreted as a data signal. Scope may exist to define the PULSIN variables exactly for the nature of the data. Both units by chance may just fall into SERIN at the same moment, perhaps if one is moving, thus uselessly awaiting signals from each other as well. Discharging a supply capacitor resistor combination, so that a PICAXE reset eventually occurs, may help break out of this. A 1µF capacitor and 1MΩ resistor have a time constant (CR) of 1s, so after five time constants (5s) the capacitor will be virtually discharged – this is explored in a case study. As well as such explorations, readers are encouraged to modify the example with suitable SLEEP and PAUSE commands, in a quest to perhaps minimise supply current drain. The exact approach depends on 16 1 F 2 4 1 F D9 SERIAL TO PC RUNNING HOPE-RF HM-TR SETUP PROGRAM 9 8 7 6 1 2 3 4 C1+ C1– V2+ MAX232 5 RS-232 + V+ V– C2– 1 3 6 4.5V --5V SUPPLY 13 12 14 11 7 10 DTX 9 DRX TTL CMOS 8 5 ON 1 2 3 4 5 6 1 F 15 Fig.2: initial TTL transceiver set-up requires logic level conversion, readily handled by a standard MAX232. The normal PICAXE 3-wire programming lead can be used. Fig.3: TTL-RS232 level conversion/ inversion can also be simply achieved with two NPN transistors such as BC547s. Resistor values are not critical, with typical PICAXE “junk box” values just used here. Refer to the resource website 330 for a breadboard layout. SUPPLIED “RUBBER DUCK” ANTENNA ON HOPE-RF HM-TR ANT UHF DATA TRANSCEIVER TTL VERSION (NO MAX-232) 1 2 3 4 5 6 4.5V CON1 D9 (TO PC SERIAL PORT) 330 10k B GP NPN TRANSISTORS HopeRF’s upgraded set-up utility now has English default and a progress panel. Serial at 2400,8,N,1 with narrow TX deviation and wide RX bandwidth was used but experimentation is encouraged! Slower “on air” data rates may give greater range. siliconchip.com.au ANT HOPERF HM-TR UHF DATA TRANSCEIVER (TTL VERSION - NO MAX232) 1 F C C E E 1 2 3 B 10k 4 5 9 8 7 6 SERIAL PROGRAMMING LEAD the application, as a battery-powered receiver could be hibernating for many hours, while a mains-powered transmitter (with no battery concerns and drawing ~30mA) could be sending beacons frequently. Low duty cycles are typical with wireless telemetry in fact, as temperatures, humidity data or water levels may only change slowly. Perhaps data may even be stored in non-volatile memory for “store and forward” bulk sending when convenient. In such a case, receiver batteries may last years (approximating shelf life) or a simple solar panel energiser SC could be used. Resources, code and case studies are hosted at www.picaxe.orconhosting. net.nz/hoperf.htm April 2009  87