In my quest for simple, robust and easy physical interaction computing for dance and music, I have now decided to try using a BTarduino with the ADXL311 2-axis accelerometer from Analog Devices. The ADXL311 is in the same family as the ADXL330 used in the Wii Remote (apparently).
So, first things first. I ordered a BT arduino from PCB Europe about a month ago. A few days ago I ordered two units of the ADXL311 at around 9 quid each from RS electronics.
Now, let's try to get them to work together.
The Arduino site says that the BT arduino can be powered between 1.2V and 5.5V. First attempt, with 2x AA is working fine. And that is with the really rubbish AA batteries I bought in a pound shop for £1. Success.
That should also be enough juice to power the ADXL311. Apparently it needs between 2.7V and 5.25V according to the spec sheet from AD, and it consumes 400microamps. Cool, that ain't gonna drain my batteries in ten minutes like the Wi-MiniDig.
Docs say I must also connect a bias resistor between 50k Ohm and 2M Ohm. I'll get to that later.
Ok, now how do I get the BT arduino to talk to Windows XP? First I "added new device" in the windows Bluetooth control panel. It showed up as "BTarduino" and the default passkey "12345".
Note to self: change the name and passkey later, I intend to you use several BTarduinos.
Then downloaded version 0009 of the arduino software. It runs.
First thing to do: go under tools and select the correct microcontroller, the atmega168.
Ok, now what? Let's read this official BT arduino tutorial.
Ok, there's a bit I don't understand. This says "the ATmega168 comes preloaded with a bootloader that allows you to upload sketches to the board via bluetooth.". Does it mean I don't have to upload a bootloader to my arduino?
Ok, if that's true, I should be able to just upload the code to blink an LED. Let's try that.
It looks like there's some code on the arduino already that does blink the LED. Will have to try something else.
In any case, I need to select the port number in the arduino IDE. Hmm, three COM ports come up: 27, 29 and 30. From the bluetooth properties, I find that BTarduino is number 29. I suspect this is that same problem I've had in the past. It seems that whenever I add a bluetooth device it creates several port number for each device (especially mobile phones.) High numbers seem to be problematic, so I've often had to resort to deleting most port entries and redoing them. Note to Microsoft: change this. It sucks big time. Mac OS X seems to have this sussed out, with name BT ports.
Anyway: to try to solve things, changed the port number to COM2, and changed the speed to 115600.
Ok, next step: upload the Firmata sketch so that I can read from within PD. I get this error:
"avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51"
I'm assuming the software sees the connection but can't send for some reason. Let's investigate.
UPDATE 10.NOV.2007
-------------------------------
I discovered that you have to change the transmission speed in the Firmata script too. I had never really looked at it in detail. But after changing it in the script, it worked.
I never got the ADXL311's to work, however. The connectors (what do you call those, anyway) are too small to solder, and I have a feeling that the heat from the soldering iron fried them. Poo. Next I intend to try the SparkFun Lilypad accelerometers, if only because you don't need a microscope and coffee withdrawal to connect them. But also because they look cool.