Z-Wave Developers Journey Part 8

Antennas for Z-Wave

This is an abbreviated version of the full blog on the Z-Wave Alliance website.

Introduction

The antenna is the most important element of a wireless IoT product. A well designed and tuned antenna means the product “just works” in most customers’ home. A poorly designed antenna that has not been tuned will result in one-star reviews and quickly get on the “products to avoid list”. Fortunately, there are a lot of resources to help engineer an antenna that fits the needs of your product. This post goes over the many antenna options and some of the best practices to get the best RF performance.

Hub Antennas are Critical

Early in my Z-Wave consulting career I assisted a company who had recently added Z-Wave to their Smart Home controller using a plug-in expansion board. The tiny board with a 500 series Z-Wave chip had a 20-pin header to the motherboard. The problem with this plug-in board was that the antenna was positioned in the center of the 8×6 inch motherboard. The antenna was also just a simple 7 mil trace around the edge of the PCB with the ground plane just a couple of millimeters away and had no impedance matching circuitry. This was about as bad an antenna as I have seen. Their customers complained the controller had only about 10 feet of RF range which I quickly confirmed. The CEO of the company stated that the RF range didn’t matter since Z-Wave is a mesh so it will find a route to all the other devices in the home. While the mesh will help, it does mean that at least one device with a decent antenna was required to be placed next to the controller. The poor range meant every command had to be repeated, resulting in latency and excess Z-Wave traffic that tended to clog the network when many commands were sent in sequence (for example at sunrise or sunset). My solution was to flip the PCB around and place the antenna against the edge of the plastic enclosure and increase the size of the ground plane of the plug-in board. Once I tuned the PCB antenna, the RF range met the Z-Wave certification requirement of 40 meters and customer complaints dropped dramatically. Unfortunately, the poor RF range gave Z-Wave a bad reputation in the vendors community. The problem was their poor antenna design and not the Z-Wave protocol itself. Key take away: Always design the very best antenna possible especially when designing a controller. See the Home Assistant ZWA-2 for the best antenna design I have seen.

Antenna Types

I often quote that even a paperclip soldered to the pin of a Z-Wave module will meet certification requirements of 100 meters of RF range. While I haven’t actually tested this, I have worked on so many antennas that it does seem it will work. There are many types of antennas and below is just a partial list. Do you have a unique antenna? I’d like to see it! Send me an email with a photo and how far it can reach.

PCB

PCB antennas are the most common Z-Wave antenna due to their low cost and simple design. All you need is a little extra PCB space and to follow a few simple design rules. PCB antennas include simple L, meander, inverted F, fractal and more than I can possibly list here.

The early Zensys developers kit recommended a simple L shaped antenna shown here from the datasheet. This antenna works well and easily achieves the required performance for Z-Wave certification. The one challenge with all PCB antennas is that the radiation pattern is not uniform and often has nulls and gain in certain orientations. Remember that the regulatory requirements will identify the orientation with the strongest signal. If that orientation has antenna gain, you may have to reduce the transmit power to stay under the regulatory requirements. Lowering the transmit power will reduce the RF range in all other directions. Z-Wave certification will check the RF range in all 6 orientations. You may need to redesign your PCB antenna to make the radiation pattern more uniform. Antenna redesign can be a time consuming and expensive process.

The Inverted F antenna is popular with 2.4GHz antennas as it has good performance and is small. But in the 900MHz band the antenna is large as shown here. If you have PCB real estate, it can be a good option. The thing I have a hard time wrapping my head around is that the antenna is connected directly to ground. Seems like that would short it out, but instead it anchors the resonant standing wave so it works but needs to be carefully tuned.

Meander antennas are commonly used in space constrained applications. A meander antenna simply folds the wire back and forth a number of times to compress the PCB space required. The Silicon Labs BRD4205 has an example meander PCB antenna which is selectable by installing a 47pF capacitor and removing the one for the SMA connector.

Wire

Wire antennas fall into two broad categories: flexible and stiff. Flexible antennas as the name implies, is a simple stranded wire cut to a specific length. The wire is ideally held in a known orientation using plastic standoffs but there are many products that are stuffed into a wall box with the antenna stuffed alongside all the other wires. The problem with flexible wires is that it is impossible to account for the impedance shift due to adjacent materials. The length is also hard to consistently manage in manufacturing as even a one-millimeter variation can change the antenna performance. A simple wire is low-cost and works reasonably well especially for space constrained applications.

The second category is a stiff wire or stamped metal. The wire is typically pre-cut and bent at the factory with precision and then hand soldered in place. This results in a repeatable and predictable environment meaning it is possible to accurately tune the antenna for optimal performance. The other advantage is that the antenna is usually held vertically off the PCB ground plane yielding a better radiation pattern than a PCB antenna. The antenna can be stamped metal in any shape allowing for more flexibility in optimizing performance as shown here.

Helical

Helical antennas can be quite small but can have decent performance if properly tuned. The Z-Wave UZB USB stick controller uses a small helical antenna as shown here. The challenge with making the antenna so small is to understand that the ground plane is also part of the antenna. Thus, a tiny ground plane reduces performance. The other problem with USB sticks is that they are often plugged directly into a PC or a Raspberry Pi. A computer has many components and oscillators that generate a significant amount of RF noise. In addition, the orientation may be less than optimal. The recommendation is to put the USB stick on a USB cable of at least one foot in length. The cable isolates the USB stick from the noise from the computer and allows more optimal orientation.

Chip

I personally have not had good experience with chip antennas, but I am aware of companies that have used them successfully. Chip antennas are often the smallest antenna thus they are often used in very space constrained products. The challenge is that they are impacted by the nearby environment. The antenna must be carefully tuned with the enclosure, battery and mounting surface included in the tuning.

External

External antennas, often called whip antennas, are usually connected via an SMA or U.FL connector on the outside of the enclosure. External antennas can yield the best performance because the antenna is omnidirectional and has a donut shaped radiation pattern resulting in some gain. They are typically the most expensive option and are normally only used by the controller or by a device that needs long range. Don’t be fooled into believing the claim that the antenna is 50-ohms and “tuned” for your chosen frequency. You must still tune it. I tested all the antennas shown here and they vary widely in performance. The more expensive antennas were not the best. In fact, one of the cheaper antennas nearly matched the performance of the best antenna. However, one of the popular antennas turned out to be terrible. The Home Assistant ZWA-2 uses a giant screw-in antenna and has by the far the best RF range of any device I’ve tested.

Can One Antenna Work for All Regions?

Yes. One antenna can work for all regions – from 868MHz to 920MHz. But you need an antenna with sufficient bandwidth to do it. For optimal performance, slightly different Pi network component values are required for each end of the spectrum. The recommendation is to optimally tune the antenna for the primary target market with perhaps a shift towards a secondary market. For example, if the primary market is the US (908-920MHz) and the EU is secondary (868MHz), tune the antenna for 908MHz or slightly lower. Even if the antenna isn’t optimally tuned, it will still work if the bandwidth is wide enough.

Antenna Best Practices

  • No metal within 6mm of the antenna
    • Ground plane, batteries, enclosure
  • Impedance matched and tuned for target market with enclosure
    • Including typical installation surface within 6 inches
    • VSWR below 2 at target frequency
    • Initial PCB antennas are 10% longer than calculated to ease tuning
  • Continuous ground plane(s) with array of vias
  • RF signals on a single layer and surrounded with ground vias
  • Measure the radiation pattern in all orientations
    • Prevent strong gain in one orientation resulting in failing regulatory testing

Next Steps

Part 9 of the Z-Wave Developer’s Journey discusses the regulatory process for subGHz devices in the US. I will present the tests you should perform before going to a test house and the tools you’ll need. As we continue along the Z-Wave Developer’s Journey, I welcome your comments and questions.  Please feel free to reach out to me directly via email.

Geographic Location Command Class – GPS Coordinates to the Centimeter

Z-Wavre Long Range Heat Map

First Pass is Rarely Perfect

Geographic Location Command Class was introduced around 2014 but it appears no one ever implemented it. How do I know no one implemented it you ask? Because version 1 is not particularly useful. I asked the Z-Wave Certification manager to search the certified database and no product has ever claimed support for it. The problem with V1 is that the 16-bit coordinates limit the resolution to about two kilometers. Two kilometers is sufficient to determine the time for sunrise or sunset, but not to locate a device within a home or yard. With the arrival of Z-Wave Long Range where devices could be placed in an area as large as twelve square miles, we need a way for the device to store and report its location within a few meters or less. Thus, while the first pass (version 1) has some usefulness, with new technology (ZWLR) we have new needs and thus there is a need for a new version of Geographic Location CC. Updating a command class demonstrates the living document nature of the Z-Wave specification and how you and I can add new features to the standard!

Resolution of a Location on the Earth

The circumference of the earth is about 40,075,000 meters. There are 360 degrees of longitude so each degree is 111,319 meters. The earth isn’t a perfect spheroid but for our purposes, a sphere is close enough. In embedded systems with limited resources, we need to represent the latitude/longitude with enough bits for sufficient accuracy to meet our needs. I propose a resolution of approximately one centimeter which is certainly more than enough and currently beyond the resolution of todays (but not tomorrows) low-cost GPS receivers.

The current Z-Wave Geographic Location Command Class V1 uses 1 bit for the sign, 8 bits for the Degrees and 7 bits for the Minutes. Since the 7 bits are in minutes instead of a fraction of a degree, the 7-bit value only ranges from 0-60 which means there are actually less than 6 bits of resolution. Thus, the resolution of the current V1 is 111319m/60=1.855km. Two kilometers of resolution isn’t enough to locate a device within a single Z-Wave network.

How many bits are needed for 1 centimeter resolution?

Degree Fraction BitsResolutionComments
0111,319m1 degree=111km
155,6560m
227,830m
3 … 16…Each bit doubles the resolution
170.85m
180.42m
190.21m
200.11m
210.05m
220.03m
230.01mCentimeter resolution
GPS Coordinate Degree Fraction Bits of Resolution

The proposal is to update Geographic Location CC to V2 and make the values 32-bits to achieve roughly 1 centimeter resolution. Using only fractional degrees gives more resolution with fewer bits and is easier to compute. We need 8 bits to represent Longitude from 0 to 180 plus the sign bit for a total of 9 bits. Then another 23 bits for the fraction. Version 1 has the sign bit in the Minutes field which doesn’t make for an easy number to manipulate. We have to bit-swizzle the sign and then divide minutes by 60 to get the fraction. The proposal for V2 is a simple fixed-point fraction as shown below:

Geographic Location SET

76543210
Command Class = COMMAND_CLASS_GEOGRAPHIC_LOCATION (0x8C)
Command = GEOGRAPHIC_LOCATION_SET (0x01)
Lo SignLongitude Degree Integer[7:1]
Lo[0]Long Fraction[22:16]
Longitude Fraction[15:8]
Longitude Fraction[7:0]
La SignLatitude Degree Integer[7:1]
La[0]Lat Fraction[22:16]
Latitude Fraction[15:8]
Latitude Fraction[7:0]
Altitude[23:16] MSB
Altitude[15:8]
Altitude[7:0] LSB
Geographic Location CC V2 proposal

Longitude/Latitude

Longitude and Latitude formats are the same with a sign bit, 8 bits of integer Degree and 23 bits of fraction. The values are signed Degrees which for longitude varies from -180 to +180 and for latitude varies from -90 to +90. The rest of the bits are a fraction of a degree which yields roughly centimeter resolution.

Altitude

Altitude is a twos-complement signed 24 bit integer which yields a maximum of 83km in centimeters (more than enough!) to as much as -6,000km which is the radius of the earth. Note that altitude can be negative as the altitude is relative to sea level. Most GPS receivers will provide altitude so why not include it here in the Z-Wave standard? We need altitude because ZWLR devices could be spaced out vertically as well as horizontally.

Geographic Location GET

Geographic Location GET is the same as the existing V1.

76543210
Command Class = COMMAND_CLASS_GEOGRAPHIC_LOCATION (0x8C)
Command = GEOGRAPHIC_LOCATION_Get (0x02)

Geographic Location REPORT

76543210
Command Class = COMMAND_CLASS_GEOGRAPHIC_LOCATION (0x8C)
Command = GEOGRAPHIC_LOCATION_REPORT (0x03)
Lon SignLongitude Integer[7:1]
Lon Int[0]Long Fraction[22:16]
Longitude Fraction[15:8]
Longitude Fraction[7:0]
Lat SignLatitude Integer[7:1]
Lat Int[0]Lat Fraction[22:16]
Latitude Fraction[15:8]
Latitude Fraction[7:0]
Altitude[23:16] MSB
Altitude[15:8]
Altitude[7:0] LSB
QualROAl ValidLa ValidLo Valid
REPORT is the same as SET with the additional STATUS byte

Status Byte

The additional Status byte provides additional information about the long/lat/alt values:

Qual: From the NMEA GPS Quality Indicator: GPS receivers need a minimum of four satellites to compute the location. Thus, QUAL is the number of satellites used for the most recent computation. If more than 15 satellites are used, then the value is clamped to 15. The values 0-3 are reserved for debugging.

RO: Read Only – Long/Lat/Alt are Read-Only when set to 1. Devices with GPS receivers set this bit to indicate that the values are from an on-board sensor. SET commands are ignored. Devices without a GPS receiver clear this bit to zero and will have their location set at commissioning time typically using a phone to set the GPS coordinates.

Al Valid: The Altitude value is valid when set to 1. When cleared to 0, the Altitude value is unknown and MUST be ignored.

La & Lo Valid: Each bit signifies when the Latitude and Longitude values are valid. When cleared to zero, the Latitude or Longitude MUST be ignored.

If a SET command was sent, the Longitude, Latitude and Altitude is then considered valid and is retained thru a power cycle but will be cleared if excluded or factory reset.

GPS Receiver to Geographic Location Conversion

All GPS receivers use the NMEA 0183 standard for reporting the coordinates. The string of ASCII characters for longitude and latitude is defined to be [D]DDMM.MMM[M] where D is decimal degrees and M are the miutes. The MM.MMMM value must be divided by 60 to convert minutes into fractions of a degree.

A typical NMEA sentence looks like:

$GPGGA,134658.00,5106.9792,N,11402.3003,W,2,09,1.0,1048.47,M,-16.27,M,08,AAAA*60

Text color matches the field: Latitude, Longitude, altitude – see the details via the NMEA link above.

Converting the values in Geographic Location CC to decimal is accomplished using code similar to: const longitude=payload.readInt32BE(0) / (1 << 23);

GitHub Repo

An implementation of the Geographic Location CC V2 is at: https://github.com/drzwave/GeographicLocationCC

The repository implements Geographic Location CC in an end-device such as the Z-Wave Alliance ZRAD project or on a Silicon Labs Devkit using a QWIIC I2C based GPS receiver like the M8Q from Sparkfun.

See the repo for more examples and details. The official Z-Wave Alliance specification update with GeoLocV2 is currently being reviewed and expected to be published in one of the 2025 releases.

Heat Map Examples

One of the drivers to create GeoLocV2 is to generate heat maps of the RF Range for testing Z-Wave Long Range. In previous Unplugfests we use a very subjective measurement of having an LED stop blinking when out of range. Often the LED would pause, but then start blinking again, then stop so it was difficult to determine the exact edge of RF range. With GeoLocV2 we can map the exact locations where the device is when it is able to make 100% error free, encrypted connection.

The Silicon Labs Works With 2024 conference produced a fantastic video (featuring DrZWave! – well, I have a supporting role) demonstrating GeoLocV2 in action on a motorcycle! Skip to minute 43:40 (about 3/4 of the way thru the video) to see the video.

Z-Wave Long Range demonstration video from Silicon Labs Works With 2024 using Geographic Location Version 2

Below is a heat map from a skydiving test that we will be producing a video in the near future. Z-Wave Long Range demonstrated 2.7 mile range – straight UP! A ZRAD was used as the controller running Z-Wave JS and a small Javascript program to extract the GeoLoc data from a commercial Z-Wave device using a PCB antenna stuffed inside a fanny pack of the jumper. This example demonstrates the need for the Altitude in the specification.

Below is a heat map with the color showing the transmit power needed to make an error free connection which ranges from -6dBm to +20dBm. The test took place in a residential neighborhood outside Boston Massachusetts where the ZRAD controller is in a wood frame building on the second floor and a ZRAD End Device was driven around the neighborhood reaching a general 500m and a maximum of over 1.4km. This demonstrates the dynamic power of Z-Wave Long Range where it saves battery power anywhere within 100 meters but can extend the range thru many obstacles to over a kilometer.

Be sure to attend the upcoming Z-Wave Unplugfest and Summit in Barcelona Spain in February 2025 or the one in Carlsbad CA in April to see GeoLocV2 in action.