Introduction
The objective of this post to completely describe the creation of a wireless sensor node which can be used for IoT Applications. Texas Instruments was kind enough to sponsor the parts for this build hence the entire demo is TI BOM. Additionally, the code used is also available free of cost via github.com . Lately security has become a concern for IoT in addition to the cost of the components involved and their maintenance is also an issue. If you are planing a system with lots of nodes to be deployed in an existing system or environment or if you plan to have a temporary system with sensor nodes to be deployed, wireless self powered systems are the optimum solution. The issue in making these solutions is where to start. Such a requirement pops up frequently for me where I want to deploy a sensor in a location where I cannot establish a cable connection or if I am prototyping a system where I need to monitor a quantity in real-time and log it remotely(for comparison with other such nodes). My original solution was based on XBEE's which transmit to a central BeagleBoneBlack however this becomes less and less cost effective when the deployment quantity increases. Hence I have turned to experimenting with other solutions out of which one is using the CC110L radio Chip from TI. There are cheaper basic RF Tx Rx modules available out there but they are dumb modules and cannot provide any information about the connection state nor any intelligent control over the transmitter. For this exercise I work with Anaren Modules LR09A which are part of the TI Air Booster Pack and are available relatively cheap from Element14. I will go into the details of the steps I follow to design my little wireless network. Lets go!
Topology and CC110L Dissection
One of the things that XBEEs offer is the ability to form networks where a co-ordinator xbee can act like a hub and the nodes can be used to form a mesh network. This ability is great for deployments where the network will span large distances and the gateway or controller is at one end of the installation e.g. office/building lighting. THe diagram below show this capability.
Our test setup is simpler where we need a star topology as shown below and may even contain just a single node in addition to the coordinator.
This topology takes advantage of the smart features of the CC110L. A quick look at the block diagram of the CC110L shows a packet handeler which offloads a lot of the processor responsibilities to itself. This includes Preamble detection, Sync word detection CRC checking which form the basics of a reliable communication system. These features means that the controller does not have to keep scanning the module for valid signals nor does it have to compute CRCs which will save some Lookup table space as well as time & effort. Additionally if you plan to have a small network and you can have an addressing scheme with a single byte, you can have the CC110L do that on it's own. For larger addressing space you will have to write your own layer but for my application this fits in quite nicely.
If you have an RF analyzer, you can see the following packet transmitted over the air which the micro-controller will be oblivious to anything other than the data field. This is a good thing!
I am NOT an FAE with TI hence I will skip the marketing lingo on the other features. The bottom line is that its a simple RF chip with just enough capabilities to make a simple network. The CC110L also has power down capabilities for sensor nodes that run on battery. Choose when to power the PA and disable it when not needed. There is also the ability to select a channel which means I can isolate two sub networks in the same physical space. Neat!
The only bottleneck is that the FIFO buffer is 64-Bytes which means that if I want it to send a sonnet, I will have to break it down. We'll see about that later. Right now I just need to make two device talk over the Air!
The Air Booster Pack
As always I won't try to replicate existing content and there are plenty of good reviews on the CC110Ls as well as the Anaren Air BoosterPacks. The microcontroller talks to the CC110L via SPI and there are two configurable IOs on the Chip as well. One should be used to generate an Interrupt on successful transmission or reception. The datasheet talks of the GPIO being used for serial data input but I really do not want to get into that unless absolutely necessary. Simplify things and get the job done I say. Below is the image of the Air Booster on the MSP430fr5969 LP and one on the MSP430F5529 LP.
I am still experimenting with some permutations and combinations on a better way to prototype things but right now, for this exercise I will be using these two standard Launchpads. The FR5969 is a low power LP and the 5529 is a USB LP and will be used for this exercise. The Kit contains two MSP430s preprogrammed with demo code and the Booster pack has the basic circuit layout on it. You can mount a few components and it will function without the need to purchase a LP. Cool concept and I am temped to try it myself however if I want to have sensors then I have to add connections or make a separate board anyway so this arrangement is good for demo purposes and I would rather make my own addon board... and I will... eventually.
Right now I want to get up and running as soon as possible so its use it as is for now.
The rise of Energia
The reason why AVRs are so popular is simple. Arduino! Its a IDE and language and hardware prototyping made for hobbyists in mind. The code may not be optimized and the boards may be awkwardly sized but they are easy to use and have a LAAAARGE base of libraries, demo apps and communities built around it. Hence it makes everyone want to use one. TI saw this and came up with energia which is basically their clone of the Arduino Environment. Same language and similar looking IDE but for their MSP430 and now CC3200 line of controllers. I support the Energia Project Completely because it gives me the capability to use the Launchpads in applications where the arduino doesnt fit. 3V# GPIOs and higher frequency controllers with some made for low power is what I see MSP430s as. I was initially put off by the convoluted architecture of the MSP430 but with the advent of Energia, my MSP430s became useful again. Needless to say I just avoid Code Composer for MSP430s all together because of the bas experiences I have had in the past.
This instance is no different and using the CC110L is a breeeze with Energia and there are libraries and demo code that come with the IDE itself. The same code runs on both the launchpads without me having to change anything other than the target board name and port number. How cool is that? Bravo Energia! Below are some screenshots of the IDE and demo code at work.
The easy way to setup a link
I could go in and explain the SPI interface and then the code that goes along with it, but I won't... because its not necessary. This is the reason why this writeup exists in the first place. It requires NO coding experience to get started with these modules and that is the best part. I want to showcase how easy it is to setup these modules and I hope people will actually try out these modules because these are pretty good.
Step 1.
The first step is to put the Air Booster Packs together with a Launchpad. As stated before, I have the MSP430FR5969 and the other is the MSP430F5529 each with an Air Booster. The FR5969 is programmed to be the sensor node which can measure temperature and values from a dust sensor. These are transmitted to the 5529 LP which acts like a hub and sends the data via serial connectivity to the console. The image below show my setup.
Step 2.
Get Energia and from the examples menu, find the air430boost sub menu. First we want the hub to be setup hence select the appropriate example. Image below shows a screenshot of the Menu.
Next select the board which in my case is the F5529 and click compile. Once this is done, we upload the code to the board after connecting it via USB.
Step 3.
Next we setup the node(s) and to do so we select the wireless node example as shown below.
Change the target board selection which in my case is the FR5969 and hit compile. Next select the upload after connecting the board via USB.
Step 4.
There is no step 4! You are done. It's that simple. Just power up these boards and you should be able to press a button on the node and the hub should reflect the communication.
Video Clip
Here is a short video clip of the demo in working.
Comparison
I don't have much to compare with. The XBEEs cost a little above INR 2300 which is quite expensive in my opinion but for applications where quick deployment is required, these are a slightly better option. I say slightly because the costing of so many XBEEs will accumulate and burden the project budget. Another option is the LPRC eRIC modules(Antenna Extra) cost INR1549 from element14 and even though I have not used these myself, I have heard good things about these. Lastly the Anaren CC110L modules are priced a little less than INR1650 which have the Antenna onboard are currently the modules under test here. Of the three, the Anaren modules are the only ones without a dedicated micro controller inbuilt but the cost of an additional MSP430 is not that much either.
To be continued...
I plan to continue this discussion but adding some custom code to transmit data to a console in the next part. My parts of the Power board just arrived and I wanna try and complete that part first... Stay tuned.
Top Comments