What

This project is a wireless “heading reference system” that tracks alignment, and a Processing sketch that visualizes it.  My particular version of this gets the volume too and changes the visualization based on that.   It’s based on an Arduino Nano, a Pololu IMU (the AltIMU-10), a cheap serial bluetooth module, and an electret mic breakout, with Processing doing the visualisation.

 

Parts

micimuhc-05 nano

  1. SparkFun Electret Microphone Breakout (gives 0v-5v DC-offset signal readable straight from Arduino analogue in) ~$8
  2. Pololu AltIMU-10 (Gyro, Accelerometer, Compass, and Altimeter module) ~$20
  3. HC-06 Serial Bluetooth module ~$7
  4. Arduino Nano (or clone) ~$10

 

Hardware

nano connections_bb

Software

All Arduino code and Processing code is available on GitHub at https://github.com/neonascent/3d_sound_tracking

Arduino

The code I used for filtering and sending the heading data is based on Pololu_Open_IMU by mikeshub modified to send at the slower 9600 baud supported by the bluetooth, and with the volume reading code added.   I originally tried to use Camel Software’s Quaternion-based AHRS using AltIMU-10 & Arduino, but found – like others – that it crashed the nano when trying to read EEPROM (although Camel Software says this has now been fixed).

With my code:

  1. Install the LPS, L3G, and LSM303 Arduino libraries included Arduino/Libraries folder (or on GitHub for L3G Arduino libraryLSM303 Arduino library, and LPS Arduino library)
  2. Run calibrate_mag Arduino sketch, open serial monitor, move the device around and take note of final min and max values.
  3. Open Pololu_Open_IMU sketch, and modify all the compass min and max values (e.g. “#define compassXMax …”) according to what you got from calibrate_mag.
  4. Upload, run, open serial monitor and make sure you are getting output such as “!ANGLE:0.1,1.52,0.4,125”

 

Processing

  1.  Install the Toxiclibs Processing library included in Processing/Libraries folder (used for handling quaternions)
  2. Pair to your bluetooth module on your computer, and take not of the address.  On a Mac this will be something like “/dev/tty.HC-06-DevB” and on a windows machine it will look like “COM42”.
  3. Update the line port with the correct bluetooth port name, and run.

 

Questions or suggestions?

Please comment below with questions or thoughts.  How did your implementation go?  Maybe you have some improvements.