Wireless communication using XRF modules

I have been working on a power and energy monitor which has a remote display. It would be best if there were no wires between the monitor and the display.

I wanted to use my pedalog as the basis of this system but I also wanted to keep the development time down to a minimum.

I have been using the Xino (an Arduino clone) from Ciseco and I noticed that they also supply a wireless communications module, the XRF. This is a very reasonably priced unit which is compatible with the ubiquitous Xigbee connections but at a better price and with a much longer range (300+ meters) due to its lower frequency.

My first blog post about this project starts with the classic “Hello World” example. Starting with a cup of coffee, I had got these units talking to each other before the coffee was cool enough to drink. Here is how I did it.

For wireless communications two of these XRF modules are required (one to shout and the other to listen).

The main plan was to have a Xino connected to the XRF and shouting (I mean transmitting…) “Hello World”. The other XRF module would be connected via my FTDI USB/TTL cable which could then be read by a serial monitor on my computer.

The XRF modules transmit and receive serial data at 9600 baud with no parity bits. They are based upon a Texas Instruments CC1110 microprocessor.

First thing was to program a Xino to send serial data saying “Hello World”. This was not too complex and I uploaded this sketch to the Xino:

void setup()
void loop()
Serial.print(“Hello World!”) ;

This sends the message every second (=1000mS). I then plugged the XRF into the serial connection of the Xino (into the Rx Tx PWR GND RST connections) using the XRF breakout board.The XRF module works at 3.3V rather than 5V, hence I had to be careful about this. I rigged up the Xino with a 3.3V power supply and left it to shout “Hello World”.

The next part was to use and XRF as a receiver. To do this I used my FTDI USB to TTL converter. Please see this blog post about the wiring diagram for the 6 wire to 5 wire converter. I measured the voltage on the power wire and it read 5V (although I think it is a 3v3 converter), so I also included a 3.3V regulator to ensure only 3.3V goes to the XRF. This might not be needed. The Tx and the Rx pins need to be swapped as the XRF is receiving the data transmitted from the other XRF. A wiring diagram is shown here:

I used the serial monitor from the Arduino IDE to have a look at what is being received on the XRF and lo a behold we see “Hello World!” coming through every second.

Please have a look at these pages for more information about the XRF and the Xino.

The next part of this project is to get my pedalog (which is based upon a PIC microprocessor) to transmit the power and energy data. I will then program a Xino to receive the data and display it.

Update 17/4/14:

I’ve been sorting out a radio link for the new version of the pedalog (based upon the Arduino IDE and ATMEGA328 microcontroller).

I use a baud rate of 115200 to send data. The XRF modules are configured by default to run at 9600 baud. To change this I had some trouble (probably because I was using a Windows machine). In the end I used the following programs and data:

I use CoolTerm as a serial port monitor (I tried three other serial terminal monitors and they did not work). Information & download  is available here.

I followed these instructions to put the XRF into command mode.

The final list of commands was: Put the device into command mode (+++), change the baud rate(ATBD 1C200 <CR>), write the changes to flash (ATWR <CR>), apply the changes (ATAC<CR>), where <CR> is the carriage return character (sometimes referred to a , 13 decimal or 0d hex in the ASCII code table).

As I am changing the baud rate the terminal loses connection when the baud rate changes are applied. You need to change the baud rate to the new speed (in this case 115200) get it talking again.

This is mainly added here for my information in the future.

Leave a Reply

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