Arduino library for MMA7260Q (Tilt Sensor)

In the past days I published a couple of arduino libraries. All coming from by XBee sensor development. I’m still waiting for the MAX756 to arrive from Futurlec, I need the MAX756 to power the xbee sensor with batteries and mount it in its final position. So in the meanwhile I’m cleaning a little bit the code, moving thing to libraries, etc. Now it’s the turn of the MMA7260Q, (see other posts about MMA7260q) . I created an Arduino library to use MMA7260Q as a Tilt Sensor that does autozero calibration. ...

March 21, 2009

Arduino XBee sensor (temperature, tilt, compass, and ambient light)

I finally put together an Arduino Pro Mini, the XBee, the MMA7260Q, the HMC6352, the TEMT6000 and the DS1620. This is how it looks like on the prototyping board (ugly, I know) Hopefully it would look better when I move it to the PCB. But before doing that I need to get the battery power set up. (I’m waiting for a MAX756 DC-DC voltage regulator and CoilCraft inductors to arrive) ...

March 17, 2009

Example of XBee API frames

Some examples of XBee API Frames. Modem status frame 7E 00 02 8A 06 6F 7E : API Frame 00 02 : Length 8A : Modem status 06 : Coordinator started 6F : checksum FF – ((8A +06) & FF) = 6F AT Command API Frame: MY 7e 00 04 08 52 4D 59 FF 7E : API Frame 00 02 : Length 08 : AT Command Frame id 52 : Frame id 4d 59 : MY (4d 59) (4d ⇒ M, 59 ⇒ Y) Get the 16-bit network address of the module. FF : checksum ff = ff – ((08+52+4d+59) & ff) AT Command Response: MY 7e 00 07 88 52 4d 59 00 00 00 7f 7E : API Frame 00 07 : Length 88 : AT Command Response API Identifier 52 : Frame id 4d 59 : MY (4d 59) (4d ⇒ M, 59 ⇒ Y) Get the 16-bit network address of the module. 00 : Status 0=OK 00 00 : MY value, 00 000 not set 7f : checksum ff = ff – ((08+52+4d+59) & ff) Explicit Addressing Zigbee Command Frame: 7E 00 1D 11 01 00 13 A2 00 40 3E 25 75 00 00 01 01 04 02 01 04 00 00 18 01 01 00 00 00 29 63 CE 9F 7E : Start frame 00 1D : Length (29 bytes) 11 : explicit addressing transmit 01 : Frame id 00 13 A2 00 40 3E 25 75 : 64 bit address 00 00 : 16 bit address 01 : source endpoint 01 : destination endpoint 04 02 : cluster id (temperature measurement cluster id/ Measurement and sensing functional domain) 01 04 : profile id (home automation profile) 00 : broadcast radius 00 : options 18 01 01 00 00 00 29 63 CE : payload 9F : checksum Let’s analyze the payload ...

March 12, 2009

Setting XBee to sleep causes Arduino reset

If you run into this problem it means that you’re probably using the XBeeShield. Maybe you didn’t notice but if you take a look to the Arduino XBee Shield schematics you’ll find out that DIO7 (CTS - Clear to Send) on the XBee is wired to RST in the Arduino. And that’s why you get the Arduino reset. Even if you set DIO7 configuration to 0 - DISABLED (using X-CTU) the DIO7 will be set to HIGH then XBee enters sleep (This is stated in the “End Device Sleep Configuration”/“XBee End Device Configuration” chapter of the XBee Manual) . ...

March 5, 2009

Upgrading Xbee Series 2 (XbeeShield) to Xbee ZB with Arduino

As stated in this digi page is possible to upgrade/convert a Xbee Series 2.5 to a Xbee ZB (with full standard Zigbee capabilities). Xbee Series 2.5 is just another name for the forme Series 2, so the upgrade procedure is exactly the same. The procedure if fairly straighforward Remove ATmega168 from Arduino board Insert XbeeShield into Arduino Change *both *jumpers in XbeeShield to USB Connect Arduino to the computer using the USB cabke Download the ZNet 2.5 to ZB Conversion Kit here Start the X-CTU 5.1.4.1 software Select the proper COM port (should be Usb serial port (COMX)) Click on Test Query. The following dialog should appear indicating that X-CTU found the Xbee in that COM port and giving you some information about the Xbee module version, etc. In my case it was a ZB24-B with 1220 firmware Go to the Modem Configuration tab Download the ZNet 2.5 to ZB Conversion Kit here if you didn't do it earlier Uncompress the ZIP Select the “Download new versions” button. Press the “File” source button Select the xbee_zb.zip file to add the firmware set to X-CTU Back to the Modem Configuration tab. Select "Always update firmware" checkbox and select XB24-ZB (or XB24P-ZB if you have a PRO module) and the function set that you want for the module (router, coordinator, end device, each one in two differente flavor AT or API). In my case I selected XB24-ZB and COORDINATOR API. Check the product manual to find out about API and AT modes and the different firmwares for each set Press "Write" and X-CTU will start uploading the firmware to the module The firmware upgrade is complete **NOTE**: Make sure that the configuration for DIO7 is DISABLED as this XBee pin is connected to the RST in the Arduino. If you leave the default option (1 - CTS) random resets after a couple of seconds may occur+ NOTE 2: Be aware that putting XBee to sleep will also raise DIO7 and produce and Arduino reset. See this other post on XBee sleep and Arduino reset

September 6, 2008