Sensor Networks using AT86RF231 (Ziggbee-ish) and Chibi comms stack

Howdy

Is anyone else interested in this, before I proceed much further?

I have built a test board and used it to successfully port and test the Freaklabs Chibi protocol stack on a Sparkcore. The reason for doing this was the idea that a Sparkcore might be used as an IP (Internet) gateway to a bunch of local, wireless low power devices, say in a sensor or control network.

The AT86RF231 chip is a 2.4GHz beast, intended for full Ziggbie (and other) systems. But there are no existing (complete) open source libraries for the rather complicated and IMHO over engineered (though very cool) Ziggbie protocol, which also requires quite a lot of RAM and other resources to implement.

The Chibi stack is simple and light on CPU and memory resources. You get error handling for free and simple send / receive functions. Data moves at about 1Mbps (or up to 2Mb, I believe) in the case of the units I have been playing with.

You can of course build your own protocols on top of Chibi, which is something I am considering, for sensor/control networks without going to full Ziggbie. Yes, it would be re-inventing the wheel – but a much smaller, easier to build and this more hobbyist accessible wheel, I think.

Chibi also supports at least a couple other radio chips, for other bands, such as 900MHz. I have not worked with those, to date.

Here’s a snapshot of my test rig …

(Oh – ignore the unrelated BT serial port board, to the left. The ribbon cable in the foreground is actually running off to a JTAG programmer.)

Getting this far was a quite lengthy and steep learning curve for me. I had never worked with 2.4GHz or such tiny little chips before.

A little history, just in case it’s of interest …

To get to this point, just as a learning exercise, I did a project where I pretty much copied the Freaklabs ChibiArduino board, with a few changes, owing to parts availability outside of Japan. That is documented on its own project site named, KiCAD-Freakduino. It’s an Arduino compatible board, with AT86RF231 2.4GHz radio on board. Here’s a picture of my board, to save clicking off-site …

This thing runs on just two AA batteries, drawing about 35mA peak transmit current (at 3V) if memory serves – all up, including the CPU at 8MHz – a lot less than a WiFi radio at 300mA+ anyway. Pretty cool stuff. There’s an onboard 2xAA battery holder on the underside of the board, like the original design by Freaklabs, which is up-converted to 5V for the Arduino compatibility aspect. That is not needed for the Sparkcore, which already runs on 3.3V, same as the radio chip.

The KiCAD-Freakduino (so named because I am not good with names and was using KiCAD EDA software at the time!) cost me enough just in parts to have simply bought several Freaklabs boards! But the point was to get experience with the little radio chip (and others) and prove to myself that I could handle everything required.

There is more to these 2.4GHz devices than first meets the eye. One has to take care to design the RF ground plane correctly, for one thing, lest crosstalk between the RF and digital data domains cause interference and reduced range, for example. Even things like the 16MHz crystal being just slightly off frequency, can have a marked effect on final performance – lowered radio range or no link at all, in one case. Fortunately, my rather humble workshop contains a budget 8 digit frequency counter!

In any case, I learned a lot of that the hard way, by doing it – three times before I was finally happy with the results and what I had learned. Actually, I was over the moon, at the time. But that has faded now. Now it all just seems, “Easy peasy!” LOL // For what it’s worth, I’m sure I would enjoy helping others achieve the same results, if you’re interested in having a go. Making your own 2.4GHz low powered digital radio transceivers is very, very cool! :smile: (Even getting to a point where one can confidently handle these tiny surface mount chips is a pretty decent thing to have under your belt, I reckon.)

So that’s the history. As far as this potential Sparkcore / Sensor Network “gateway” project (ChibiSpark Gateway?) is concerned, basically, I would prefer not to box on, working in a bubble – especially considering the possibility that someone else not yet known to me is already working on something similar. That and I am frankly not sure if I have to motivation to proceed beyond this point, if it’s only ever going to me for me and a few devices around my own home.

So there it is. Anyone else interested, at any level? Please comment. Thanks!

Gruvin.

1 Like

@gruvin, cool stuff! I agree with you that zigbee is over-engineered and expensive, at least for the mesh versions. I have been looking at another system called Flutter, especially after meeting the creator at the recent Maker Fair and seeing the hardware in action. Just thought you should know :wink:

1 Like

Absolutely! My biggest reason for posting here was to break out of my tiny little bubble. So thanks indeed.

So ... Flutter; looks like there's some new, long range, low power wireless chip out there, which I've not heard of. EDIT: They're using the Texas Instruments CC1101 (maybe upgraded to CC1200). Not heard of that chip at all. Time to go research it!

I see that Flutter operates at 915MHz. Not sure if that's legal in New Zealand, where I live. Last I checked (a few years now) the 900MHz "licence free" bands were pretty chopped up and non-standard, country to country. Hopefully, that has changed nowadays. I'll have to look into it further.

Nice also to have just learned about the Atmel ATSHA204 crypto' chip. Thank you. :smile:

The AT86RF231 chip I have been using to date (with Chibi) appears to have roughly the same range as WiFi, running barefoot. But it has support for an add-on amplifier/pre-amp. Freaklabs have a version using that.

In any case, at a claimed 10 - 40 mA current draw and over 1,000m range (frankly very hard to believe, without very high gain antennas, especially at 900MHz ... but I guess it must be true?) it may well be that whatever chip Flutter uses would be better than what I'm using presently -- if not an entire Flutter board, I guess.

My goal was (is?) to use the Sparkcore as an IP/Internet gateway for "whatever" local, low powered sensor network. At the end of the day, I don't care much what radio chip or protocol that ends up being. At just $20 a piece, it might just come down to hooking a Flutter and a Sparkcore and writing a little "gateway" code. Since that ought to very simple, it probably wouldn't justify trying to popularise some new data protocol. Each user could just roll their own, I guess.

EDIT: I see that the AT86RF212 chip (otherwise very similar to the one I'm using) includes AES-128 (at 900MHz). Interesting.

EDIT(x2): The TI CC1101chip has a maximum data rate of 600kbps. But it seems that the full range is only achieved at something more like 1,200bps (12,00 Baud). The AT86RF231 chip I am using runs at minimum (?) 1,000,000Baud (1Mbps) and is said to operate up to 2Mbps. That may explain how Flutter can get so much more range -- if they're running down around 1,200Baud. Still, such a slow speed is plenty fast enough for most simple sensor/control functions that I can think of, so long as there's not too much meshing going on, I guess. Thinking to do.

2 Likes

@gruvin, the flutter uses the CC1200. (On my phone so sorry for short response).

1 Like

If you’re looking for alternatives, check out the nRF24L01+'s. They operate in the 2.4 GHz spectrum and can be purchased pretty cheap on eBay.

Just took a look, here. The chip itself seems very similar to the Atmel part I have cut my teeth on. But as you said, there are tonnes of cheap, pre-built boards for this chip available on eBay. Very interesting. Thanks!