Connect Xbee to Lilypad Simple Board

Hi all! I've bought 2 Lilypad Simple Boards, 2 Lilypad Xbees and 2 Xbees S2 and now I see there are no RX and TX on the Simple Board. Is it possible to connect the Xbees to another PIN found on the Simple Board or do I have to get the full Lilypads? Thanks

I've bought 2 Lilypad Simple Boards

Links?

2 Lilypad Xbees

Same question.

2 Xbees S2

Why? You bought two mesh network radios for point to point use?

Is it possible to connect the Xbees to another PIN found on the Simple Board

Hard to say, without knowing what pins are on the Simple Board. But, the XBee can be connected to any two digital pins and talked to using NewSoftSerial (pre 1.0) or SoftwareSerial (1.0+).

Sorry.
Link: http://www.robotshop.com/arduino-lilypad-microcontroller-simple-board.html

Oh yes, I know! I just read now that the series 2 are more complicated.
I thought just more flexible if I want to do something else later.
You would have bought Series 1 or is there an even simpler option that
I haven’t thought of?

Can you tell me in an easy-to-understand way how to tell the lilypad
that its, say, 4 and 5, pins are now RX and TX and to use it as Xbee
connectors?
I did do my websearch and came across the new serial but after several hours
of reading some complicated stuff I decided to ask straight forward.

The objective is a interactive piece of jewellery, a brooch of some sort that
lights up an LED when the other is in range, it doesn’t matter that it exactly
measures the range, it is supposed to demonstrate the principle at first.

I built some Arduino projects with a temperature sensor that lights up
different LEDs before but that’s it with my experience.

Once I have successfully established the example of the LED 13 lighting up
from one Lilypad/ XBee to the other I will probably ask once more
for help. But if you already have an idea where I could find Code and
a tutorial for my proximity project, please quote the URL.

Thank you very much!

I thought just more flexible if I want to do something else later.

They will be usable, just not as easy to configure as the Series 1 models. The only way that they offer more flexibility is if you add a third one.

Can you tell me in an easy-to-understand way how to tell the lilypad that its, say, 4 and 5, pins are now RX and TX and to use it as Xbee connectors?

This is about as simple as it gets:

const int RXPin = 4;
const int TXPin = 5;
SoftwareSerial xbee  =SoftwareSerial(RXpin, TXpin);

The objective is a interactive piece of jewellery, a brooch of some sort that lights up an LED when the other is in range, it doesn't matter that it exactly measures the range, it is supposed to demonstrate the principle at first.

In which case, you don't even need the lilypad or a software serial port. Pin 15 on the XBee toggles when the XBee is part of a network (in range) and is steady when not.

You can use that information without the need for the radios to talk to each other at, if you keep the lilypads, to turn an LED on when the other XBee is in range and off when it is not.

Keep in mind that the range depends on your particular XBee, but can be between 100 feet and 15 miles.

Thanks PaulS. Do you recommend me maybe getting two series 1 instead? Being at the first steps I might be overwhelmed with anything more complicated. For the demonstration the distance I had in mind was a few feet to say 50 feet. Will the series 1 also be better for that or how can I make sure the proximity aspect would work?

Do you recommend me maybe getting two series 1 instead?

No, that is not necessary.

If you are going to spend additional money, Rob Faludi's book, Building Wireless Sensor Networks, will make a great addition to your library.

For the demonstration the distance I had in mind was a few feet to say 50 feet. Will the series 1 also be better for that

No, the series doesn't matter, as far as range is concerned. The power level and antenna type do matter.

how can I make sure the proximity aspect would work?

You can't really limit the range of the XBee. There is a RSSI pin (Received Signal Strength Indicator, pin 6) that can give a rough order of magnitude indication of distance. It is only a rough order since signal strength is not a linear function of distance.

I have it and I actually read the first two chapters in the book.( even if it doesn't seem like I have) I might have to alter my project to a different approach if the distance seems to vast for the proximity to be a demonstration objective. I will post again when I get stuck. For now I will connect the soft serial pin and see if I get some answer. Then I might try out a project from the book first. Thanks from England!

I tried your code for the Pin change, but I get only this error message.

sketch_may24h.cpp:4:1: error: ‘SoftwareSerial’ does not name a type

or

SoftSerial.h: No such file or directory

I am a newbie. Can you help me set up the 2 Xbees on Pin 5 and 6 of the Arduino Lilypad simple boards?

sketch_may24h.cpp:4:1: error: ‘SoftwareSerial’ does not name a type

or

SoftSerial.h: No such file or directory

If you are trying to (incorrectly) include SoftSerial.h, that would explain both messages. You need to include SoftwareSerial.h (if using 1.0).

Thanks. I tried both, I found the short version somewhere. Obviously wrong. But even with the full word Software, look at my code:

I'm going through Rob Faludi's book and put the pin redefinition you suggested in:

void setup() {                
const int RXPin = A5;
const int TXPin = A3;
SoftwareSerial xbee  =SoftwareSerial(RXpin, TXpin);
  Serial.begin(9600);
}

void loop()
{
  Serial.print('H');
  delay(1000);
  Serial.print('L');
  delay(1000);
}

It gave me back: Xbeetry.cpp: In function ‘void setup()’: Xbeetry.cpp:7:1: error: ‘SoftwareSerial’ was not declared in this scope Xbeetry.cpp:7:16: error: expected ‘;’ before ‘xbee'

Without the Software serial line, there is no error, but, does it then make the pins A5 and A3 (I had to change the places) Rx and Tx at all?

void setup() {                
const int RXPin = A5;
const int TXPin = A3;
  Serial.begin(9600);
}

void loop()
{
  Serial.print('H');
  delay(1000);
  Serial.print('L');
  delay(1000);
}

I have connected the Xbees with the so-called Lilypad Xbee, http://www.sparkfun.com/products/8937 but I might need an Xbee Adapter to access the Xbees beforehand, right? Or could I modify the Lilypad Xbee breakoutboard maybe in conjunction with the FTDI Basic from Sparkfun? http://www.sparkfun.com/products/10275 The Xbees 2 do need pairing first, right? Thanks so much for your help!

You need to include the SoftwareSerial header file, first:

include "SoftwareSerial.h"

Without the Software serial line, there is no error, but, does it then make the pins A5 and A3 (I had to change the places) Rx and Tx at all?

No.

but I might need an Xbee Adapter to access the Xbees beforehand, right?

What do you mean by "access them"? You'll need some kind of adapter so you can connect them to the PC to configure them.

The Xbees 2 do need pairing first, right?

Most definitely.

So glad you’re back!
So I ordered two Xbee Explorer USB boards to pair the Xbees for tomorrow.
So does this code look right to you, there is no error reported?

#include <SoftwareSerial.h>
const int RXPin = A5;
const int TXPin = A3;
void setup() {                
  Serial.begin(9600);
}

void loop()
{
  Serial.print('H');
  delay(1000);
Serial.print('L');
  delay(1000);
}

I still don’t know where to put the

SoftwareSerial xbee  =SoftwareSerial(RXpin, TXpin);

in. No matter where I put it, there is an error.

It was the P. Capital P’s used at first. Now it should work.

Now it should work.

You need another statement in setup, and some changes in loop, too.

#include <SoftwareSerial.h>

const int RXPin = A5;
const int TXPin = A3;

SoftwareSerial xbee = SoftwareSerial(RXPin, TXPin);

void setup()
{                
  Serial.begin(9600);
  xbee.begin(9600);
}

void loop()
{
  xbee.print('H');
  delay(1000);
  xbee.print('L');
  delay(1000);
}

Great. Of course. Is it right that I can now only see the L's and the H's now from the other Xbee on the other computer's serial monitor if I already had the xplorers and paired them?

I tried to read out of my SoftwareSerial via simple wire into another Arduino (both Lilypad Simple) and get the other one to blink Led13.
I have connected Rx on the sender to Tx on the receiver and vice versa.
I have given both a nice Lipo 3.7 W that lights everything properly usually.
It doesn’t work.
So, if the other Arduino doesn’t get the read via cable, it won’t print it into the Xbee when I hook it onto that pair of pins later, right?
What have I done wrong-still?

#include <SoftwareSerial.h>

const int RXPin = A5;              // setting the pin to RX
const int TXPin = A3;              // setting the pin to TX

SoftwareSerial xbee (RXPin, TXPin);// defining the new serial name

void setup()
{                
  xbee.begin(9600);
}

void loop()
{
  xbee.print('H');                  // send the letter H out
  delay(1000);                      // wait for one second
  xbee.print('L');                  // send the letter L out
  delay(1000);                      // wait for one second
}
#include <SoftwareSerial.h>

const int RXPin = A5;        // change the pin into the RX
const int TXPin = A3;        // change the pin into the TX
int ledPin = 13;

SoftwareSerial xbee (RXPin, TXPin);//naming the new serial

void setup()
{
  pinMode(ledPin, OUTPUT);   //initialize the digital pin as output
  xbee.begin(9600);
}

void loop()
{
  if (xbee.read() == 'H')
  digitalWrite(ledPin, HIGH);// set the LED on
  delay(1000);               // wait for a second
  digitalWrite(ledPin, LOW); // turn the LED off
  delay(1000);               // wait for a second
}