Research: XBee and Arduino

Posted on June 20, 2011

0


In the next weeks I will start experimenting with XBee and Arduino, to do some basic Domotica things.

Hardware Setup

  1. Base Station – The Base Station is a below 200 euro Netbook in low power mode, with the screen switched off. Connected to one of the USB ports is a XBee mudule
  2. XBee / Arduino module – Using serial communication between the two and running some of the shelf library to establish communication between the two

Devision of Roles

  1. XBee module – The XBee module will:
    1. Read analog sensors
    2. Check states on switches
    3. Send instructions to the Arduino module
    4. Manipulate analog and digital devices
  2. Arduino – Will:
    1. Receive instructions from XBee
    2. Report its state to XBee
    3. Do process intensive stuff that can be done locally. Like:
      1. Send a constant pulse-modulated signal to color-leds, to allow these leds to show any possible color
      2. Change state between one to another – For instance – make a transition on a dimmable light from one level of brightness to another

Libraries

I found two libraries by Andrew Rapp that might cover the first needs. As they use the RX/TX ports of the Arduino and XBee module, these libraries are efficient on port-use, but (with 9600 baud transfer speed) might not suffice for later needs.
  1. xbee-arduino – Is [quote:] an Arduino library for communicating with XBees in API mode, with support for both Series 1 (802.15.4) and Series 2 (ZB Pro/ZNet).
  2. xbee-api – Is [quote:]  a Java API for communication with XBee/XBee-Pro series 1 (802.15.4) and series 2 (ZNet 2.5 and ZB/ZigBee Pro) OEM RF Modules, in API mode.

Setup: Java, HotForestGreen, Mediators, Virtual Objects and Remote Objects

The libraries will be used as the communication layer between a Mediator that represents a specific solution and the actual hardware that makes that solution real.

As the XBee API offered is in Java, the XBee/Arduino/Real Objects Mediators created with this library will be in Java as well.

Using the HotForestGreen Java Framework, they will connect to a HotForestGreen Server and offer Virtual Objects (representing the real objects in a space) to be used anywhere else in the Application Cluster.

The main goal is to create simple to use objects that can be manipulated from any machine connected to the Application Cluster these Virtual Objects are part of.

Brief explanation of terms

  1. Mediators – Are software solutions which make it possible for two normally incompatible solutions to communicate to each other. A Mediator can mediate between software and hardware, offering the software a Virtual Object representing the Actual Object and deals with all protocols to make communication from Software to the Real Object and back seem immediate.
  2. Virtual Objects – Virtual Objects are Mediators, with a specific purpose and a very specific interface for a very specific set of solutions. They represent a Real Object and deals with the translation of actions and data between the Software using the Virtual Object and the Real Object you want to use in your solution.
  3. Real Objects – Real Objects can be Software or Hardware based Objects. They are the actual components doing the actual work.
  4. Remote Objects – Used in HotForestGreen Application Clusters. Represent the Virtual Objects on other computers or in other applications connected to our provider. The Remote Object in this case, represents the Virtual Object. Instead of dealing with complex instructions, the Remote Objects simply offers an interface over the Application Cluster to the Virtual Object and via the Virtual Object to the Real Object
  5. HotForestGreen Application Clusters – Are clusters of Distributed Software communicating over a (local) network to perform specific tasks. Application Clusters can include:
    1. Remote controls – Running on a SmartPhone, with which you can temperature or change light settings in a room and read the state of that room
    2. Local Smartness – Being very specific applications running in a room or a specific location and dealing with specific tasks like translating the state of a Virtual Object to the state of a Real Object and vice versa.
Advertisements
Posted in: Uncategorized