Home PageAeroquad shield

Aeroquad Shield

The aeroquad shield contains pins to be able to connect some sensors namely a ITG3200 BMA180 and HMC5843.

The I2C connections from the arduino are also buffered and converted to 3.3 volt by a small voltage converter. There are connections for remote control and plenty of other connection posibilities.
I have a aeroquad shield version 1.8 which was only different from the version 1.9 in the voltage divider for the battery level display as you can see below. This is quite easy to correct by simply soldering three 15kOhm resistors. Two go between ground and the A0 port and one between VIN and the same port. The parallel wired resistors together make up 7.5kOhm which is what the version 1.9 uses. If you have a 7.5kOhm resistor this can of course be used instead of the two.

You can do some nice things with the aeroquad shield besides using it for  a helicoptor design. This includes spinning a cube using the gyro and accelerometers as input. Of course you can also test the individual components and the libraries that they need to work with. It also has plenty of room for additional components to be mounted. There are I2C ports to connect other sensors to the devuice and a really nice interface for the remote controllers that helicopters use. All the usual connections such as Aux, Gear, Rudd, Elev, Aile and thro are there. You also have a 5v to 3v converter so all peripherals are at the right voltage and do not get cooked.You can also add a barometer and be able to read the pressure should you uyse this device for high altitude work such as balooning. Finally there is a serial port connector for GPS location devices so you can even tell the exact position of the device.

aeroquad shield 1.8aeroquad shield 1.9

 

Aeroquad shield components

The sensors that are built into this board are as follows. The ITG3200 3 axis gyro.
You can clearly see that the jumper connected to pin9 of the ITG3200 is connected to VDD which means the software should take the HIGH adress.
The two pull up resistors are also not mounted. The datasheet can be found here http://www.sparkfun.com/datasheets/Sensors/Gyro/ITG-3200-v10.pdf
There is a bit more information with some specific examples elsewhere on my site.

aeroquad shield ITG3200 front aeroquad shield ITG3200 back                    shop button

Then there is the BMA180 3 axis accelerometer. The datasheet is here http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Accelerometers/BST-BMA180-DS000-07_2.pdf
As you can see from the schematic  SDO is connected to GND so that the I2C adress is the LOW one.
There is a bit more information with sopme specific examples elsewhere on my site.

aeroquad shield BMA180 frontaeroquad shield BMA180 back

Finally there is the HMC5843 three axis magnetometer.  The HMC5883L is also pictured here because it is the successor of the HMC5843 with very similar functionality.
There is no adress to configure on this chip. Datasheet is here. http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Magneto/HMC5883L-FDS.pdf
There is a bit more information with sopme specific examples elsewhere on my site.

aeroquad shield HMC5883L frontaeroquad shield HMC5883L backaeroquad shield HMC5843 frontaeroquad shield HMC5843 back

Here you can see the Aeroquad shield v1.8 board with the resistors for the voltage divider for the battery level display mounted and also the position of the magnetometer.

aeroquad shield

On Fabio Varesano’s http://www.varesano.net/projects/hardware/FreeIMU site there is a really cool bit of code to test this combination.
It only needs a small adaptation to be able to use it with the Aeroquad shield.
You can find the updated FreeIMU.h code here.

Show »

/*
FreeIMU.h - A libre and easy to use orientation sensing library for Arduino
Copyright (C) 2011 Fabio Varesano

Development of this code has been supported by the Department of Computer Science,
Universita' degli Studi di Torino, Italy within the Piemonte Project
http://www.piemonte.di.unito.it/

This program is free software: you can redistribute it and/or modify
it under the terms of the version 3 GNU General Public License as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/
#ifndef FreeIMU_h
#define FreeIMU_h

// Uncomment the appropriated version of FreeIMU you are using
//#define FREEIMU_v01
//#define FREEIMU_v02
//#define FREEIMU_v03
//#define FREEIMU_v035
//#define FREEIMU_v035_MS
//#define FREEIMU_v035_BMP
//#define FREEIMU_v04

// 3rd party boards. Please consider donating or buying a FreeIMU board to support this library development.
//#define SEN_10121 //IMU Digital Combo Board - 6 Degrees of Freedom ITG3200/ADXL345 SEN-10121 http://www.sparkfun.com/products/10121
//#define SEN_10736 //9 Degrees of Freedom - Razor IMU SEN-10736 http://www.sparkfun.com/products/10736
//#define SEN_10724 //9 Degrees of Freedom - Sensor Stick SEN-10724 http://www.sparkfun.com/products/10724
//#define SEN_10183 //9 Degrees of Freedom - Sensor Stick  SEN-10183 http://www.sparkfun.com/products/10183
#define AEROQUAD_v19 // aeroquad shield
// *** No configuration needed below this line ***

#define HAS_ITG3200() (defined(AEROQUAD_v19) || defined(FREEIMU_v01) || defined(FREEIMU_v02) || defined(FREEIMU_v03) || defined(FREEIMU_v035) || defined(FREEIMU_v035_MS) || defined(FREEIMU_v035_BMP) || defined(SEN_10121) || defined(SEN_10736) || defined(SEN_10724) || defined(SEN_10183))
#define HAS_ADXL345() (defined(FREEIMU_v01) || defined(FREEIMU_v02) || defined(FREEIMU_v03) || defined(SEN_10121) || defined(SEN_10736) || defined(SEN_10724) || defined(SEN_10183))
#define HAS_BMA180() (defined(AEROQUAD_v19) || defined(FREEIMU_v035) || defined(FREEIMU_v035_MS) || defined(FREEIMU_v035_BMP))
#define HAS_MPU6050() (defined(FREEIMU_v04))
#define HAS_MS5611() (defined(FREEIMU_v035_MS) || defined(FREEIMU_v04))
#define HAS_HMC5883L() (defined(AEROQUAD_v19) || defined(FREEIMU_v01) || defined(FREEIMU_v02) || defined(FREEIMU_v03) || defined(FREEIMU_v035) || defined(FREEIMU_v035_MS) || defined(FREEIMU_v035_BMP) || defined(FREEIMU_v04) || defined(SEN_10736) || defined(SEN_10724) || defined(SEN_10183))

#define IS_6DOM() (defined(SEN_10121))
#define IS_9DOM() (defined(AEROQUAD_v19) || defined(FREEIMU_v01) || defined(FREEIMU_v02) || defined(FREEIMU_v03) || defined(FREEIMU_v035) || defined(FREEIMU_v035_MS) || defined(FREEIMU_v035_BMP) || defined(FREEIMU_v04) || defined(SEN_10736) || defined(SEN_10724) || defined(SEN_10183))
#define HAS_AXIS_ALIGNED() (defined(AEROQUAD_v19) || defined(FREEIMU_v01) || defined(FREEIMU_v02) || defined(FREEIMU_v03) || defined(FREEIMU_v035) || defined(FREEIMU_v035_MS) || defined(FREEIMU_v035_BMP) || defined(FREEIMU_v04) || defined(SEN_10121) || defined(SEN_10736))

#include
#include "Arduino.h"

//#if FREEIMU_VER #if HAS_ADXL345()
#include
// default I2C 7-bit addresses of the sensors
#define FIMU_ACC_ADDR ADXL345_ADDR_ALT_LOW // SDO connected to GND
//#define FIMU_ADXL345_DEF_ADDR ADXL345_ADDR_ALT_HIGH // SDO connected to GND
#elif HAS_BMA180()
#include
//#define FIMU_ACC_ADDR BMA180_ADDRESS_SDO_LOW
#define FIMU_ACC_ADDR BMA180_ADDRESS_SDO_HIGH
//#elif FREEIMU_VER == 7
#elif HAS_MPU6050()
#include "I2Cdev.h"
#include "MPU6050.h"
#define FIMU_ACCGYRO_ADDR MPU6050_ADDRESS_AD0_LOW
//#define FIMU_ACCGYRO_ADDR MPU6050_ADDRESS_AD0_HIGH
#endif

#if HAS_MS5611()
#include
#define FIMU_BARO_ADDR MS561101BA_ADDR_CSB_LOW
//#define FIMU_ACC_ADDR MS561101BA_ADDR_CSB_HIGH
#endif

#if HAS_ITG3200()
#include
#define FIMU_ITG3200_DEF_ADDR ITG3200_ADDR_AD0_HIGH // AD0 connected to VCC
//#define FIMU_ITG3200_DEF_ADDR ITG3200_ADDR_AD0_LOW // AD0 connected to GND
#endif

#if HAS_HMC5883L()
#include
// HMC5843 address is fixed so don't bother to define it
#endif

#define twoKpDef  (2.0f * 0.5f) // 2 * proportional gain
#define twoKiDef  (2.0f * 0.1f) // 2 * integral gain

#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif

class FreeIMU
{
public:
FreeIMU();
void init();
void init(bool fastmode);
#if HAS_ITG3200()
void init(int acc_addr, int gyro_addr, bool fastmode);
#else
void init(int accgyro_addr, bool fastmode);
#endif
void getRawValues(int * raw_values);
void getValues(float * values);
void getQ(float * q);
void getEuler(float * angles);
void getYawPitchRoll(float * ypr);

// we make them public so that users can interact directly with device classes
#if HAS_ADXL345()
ADXL345 acc;
#elif HAS_BMA180()
BMA180 acc;
#endif

#if HAS_HMC5883L()
HMC58X3 magn;
#endif

#if HAS_ITG3200()
ITG3200 gyro;
#elif HAS_MPU6050()
MPU6050 accgyro;
#endif

#if HAS_MS5611()
MS561101BA baro;
#endif

int* raw_acc, raw_gyro, raw_magn;

private:
#if IS_9DOM()
void AHRSupdate(float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz);
#elif IS_6DOM()
void AHRSupdate(float gx, float gy, float gz, float ax, float ay, float az);
#endif
//float q0, q1, q2, q3; // quaternion elements representing the estimated orientation
float iq0, iq1, iq2, iq3;
float exInt, eyInt, ezInt;  // scaled integral error
volatile float twoKp;      // 2 * proportional gain (Kp)
volatile float twoKi;      // 2 * integral gain (Ki)
volatile float q0, q1, q2, q3; // quaternion of sensor frame relative to auxiliary frame
volatile float integralFBx,  integralFBy, integralFBz;
unsigned long lastUpdate, now; // sample period expressed in milliseconds
float sampleFreq; // half the sample period expressed in seconds
int startLoopTime;
};
float invSqrt(float number);
#endif // FreeIMU_h

You run the FreeIMU_quaternion.pde example on the arduino and FreeIMU_cube.pde in processing.
This visualises a solid object which you can move by moving the Aeroquad shield.

Here is a short video of what this looks like.

aeroquad shield video

 

1 comment

  1. admin says: August 13, 2012

Leave a Reply