| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

WiTilt

Page history last edited by PBworks 17 years ago


 

General info

The WiTilt is a three-axis wireless accelerometer module sold by Sparkfun.

 

Useful information from the Sparkfun website:

  • connection parameters are 57600, 8N1 for the serial-over-Bluetooth link
  • for pairing, the pairing passphrase is "default"
  • Even though nomially rated a 4-6V, the WiTilt seems to run fine on 3.7V Lithium polymer batteries.

 

Other useful info:

  • on Mac OSX, the WiTilt shows up as /dev/tty.BlueRadios-COM0-1 by default.


 

Link Uptime Tests

We've started to run endurance tests (using Leith's WiTiltBatteryTestScript) with a WiTilt v2.5 powered by one of SparkFun's 850mAh Lithium-polymer batteries. While the battery hasn't run out yet (theoretically you can expect up to 850mAh/40ma ~=21 hours of operation), the Bluetooth link has been dropping out. Recent measurements of link uptime:

  • 1094 seconds
  • 2076 seconds
  • 941 seconds
  • 936 seconds
  • 1610 seconds

 

After this time, the link LED on WiTilt goes off, and in Python the serial port now looks "closed." We can reestablish the Bluetooth link by re-opening the serial port (e.g., ser.open() in Python). This is because we have a "Quick Connect" entry in IVT BlueSoleil that starts the connection whenever the associated COM port is opened. So graceful recovery seems possible.

 

On mac os X endurance tests the connection has lasted upwards of 3 hours, but exemplar became very slow as the time went on. This test was just done by leaving exemplar open with the WiTilt connected


Reset Info

Q: We need to check what state the WiTilt is in after a connection drop - is it still sending data or are we back at the main menu?

A: The WiTilt is still sending data. In other words, data acquisition and data transfer functions are independent from each other. "Reset" only restarts the data acquisition part, while connect/disconnect only affects the data transfer part.

 

Q: How can I detect a reset on a connected computer? How do I restart data acqusition automatically after a reset?

A: When the reset button is pressed, the WiTilt sends a two characters, 0xE0 0xE0, then restarts and transmits the main menu. The time between sending 0xE0 and being responsive to input from the computer is approx. 2000ms. Hence you can detect a reset and restart a WiTilt with the following pseudocode:

if (serialIn.equals({0xE0,0xE0}) {
  wait(2000);
  serial.send({'1','S'}); //for binary mode

 

Q: What state is the WiTilt in after a power cycle - does it remember its configuration?

A: Yes it does. A power cycle always brings up the main menu, but the settings from last time are retained. So if you were last in Ascii mode, you will need to send a "1" to restart data acquisition. If you were in Binary mode, you will need to send a "1" followed by "S". But there's no need to reconfigure binary mode.

 

 

 


Understanding the WiTilt LEDs

The following are observations that may be incorrect.

  • Big red status LED lights up when PIC firmware sends data (i.e., menu text or accelerometer readings) out. If the sampling frequency is set at 50Hz or below and data is being transferred to a computer, you should see this LED flickering. Above 50Hz it will probably just look like it's on.
  • Small red bluetooth LED: confusingly, this is also labeled "Status". Should pulse with 1Hz when you turn on the WiTilt and it is NOT connected to a PC. If you are not connected and the LED is not pulsing, it's probably time for a power cycle.
  • Small green bluetooth LED: This LED lights up when a bluetooth link between a PC and the WiTilt is established. Accordingly, the small red bluetooth LED should be off when the green one is on.
  • The reset button does not affect the bluetooth connection only the pic chip

WiTilt and various bluetooth stacks

 

  • Mac OSX on a PowerBook G4:
    • Set up Bluetooth Device...
    • Continue->Any Device->Pick the one that says "BlueRadios"->Continue->Continue->enter "default" as passkey->You'll get a "Tere were no supported services" message in red. That's ok. Quit.
    • Open Bluetooth Preferences->Select BlueRadios->Edit Serial Ports.. button.
    • Write down Port name; type should be RS-232. Your serial port name for Exemplar and other software is /dev/tty.{Portname} e.g., /dev/tty.BlueRadios-COM0-1

 

  • Windows XP SP 2
    • don't try to use microsofts bluetooth stack built into windos because it doesn't work - could use hyperterminal to connect but couldn't select options or get exemplar to work with it
    • install BlueSoeil software from the web http://www.bluesoleil.com/download/index.asp
      • Version 2.3 is the latest. It says it is an evaluation but it works because it is liscensed to the noname Bluetooth dongle we bought from Fry's. Note that buying BlueSoleil is only 5 EUR from their online store.
    • Open BlueSoeil
    • Click on the my Bluetooth menu at the top
      • select Bluetooth Device discovery from the drop down menu
      • all bluetooth devices should apear
    • right click on the WiTilt (SHould be labled BlueRadios)
    • pair
    • a window pops up for pairing details
      • enter 'default' as the passkey
    • after you have paired them right click on the blue radios device and connect
    • a window will display which com port it is connected to eg COM8, write this down and fill it in the exemplar preferences for WiTilt com port

Misc. pitfalls

  • Reading WiTilt binary data in Java: Java's built-in types are signed. However, the Witilt in binary mode sends unsigned 10bit values in two adjacent bytes. Read up on Java and unsiged data types. You'll end up with something like: ((int)oscRxData[2])*256+(0x000000FF & (int)oscRxData[3]))
  • Streaming lots of data from the WiTilt into Hypterterminal caused a blue screen of death in WinXP pro with a stop error b/c of "BAD_POOL_something". This may be an isolated issue since streaming it into Python or Java works just fine.

 

Connecting Multiple WiTilts

You can connect at most two WiTilts to a computer using the blueSoleil software. The program only allows you to open a max of 2 incoming bluetooth serial port connections. Their datasheet explains this on page 3 BlueSolei data sheet

 

However you can have three or more WiTilts so long as you only have at most two connected at the same time. To switch which ones are active and can be used in blueSolei go to tools, configurations, then quick connect and then reassign the one that has a COM port that is not working to a COM port that is working. For example if COM22 is assigned to the third WiTilt and you already have COM15 and COM16 working with the WiTilts remove one of those and asign the third to COM15 or COM16.


our Witilt IDs:

  • 00:A0:96:17:9B:09 (Blueradios, RPSMA connector, jumpered power switch) COM15
  • 00:A0:96:17:AA:33 (SparkFun-BT, RP-SMA connector) COM16
  • 00:A0:96:17:9C:7B (RlueRadios, Ceramic antenna)

Comments (0)

You don't have permission to comment on this page.