Feedback!

XBEE Wireless Heart Matrix

Views: 1964 Difficulty: 3 Status: Development
Heart_xbee_white

Control the Heart Matrix LED display wirelessly, using XBEE radio modules.

We show how to control the Heart Matrix LED display wirelessly using XBEE radio modules and our 5V XBEE breakout board. Don't have a Heart Matrix? Don't worry, you can follow this tutorial even if you are using another XBEE breakout board, and/or a different display. What is the Heart Matrix you ask? Check out the original tutorial! Learn more about XBEEs here. We use the simplest Serial port functionality of the XBEE running at 9600 bps. This is the factory setting for most XBEEs so no configuration should be necessary. We hook up the TX pin of the XBEE to the RX pin of the Arduino (pin 0) and the RX XBEE pin to the Arduino's TX pin (pin 1). Now when we use the Serial library we will be writing to and reading from the XBEE module. Grab the code below!

XBEE and our Arduino Clone Wireless Heart Matrix Control

Heart_xbee_white
Here we have the XBEE plugged into one of our Arduino clones, which is also driving the Heart Matrix.

Wireless Heart Matrix with XBEE

Combining our 5v XBEE breakout board, and our Heart Matrix LED Display, you can send messages wirelessly over the serial port. You can send them from the Arduino Serial port window, or from any program that can write to the serial port, like in our tweetheart tutorial where we use Processing to send tweets to the Heart Matrix.

Arduino Code To Read Text From The XBEE on the Serial Port

This code displays Hi at startup. If it gets a message over the serial port it will append the characters to message string and display them on the Heart Matrix. If it receives an 8 (0x08) [the ascii delete control character] the message variable is set to the empty string. You will need the FrequencyTimer2 library and our Heart Matrix arduino library which you can download here, at the original Heart Matrix Tutorial.
/* LucidTronix write messages from
 * the serial port on the Heart Matrix.
 * For instructions details and schematic, See:
 * http://www.lucidtronix.com/tutorials/18
 * For details on connecting with XBEE, See:
 * http://www.lucidtronix.com/tutorials/33
 * Connect the data, latch, and clock pins
 * to the corresponding pins on the heart matrix
 */
#include <FrequencyTimer2.h>
#include <HeartMatrix.h>
String message = " Hi ";
// dataIn is on 5, Latch is on 6, and Clock is on 7
HeartMatrix hm = HeartMatrix(5,6,7);
void displayer2(){  
  hm.displayer();
}
void setup() {
   FrequencyTimer2::disable();
   // Set refresh rate (interrupt timeout period)
   // if things break try making this number bigger
   FrequencyTimer2::setPeriod(2000);
    // Set interrupt routine to be called
   FrequencyTimer2::setOnOverflow(displayer2); 
   hm.set_message(message);
   Serial.begin(9600);
}
void loop() {
   hm.on();    
   while (Serial.available() ){
     char c = Serial.read();
     if (c == 8) message = "";
     else {
       String s = String(c);
       message += s;
       hm.set_message(message);
     }
  } 
}

Parts

Title Description # Cost Link Picture
Heart Matrix Kit The heart matrix kit. Shift register based wearable heart-shaped LED display. 1 $17.95 Link Heart_matrix_baggy
XBEE MODULE ZIGBEE W/WIRED ANT 2.4GHz 2.1 V ~ 3.6 V 38mA -96dBm 250kbps Value: 2.1 V ~ 3.6 V 1 $17.0 Link Xb24-z7wit-004
Permalink: http://lucidtronix.com/tutorials/33
Connecting the DS1307 real-time clock chip and our Heart Matrix you can show the time with love....
Combine an electret microphone, Arduino and a heart matrix for a sound-sensitive wearable device....
Two LED matrices give 70 LEDs to light up a necklace with messages....
The heartduino is a heart-shaped arduino clone complete with onboard sensors and a 70 pixel LED matri...
Wearable digital compass displays the direction in green LEDs....
This circuit lets you talk to an XBEE serial port with 5V power and just two signal lines: RX and TX....
Play pong on a little LCD screen with two big joysticks....
Rainbow flower necklace using the TLC5940....