Radio Frequency Beacon Finder Using Atmel Mega32

This project is a radio frequency receiver that will help the user the trace the direction and distance of transmitter beacon(s) operating at 433MHz frequency.
Radio Frequency Beacon Finder Using Atmel Mega32
In this ECE 476 final project, we have built a radio frequency receiver unit with an LCD screen that will display information about the RF signals that it is picking up in the vicinity: beacon ID, packet loss from a particular beacon, and the overall signal strength within the vicinity. All of which are useful information to help guide the user to the location of the beacons. The user will be able to determine the direction of the beacons by comparing the signal strength as he or she sweeps the directional Yagi beam antenna.
Eric Yu (eky2)
Eric Chin-Hung Chen (cc459)

High Level Design

Project idea inspiration

We got our inspirations for this project idea from one of the group members – Eric Yu – who has the extremely sloppy habit of leaving and losing his personal belongings on a regular basis. We thought that it would be a very good idea if there is a device that will be able to display the whereabouts of small attachable radio frequency tags or beacons on his personal belongings. Ideally, the device will be able to track multiple beacons, and display direction and distance of each beacon relative to current position of the receiver. As we will find out later, there are many functions which we will have to trade-off due to fundamental hardware and theoretical limitations.

Background

An antenna is a piece of wire that carries an alternating current. The alternating current generates an electromagnetic field which varies along with the current. Another wire of similar length at a distance away may be induced by this electromagnetic field and a copy of the current would run in the wire, but weaker. This is the theory of radio frequency communication.
There are many different ways of making antennas, and antennas of different shapes respond differently to radio signals – namely, their radiation pattern is different. The simplest of all antennas, the whip antenna, is just a piece of wire of a particular length. This length is specific to the frequency of that the radio wave operating in:

(Source: Antennas for Low Power Applications, Kent Smith, RFM Corp.)

The whip antenna has a radiation pattern like the following:

From the radiation pattern, we can see that the whip antenna has almost equal gain in all directions. This means that it responds equally well to radio waves from all directions.
Another antenna design that is of particular interest to our project is the Yagi-Uda directional beam antenna. A directional beam antenna means that it has particularly high gain in response to radio waves from a particular direction, much like the following radiation pattern:

A Yagi-Uda antenna has three type of antenna elements: reflector element, driven element, and the direct elements. The driven element is the one that is connected to the receiver module. The reflector element is the lone one that is the most distant from the driven element, and director elements are on the other side of the driven element, each shorter and closer to the element preceding it.
There are many more parameters to designing a Yagi-Uda antenna, such as rod diameter, number of driven elements, etc. Free applications are available on the web to calculate the dimensions of a Yagi antenna, such as the Quickyagi modeling
software from WA7RAI. However, a quick formula is available:
Reflector length: 0.495 * wavelength
Driven length: 0.473 * wavelength
Director 1: 0.440 * wavelength
Director 2: 0.435 * wavelength
Director 3: 0.430 * wavelength
Director 4: 0.423 * wavelength
While the spacing can be calculated by this:
Reflector to Driven: 0.125 * wavelength
Driven to Director 1: 0.125 * wavelength
Director 1 to Director 2: 0.250 * wavelength
Director 2 to Director 3: 0.250 * wavelength
Director 3 to Director 4: 0.250 * wavelength

Hardware and Software Trade-offs

During the course of our project, there were many design considerations and especially hardware-software tradeoffs that affected the type of technology we used. Our project proposal underwent several evolutions as a result of trying to meet these limitations.
Initially, we wanted to incorporate commercially available RFID tags for our beacons. For the purpose of increased distance up to several hundred feet, these tags would be active RFID tags. Active RFID tags are different from conventional passive RFID tags because they actually contain a built-in power source to help amplify their signal across long distances. This would have the advantage in that we would not have to develop the RF tags. Commercially available tags are also extremely small to begin with and would fir our initial idea of attachable tags on personal items better.
Unfortunately, this was not implemented because we realized the difficulty in decoding and accessing these tags. The tags themselves are not encoded to a standard that is readily accessible and attempts in doing so may turn out to be time consuming and not worth the effort. Secondly, active RFID tags are extremely expensive and can cost up to $20 per tag. When taking our purposes into consideration – tracking down RF beacons – we decided that a simple RF transmitter using the Radiotronix RCT-433 module would be a better fit for our project. These transmitters also could not be as small as the TFID tags. In the end, we had to sacrifice having readily available and miniature RFID tags for ease of development and lower costs.
The second trade-off we encountered was in designing our software. This trade-off fundamentally changed our project and redefined what we could achieve with existing technology on hand. One of the main draws of our initial project proposal was that we would be able to estimate the distance and direction of the RF beacons through calculation involving time-of-flight. Our initially plan involved two RF receivers placed at each end of the receiver module. By measuring the time it took the signal to travel from the beacon to each of the receiver antenna, we could extract information on how far away the beacon is. Furthermore, we could also theoretically derive the relative direction of the beacon by comparing the time-of-travel (thus the distance) at the two receiver antennas and using triangulation. Ideally, these could have all been easily implemented, but we came to the realization that at such small distances, the time of flight would be at the scale of nano-seconds and very easily influenced by error and noise. It is not a degree of accuracy that can be processed by the cheap ATMEGA-32. This is even more true for estimating the direction because the difference in the time-of-flight between the two antennas would be miniscule and almost impossible to calculate accurately for our system.
We would choose to implement the time-of-flight with triangulation idea next time if better hardware were available to us. But at the present stage, we have to settle for analyzing relative signal strength of all RF signals operating at 433MHz within a proximity to the RF receiver station. This would at least give us and the user an idea about where the beacon is by heading towards the direction of greater signal strength according to the receiver. To help achieve this, we have selected the Yagi-Uda directional beam antenna design as indicated in previous sections.

Technology Standards

The technology standard we have to consider in our project is the FCC standards and regulations regarding wireless and radio frequency devices. We have to read the FCC regulations carefully to make sure that our project does not violate federal laws regarding this matter.

Software and Hardware Implementation

Software |Hardware

Software Design

Radio Frequency Transmissions

For the transmission and receiving of the radio frequency packets, we used Meghan Desai’s “Wireless Rx/Tx Protocol,” which is available here. During transmission, we do not care so much for the actual content of transmission because we are more interested in how efficient the content is transmitted as a measure of signal strength. The transmission side would assume a pre-set transmitter ID (Default: 9) and send packets of length 1 at regular intervals. The packet content is simple counting up numerically from 1 to 255: the range of a char variable.

Measurements

Simple polling was activated on the receiver side’s micro-controller chip for the analog-to-digital conversion operations. The ADMUX was set to 01100000 to activate the A/D converter and use the internal 5V as its reference voltage. At the input Pin A.0 is the raw analog output from the RCR-433 receiver module. However, the signal strength would not be able to distinguish between signals coming from our own beacon and signals from other systems operating at the same frequency. The converted value of the analog antenna signal is displayed onto the LCD display.
The software also tracks the rate of packet loss from a specific RF beacon. This is achieved by comparing the counting-up value in the data payload of each packet transmitted. By comparing a packet’s number and the number of the previous packet received, we can determine how many packets were lost in the process between this transmission and the one before it. Our device is programmed to ignore any packets with length longer than 1, thus filtering out a good fraction of outside interference. This is based on the principle that packets of length 1 are quite useless for other applications so only beacons belonging to our system would have such packet length.

User Interface

A simple user interface involving a 16×4 LCD display will display useful information regarding signals it is receiving. It will always display “Beacon detected:” When the microcontroller determines that it has not detected any beacon it is responsible for (outside interference in the same frequency is ignored), it will display “Not found” If a beacon it is responsible for is in close vicinity and successfully transmits one packet free of data corruption, it will display the ID of that beacon. In line three, it will display information regarding packet loss.
The user can use the hexadecimal keypad and press A at any time to modify the beacon that the device is tracking. Valid beacon IDs are from 0 to 9.
“Not tracked ID” is displayed if the device detects a great signal presence (above 190) to warrant the existence of a signal nearby, but the decoded ID does not fit the beacon that is being tracked. Another case when “Not tracked ID” is displayed is when the device fails to decode the ID regardless of which ID it is.
Once the signal strength falls beneath a set level of 160, the microcontroller will determine the beacon has left the proximity or has been turned off, and the display will revert back to “None…”

Hardware Design

Antenna

Using the whip antenna equation mentioned previously in the high level design section, we can calculate that our whip antenna should be around 18.3 cm long. We cut out a length of wire that is this long and attached it to our receiver module.
Radio Frequency Beacon Finder Using Atmel Mega32 Schemetic
For the Yagi antenna, following the formula mentioned in the previous section will give us the following dimensions for a 6-element antenna:
Lengths:
Reflector = 34.29cm
Driven = 32.7 cm
Director 1 = 30.5cm
Director 2 = 30.16cm
Director 3 = 29.85cm
Director 4 = 29.3cm
Separation:
Reflector to Driven = 8.6cm
Driven to Director 1 = 8.6cm
Director 1 to Director 2 = 17.1cm
Director 2 to Director 3 = 17.1cm
Director 3 to Director 4 = 17.1cm
Fortunately, Dr. Bruce Land already has a Yagi antenna which fits the above description that is he is willing to lend to our group (for this project only) at no cost. The antenna is to be returned to him at the end of the project.

Parts List:

Parts name Source Cost
ATMega32-16PU Atmel (via Bruce Land) $8 * 2 = $16
Small solder board Bruce Land $1 * 2 = $2
9V Battery Best Buy $2 * 2 = $4
Proto-board Bruce Land $5 * 2 = $10
RCR-433 Receiver Radiotronix (via Bruce Land) $4 * 2 = $8
RCT-433 Transmitter Radiotronix (via Bruce Land) $4
LCD Bruce Land $
40-pin DIP Bruce Land $0.5 * 2 = $1
Antenna Borrowed from Bruce Land $0
Keypad Bruce Land $6
Wire, capacitors, misc electronics Bruce Land $0

Total = $63
For more detail: Radio Frequency Beacon Finder Using Atmel Mega32


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top