Wednesday, April 17, 2013

Zigbee for C#

Utilizing the setup I have in the Wireless/Zigbee for PIC Micros, I just needed an USB-UART interface to make a Zigbee adapter for the PC. FDTI's USB-Serial IC FT232R has been my favorite for sometime for the serial interface for PICs. And that in fact completes the hardware setup of my USB-Zigbee dongle: a PIC18F26K20, MRF24J40MA and FT232R.

The USB can easily power this micro and radio.

On the firmware side, we can take several approaches to support PC side (a C#, C++ or any application) to send message to and receive message from a Zigbee network. One good approach is to make the RF layer transparent so that PC side using the dongle doesn't have to think about the RF network. It'll simply send message to UART and same message (maintaining the baud rate) will be delivered to the target node. It'll be a good abstraction of the physical RF network.

However, that approach will be a future blog post and for now I'm using a much simpler implementation where PC sends predefined 'commands' with parameters to the dongle and the dongle processes them. Purely for an example, PC can send "light1 on" to the dongle (which is more like a Zigbee gateway device in this case) and dongle will send message to "light1" device to turn it on.

Next week, I'll show how this hardware setup can be used to control devices, sensors or robots wirelessly from a PC or even the internet. By the way, a cool robot is coming up later this month! :)

No comments:

Post a Comment