Feedback!

XBEE Wireless Heart Matrix

Views: 3447 Difficulty: 3 Status: Complete
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 Heart Matrix arduino library and the msTimer2 library, both of which you can download here, at the basic Heart Matrix Tutorial.
/* LucidTronix write messages from
 * the serial port on the Heart Matrix.
 * For instructions details and schematic
 * http://www.lucidtronix.com/tutorials/32
 * If debug is true outputs whatever was received 
 * On serial1 to the standard USB serial. 
 */
 
#include <MsTimer2.h>
#include <HeartMatrix.h>

String message = " Hi  ";
bool debug = true;

HeartMatrix hm = HeartMatrix(5,6,7); // dataPin is on 5, Latch is on 6, and clock is on 7

void displayer2(){  
  hm.displayer();
}

void setup()
{
   if(debug) Serial.begin(9600); // initialize Serial
   Serial1.begin(9600);    	 // initialize Serial1
   MsTimer2::set(1,displayer2); 
   MsTimer2::start(); 
   hm.set_message(" Hello I'm the Heart Matrix from LucidTroniX! ");
}

void loop() {
   hm.on();    
   while (Serial1.available() ){
     char c = Serial1.read();
     if (c == '/') message = "";
     else {
       String s = String(c);
       message += s;
       hm.set_message(message);
     }
     if(debug){
       Serial.print("got the letter:");
       Serial.println(c);
     }
  } 
}

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 MCP79410 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...
Standalone programmable Heart-Shaped LED display....
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....
XBEE radio modules, force-sensitive resistors, and vibration motors allow you to give massages over r...