Which sensors are connected to which analog pins on the ArduIMU v2?

Hello, can someone tell me which sensor is read by which analog pin in the ADC section of the ArduIMU code?

For example, it looks like the pitch accelerometer is on pin 0 and the variable mapped to the pitch accelerometer is AN[0].  I can't figure out some of the rest.  Reading analog pin 1 in a test program looks like its giving me the roll accelerometer.  However, when I serial print AN_OFFSET[1]-AN[1] in the arduimu code, the value is a flat zero.

Tags: analog, arduimu, pin, pins

Views: 135

Reply to This

Replies to This Discussion

After looking though the board schematics it looks like the x acel = pin 0, y acel = pin 1, z acel = pin 2, z gyro = pin 3, x gyro = pin 6, y gyro = pin 7 where x is pitch, y is roll, and z is yaw.

When I test the gyro pins 6, 7, and 3 with a simple print analogRead() to serial program, the results are static. Are my gyros broken?

As a side question, which sensor corresponds to which variable, AN[0] to AN[5] in the arduimu program?
>When I test the gyro pins 6, 7, and 3 with a simple print analogRead() to serial program, the results are static.

You are rotating the IMU during the tests, right?
Remember that they are rate not position gyros. The output only changes when the device has a rotation rate (is turning).
Yes, I've tried rotating each axis one at a time and waving it around like a mad man. I should see something from analogRead(6), 7, or 3 correct?
I think that 0,1,2,3,6, and 7 are the right ADC pins for V2. However the ArduIMU code does a lot of things such as setting the reference voltage, creating interrupt procedures, etc. to get things to a known state and does some filtering.

So, if you are trying to roll your own code, you might have to do a few of these things yourself (especially the reference) before analogRead gives you what you want.

Why not start with working code? Upload the ArduIMU firmware. Look in arduimu.pde, about 37 lines down, more or less. Look for:

#define PRINT_ANALOGS 0 //Will print the analog raw data

change that to

#define PRINT_ANALOGS 1 //Will print the analog raw data

(change 0 to 1)

Now, the analog values will be sent back over the serial -->USB-->your computer.

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service