SquidBee from scratch: Build your own mote
Víctor Gracia, Marcos Yarza - July 3, 2008


Important: Libelium has launched a new sensor device: Waspmote. It is ready for research and market applications. You can discover the differences between both platforms in the document: Waspmote vs SquidBee.


SquidBee is a wireless sensing mote which simultaneously measures temperature, relative humidity and intensity of light and wirelessly sends data to a central monitoring Gateway. This tutorial is intended to provide a quick assembly guide for those who want to build a SquidBee through easy construction steps.

If you want to build a SquidBee mote, these are the pieces you need:

 

  • SquidBee box

    1

  • Cable gland and fixing nut

  • Arduino board

  • 2.54mm pin headers and sockets

  • 1kΩ/10kΩ resistor

  • LDR sensor

  • RH sensor

  • LM35 sensor

  • Connection wires

  • Heat-shrinkable sleeve

  • 9V battery clip

  • 3dBi SMA omnidirectional male antenna and female SMA/U.FL pigtail

  • XBee shield and Xbee module

  • Soldering iron, soldering paste, scissors, pliers, screwdriver and lighter

 

You can get all the components with this pack.

 

Now follow these steps to build a SquidBee:

1) Download the Arduino programming software for your platform and install it.

2) Take an Arduino board and remove the ATMEGA microchip carefully (you can use a small screwdriver). Insert the XBee module onto the Xbee-shield and the shield onto the corresponding Arduino sockets. Verify that both the PWR_SEL jumper close to the Arduino USB port and the two jumpers on the shield are set to “USB”. Then, connect a standard A-to-B USB cable from Arduino to your computer and check if the PWR LED is on (Arduino is switched on).

3) Open a terminal window, e.g. Hyperterminal in Windows or Gtkterm in Linux, in order to communicate with the Xbee module with AT commands. Select the USB port the Arduino is connected through and a baudrate of 9600baud, which is the default speed. After that, type the following commands:

+++  (if you get an OK response, communication is right; if not, check previous steps)

ATBD4 [ENTER] (this changes the baudrate to 19200baud) - OK

ATWR  [ENTER] (this saves changes) - OK

ATCN [ENTER](to exit) - OK

4) Remove the Xbee-shield and re-insert the ATMEGA chip or take another Arduino board alone. With the USB cable connected, open Arduino software, go to Tools->Board and select your Arduino board model; then go to Tools->Serial Port and select the USB port which the board is connected through. Copy and paste the basic code (see example below) or freely type any code you want; then press “verify” to compile it and finally “upload to I/O board”. You should see the TX/RX LEDs on Arduino blinking. At this point you have your Arduino ready to read signals from the sensors and send data wirelessly.

5) Solder the three legs of each sensor and the wires together as shown in the figure. Note that the LDR needs an additional resistor twisted and soldered in parallel.

6) Insert small heat-shrinkable tubes around each wire and wider tubes around each 3-wire group, and shrink them all with a lighter flame. The resulting isolated tentacles must leave uncovered only 3-4 cm at the end of the wires (as shown in the first 3 videos).

7) Place two small heat-shrinkable tubes around the red and black wires of the battery clip. Take a pair of pin connectors, bend them at right angle (90º) using a pliers and insert the long side into an Arduino socket. Now solder the wires and the short side of the pins together and isolate both connections with the lighter flame.

8) Locate three 5V/3V and three GND vias on the Xbee-shield (see figure example). Take six pin sockets, place them through these free vias on the Xbee-shield front face and solder them on the reverse face.

9) Take the tentacles and insert all uncovered wires through the narrow side of the cable gland. Place the wide side of the cable gland with the uncovered wires through the big hole outside the SquidBee box, then screw the nut and firmly tighten the whole group to the box panel.

10) Unscrew the golden nut and washer of the pigtail, place the SMA-end through the small hole inside the SquidBee box and screw the golden pieces again in order to fix them on the panel. Then insert the U.FL-end onto the corresponding connector of the Xbee chip with a click.

11) Insert the two connectors of the battery clip into the Vin and Gnd sockets of Arduino, making sure you are using the correct polarity (Vin = red, Gnd = black). Change the PWR_SEL jumper close to the Arduino USB port to “EXT” and the two jumpers on the shield to “XBEE”. Then put the Xbee-shield onto Arduino again and place the Arduino+shield+battery clip group into the SquidBee box.

12) Connect the three red 3V/5V and three black GND wires into the sockets you have previously soldered; now connect the purple, yellow and white signal wires to the Arduino & Xbee-shield 0-1-2 analog-in sockets (see figure).

13) Close the SquidBee box and screw the antenna on the SMA connector.

The mote starts sending data a few seconds after you plug a 9V battery in.

In addition, you can connect a Gateway to your computer through the USB cable and read these data on a terminal window.  It is very easy to build a Gateway just by using an Arduino board without ATMEGA chip and an receiver XBee shield, connected in the same way as described in step 2.

 

2

3

Adding the Humidity sensor

Adding the LDR sensor

Adding the Temperature sensor

Assembling the mote

 

Basic code:



/*
Program for SquidBee v1.0


Marcos Yarza
Zaragoza, Agosto 2.007
*/



// variable declaration

int sens0 = 0;    //sensors
int sens1 = 1;
int sens2 = 2;

int val0 = 0;    //aux var
int val1 = 0;
int val2 = 0;

int count = 0;

void setup(){ 
  Serial.begin(19200);    //initializes serial port with a baudrate of 19200bps (same as XBee chip)
}

// function to send data

void sendData(int id,int num, int data0,int data1,int data2){
 
  Serial.print("@");
  Serial.print(id);
  Serial.print("|");
 
  Serial.print(num);
 
  Serial.print("|data0-");
  Serial.print(data0);
 
  Serial.print("|data1-");
  Serial.print(data1);
 
  Serial.print("|data2-");
  Serial.print(data2);
   
  Serial.println("#r");      // end of message
}

void loop(){
  while (count <= 10000){
    val0 = analogRead(sens0);
    val1 = analogRead(sens1);
    val2 = analogRead(sens2);
   
    sendData(3,count, val0,val1,val2);

    delay(5000);
     count++;
    } 
 
  count = 0;

}

gallery.png
theGroup.png

barra_lateral/rss
Research
  • Enclosure
  • Energy Management
  • GPS Mesh Networks
  • Hardware Node
  • Manager Platform
  • Mesh Routing Protocols
  • Securing the Mesh
  • Sensor Integration
  • System and Communications
  • System and Manager Platform
barra_lateral/techM