Category Archives: XBee

Microcontroller Shop

Microcontroller Shop has a variety of useful electronic and microcontroller parts. What they have that’s exciting are the XBee boards from droids.it. They sell the XBee Simple board, the XBee Serial board, and the XBee USB board.

Posted in circuits, XBee | Comments Off on Microcontroller Shop

XBee Library graphing and logging application

Here’s a program that uses Rob Faludi and Dan Shiffman’s XBee library for processing to read three analog sensors from multiple remote XBee radios and graph them. It also saves the data to a comma-delimited file. It also makes sounds … Continue reading

Posted in Processing, XBee | Comments Off on XBee Library graphing and logging application

XBee Library graphing application

Here’s a simple program that uses Rob Faludi and Dan Shiffman’s XBee library for processing to read three analog sensors from a remote XBee radio and graph it. For this application, you need two XBee series 1 radios. One is … Continue reading

Posted in Processing, XBee | Comments Off on XBee Library graphing application

XBee to USB modules

The USB board is nice, because in addition to having a built-in 5V-to-3.3V regulator and indicator LEDs, it’s got all the pins of the XBee broken out on the side of the board…. As the US dollar continues to sink, they’re a bit pricier for US customers, but still reasonable, for now.Thanks to Rob Faludi and Jeff LeBlanc for testing help, and to Luigi Carnevale for supplying sample boards.
Continue reading

Posted in circuits, XBee | 1 Comment

XBee Radio Received Signal Strength Graphing Program

This Processing program takes a string of values in the serial port. It assumes the string is the API string from a Maxstream XBee radio.
Continue reading

Posted in Processing, XBee | Comments Off on XBee Radio Received Signal Strength Graphing Program

Xbee Radio Received Signal Strength and Data Graphing Program

The packet should be 22 bytes long. It should be made up of the following: byte 1: 0x7E, the start byte value byte 2-3: packet size, a 2-byte value (not used here) byte 4: API identifier value, a code that says what this response is (not used here) byte 5-6: Sender’s address byte 7: RSSI, Received Signal Strength Indicator (not used here) byte 8: Broadcast options (not used here) byte 9: Number of samples to follow byte 10-11: Active channels indicator (not used here) byte 12-21: 5 10-bit values, each ADC samples from the sender Created 20 Mar. 2007 by Tom Igoe */ import processing.serial.*; Serial xbee; // input serial port from the Xbee Radio int[] packet = new int[22]; // with 5 samples, the Xbee packet is 22 bytes long int byteCounter; // keeps track of where you are in the packet int fontSize = 18; // size of the text on the screen int lastReading = 0; // value of the previous incoming byte int rssi = 0; // received signal strength int address = 0; // sender’s address int average = 0; // average of the sensor data int firstRectPos = 25; // horizontal pos of the first graph bar void setup () { size(400, 300); // window size // create a font with the second font available to the system: PFont myFont = createFont(PFont.list()[2], fontSize); textFont(myFont); // get a list of the serial ports: println(Serial.list()); // open the serial port attached to your Xbee radio: xbee = new Serial(this, Serial.list()[0], 9600); } void draw() { // set the background: background(0); // if you have new data and it’s valid (>0), graph it: // write the numbers: text(“Xbee Radio Signal Strength test”, 10, 20); text(“From: ” + hex(address), 10, 40); text (“RSSI: -” + rssi + ” dB”, 10, 60); text(“Sensor avg:” + average, 10, 80); // note that these graph bars aren’t proportional, they just show change. // RSSI should range from 0 to -92 dBm drawBar(92 – rssi, 50, 0); // average should range from 0 – 1023, so divide by 4 to keep it // in the vertical space of the window: drawBar(average/4, 50, 1); } void drawBar(int rectHeight, int rectWidth, int rectNum ) { if (rectHeight > 0 ) { // draw the rect: stroke(23, 127, 255); fill (23, 127, 255); int rectPos = firstRectPos + (rectNum * 75); text(rectNum, rectPos, 30); rect(rectPos, height-rectHeight, rectWidth, height); } } void serialEvent(Serial xbee) { // read a byte from the port: int thisByte = xbee.read(); // if the byte = 0x7E, the value of a start byte, you have a new packet: if (thisByte == 0x7E) { // start byte // parse the previous packet if there’s data: if (packet[2] > 0) { parseData(packet); } // reset the byte counter: byteCounter = 0; } // put the current byte into the packet at the current position: packet[byteCounter] = thisByte; // increment the byte counter: byteCounter++; } /* Once you’ve got a packet, you need to extract the useful data.
Continue reading

Posted in Processing, XBee | Comments Off on Xbee Radio Received Signal Strength and Data Graphing Program

Xbee Radio terminal program

Working with the Maxstream Xbee radios on OSX can be annoying because the screen program doesn’t print a linefeed automatically when it receives a carriage return…. Created 2 Feb. 2007 by Tom Igoe */ import processing.serial.*; Serial myPort; // the serial port you’re using void setup() { // list all the serial ports: println(Serial.list()); // based on the list of serial ports printed from the //previous command, change the 0 to your port’s number: String portnum = Serial.list()[0]; // initialize the serial port: myPort = new Serial(this, portnum, 9600); } void draw() { // not much happens on screen: background(0); } // This method responds to key presses when the // program window is active: void keyPressed() { switch (key) { // in OSX, if the user types return, // a linefeed is returned.
Continue reading

Posted in Processing, XBee | Comments Off on Xbee Radio terminal program

Random Numbers and Physical Computing

That can take up lots of processing time, so it’s usually the first function to go when writing a microprocessor language.In fact, most of what you do in programming physical computing projects is to figure out how to deal with the world’s natural randomness and make it look smooth…. Your consciousness is a great leveller for the sensors that are your eyes, ears, skin, nose, and taste buds When you move a photoresistor from one room to another, your readings will be totally different, and all of a sudden, you have to re-calculate what is "average" and what constitutes the lighting change that you want. Continue reading

Posted in arduino/wiring, AVR, BX-24, misc, pBasic (Basic stamp), PIC, PicBasic Pro, XBee | Tagged , , | Leave a comment