The Poor Man Accelerometer.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
The Poor Man Accelerometer.
Here is an interesting find, not sure of the quality but the cost is very nice. Going to purchase four of them next week for testing. The documentation states, I2C. Hmm.
3 Axis Digital Accelerometer
http://gadgetgangster.com/find-a-projec ... ectnum=322
3 Axis Digital Accelerometer
http://gadgetgangster.com/find-a-projec ... ectnum=322
Re: The Poor Man Accelerometer.
from the spec sheet it looks like very low resolutions device (~7 bits) .... 70 counts/g....
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
However, in an auto-leveling environment, why would more be required? I read where it stated, 8 bits for up to 4 g and 10 bits for 8g, why is this so? I have no idea. There may be the possibility of bypassing the ADC and wiring the Accelerometer directly to the Arduino Analog ports. So, the title fits, a poor man's Accelerometer.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
I ordered two of these for testing, will post an update of mu findings.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Here is an update on the MMA7455, Very interesting device to say the least. It requires no Calibration and when it is perfectly level, it output a value of 0 for both the X and Y axis. Because it outputs a negative number that relates to a negative tilt but it is in the form of two's complement http://en.wikipedia.org/wiki/Two%27s_complement, the MultiWiiCopter code requires some adaptive code to fully integrate this device. The great and good news is, it does not require any calibration and it appears to be able to run at 400khz.
Here is the code that I have so far but I am having problems trying to figure out the two complement issue.
Here is the code that I have so far but I am having problems trying to figure out the two complement issue.
Code: Select all
#if defined(MMA7455)
static uint8_t rawADC_MMA7455[6];
void i2c_ACC_init () {
delay(10);
i2c_rep_start(0x3A); // I2C write direction
i2c_write(0x16); // Mode Control
i2c_write(0x25); // Set Sensitity Value @ 2g
//i2c_write(0x21); // Set Sensitity Value @ 8g
acc_1G = 63;
acc_25deg = 26; // = acc_1G * sin(25 deg)
accPresent = 1;
}
void i2c_ACC_getADC () {
static uint8_t counter;
TWBR = ((16000000L / 400000L) - 16) / 2;
i2c_rep_start(0x3A); // I2C write direction
i2c_write(0x06); //Registry to start reading from.
i2c_rep_start(0x3B); // I2C read direction => 1
for(uint8_t i = 0; i < 2; i++) {
rawADC_MMA7455[i]= i2c_readAck();}
rawADC_MMA7455[2]= i2c_readNak();
//accADC[ROLL] = (int(rawADC_MMA7455[1]<<8) | rawADC_MMA7455[0]);
//accADC[PITCH]= (int(rawADC_MMA7455[3]<<8) | rawADC_MMA7455[2]);
//accADC[YAW] = (int(rawADC_MMA7455[5]<<8) | rawADC_MMA7455[4]);
accADC[ROLL] = int(rawADC_MMA7455[0]);
accADC[PITCH]= int(rawADC_MMA7455[1]);
accADC[YAW] = int(rawADC_MMA7455[2]);
//accADC[ROLL] = (i2c_readAck() && 0x7F);
//accADC[PITCH]= (i2c_readAck() && 0x7F);
//accADC[YAW] = (i2c_readNak() && 0x7F);
}
#endif
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
Re: The Poor Man Accelerometer.
very interesting will be looking forward to your findings
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
I have set it aside for te moment, I received the BMA020 but I plan to return to this little gem because I am very curious about it.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Well, I finally cracked the two's complement and it was easy but seemed so hard at the time.
http://en.wikipedia.org/wiki/Two%27s_complement
Now comes the task of integrating this with Alex's existing code but that should be fairly easy.
http://en.wikipedia.org/wiki/Two%27s_complement
Now comes the task of integrating this with Alex's existing code but that should be fairly easy.
- Attachments
-
- MMA7455_I2C.zip
- Test code for the MMA7455 Accelerometer.
- (933 Bytes) Downloaded 264 times
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Here is the Code for MultiWiiCopter 1.7 that works in the GUI, I have not test flown it yet.
Code: Select all
// Developmental code for the MMA7455
#if defined(MMA7455)
static int8_t rawADC_MMA7455[6];
void i2c_ACC_init () {
delay(10);
i2c_rep_start(0x3A); // I2C write direction
i2c_write(0x16); // Mode Control
i2c_write(0x25); // Set Sensitity Value @ 2g
//i2c_write(0x21); // Set Sensitity Value @ 8g
acc_1G = 64;
acc_25deg = 27; // = acc_1G * sin(25 deg)
accPresent = 1;
}
void i2c_ACC_getADC () {
//TWBR = ((16000000L / 400000L) - 16) / 2; // change the I2C clock rate to 400kHz, ADXL435 is ok with this speed
//i2c_rep_start(0x3A);
//i2c_write(0x09);
//i2c_rep_start(0x3B);
i2c_rep_start(0x3A); // I2C write direction
i2c_write(0x00); //Registry to start reading from.
i2c_rep_start(0x3B); // I2C read direction => 1
for(uint8_t i = 0; i < 5; i++) {
rawADC_MMA7455[i]= i2c_readAck();}
rawADC_MMA7455[5]= i2c_readNak();
accADC[ROLL] = ((char(rawADC_MMA7455[1])<<8) | (rawADC_MMA7455[0]>>1)<<1);
accADC[PITCH]= ((char(rawADC_MMA7455[3]<<8)) | (rawADC_MMA7455[2]>>1)<<1);
accADC[YAW] = ((char(rawADC_MMA7455[5]<<8)) | (rawADC_MMA7455[4]>>1)<<1);
}
#endif
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Here is a video of my very first test using the MMA7455. Can only get better from here.
http://www.youtube.com/watch?v=fLHuNcr_U9U
http://www.youtube.com/watch?v=fLHuNcr_U9U
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
- captaingeek
- Posts: 228
- Joined: Fri Jan 28, 2011 6:42 pm
Re: The Poor Man Accelerometer.
hey Rich, you done with RCG?
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
MMA7455 Accelerometer Sensor Module AVR ARM MCU
These MMA7455 started appearing on eBay and I purchased two of the, Works really well and very easy to wire up.
http://cgi.ebay.com/ebaymotors/ws/eBayISAPI.dll?ViewItem&item=250883220033&viewitem=&sspagename=ADME%3AB%3ASS%3AUS%3A1123
Re: The Poor Man Accelerometer.
Hi, I'm a newbie and want make a Quadcopter with this Accelerometer Sensor, my sensor is KIT3468MMA7455L (From an old project) i will use an Arduino UNO (From an old project too) and i don't know for the gyro but certainly a WMP...
I'll let you know.
Sylvain
I'll let you know.
Sylvain
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
I am very well pleased with the performances of the MMA7455. KISS really works.
Re: The Poor Man Accelerometer.
Rich have you tried the bma020 acc - which is also a "poor man" acc choice ...Can you give a comparison between the two acc's?
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
msev wrote:Rich have you tried the bma020 acc - which is also a "poor man" acc choice ...Can you give a comparison between the two acc's?
Yes and no disrespect to anyone or the product, but for me, it is junk. I have two, one completely failed (stopped working) and the other one will not hold calibration. It drifts all over the place.
http://www.youtube.com/watch?v=UIkPb-qTfT0
Re: The Poor Man Accelerometer.
Good to know, I'll ask at rcgroups if someone knows what could cause problems for some guys with that one,..
Re: The Poor Man Accelerometer.
MacArell wrote:Hi, I'm a newbie and want make a Quadcopter with this Accelerometer Sensor, my sensor is KIT3468MMA7455L (From an old project) i will use an Arduino UNO (From an old project too) and i don't know for the gyro but certainly a WMP...
I'll let you know.
Sylvain
Hi, i want just use this accelerometer with WM+ and i want make a board shield for Ardiuno UNO: for connection diagram i use the pdf file: "MultiWii Connection diagrams v1.8.pdf"
- What diagram is good for MMA7455 and WM+ ?
- In "Multiwii connection diagram with Nunchuk" if i replace Nunchuck with MMA7455 ?
- How i do with 3.3V voltage for MMA7455 ?
Thank , Sylvain.
Last edited by MacArell on Thu Sep 15, 2011 1:55 pm, edited 1 time in total.
Re: The Poor Man Accelerometer.
Hello
I test your code for the MMA7455, but what is with the V1.7 or V1.8 ACC is not recognized.
Do you have a shema connection, I can be assembled incorrectly.
thank's
PS : Sorry for my bad english, I'am French
I test your code for the MMA7455, but what is with the V1.7 or V1.8 ACC is not recognized.
Do you have a shema connection, I can be assembled incorrectly.
thank's
PS : Sorry for my bad english, I'am French
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Here is the WMC version 1.8patch1 with the MMA7455.
- Attachments
-
- MultiWii_1_8_patch1_MMA7455.zip
- Code added for the MMA7455 Accelerometer
- (41.61 KiB) Downloaded 163 times
Re: The Poor Man Accelerometer.
Thank you very much for your code, it works fine on the GUI.
Another question, I did not put logic level converter, I have just connected in parallel the MMA7455 in A4 and A5, it works but I'm afraid of having problems, what do you think.
thank you again
Another question, I did not put logic level converter, I have just connected in parallel the MMA7455 in A4 and A5, it works but I'm afraid of having problems, what do you think.
thank you again
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
It depends upon which one you have and who made it. the one that I purchased from this ebay vendor, you can use 3.3 or 5 volts and do not require the logic changer.
http://www.ebay.com/itm/270808909360?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649
http://www.ebay.com/itm/270808909360?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649
Re: The Poor Man Accelerometer.
It is the same and I have a 3.3 V power supply on my board (personal build), I plugged it on.
Re: The Poor Man Accelerometer.
Thank You, finaly i buy "AeroQuad Shield v1.9" with voltage level converter for my Arduino Uno.
I will use my KIT3468MMA7455L after... thank you again.
Sylvain
I will use my KIT3468MMA7455L after... thank you again.
Sylvain
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Maybe if we are nice to Alex, he will include the code for MMA7455 in the maintained MWC code. In my opinion, there are great for the Multi-Rotor copter environment. They are selling on Ebay for as little as 6 bucks with free shipping.
MMA7455 Acceleration Module Tilt Slant Angle Sensor
http://www.ebay.com/sch/i.html?_from=R40&_trksid=p4634.m570.l1313&_nkw=mma7455&_sacat=See-All-Categories
Feature:
Onboard MMA7455 digital output (I2C/SPI), low power, compact capacitive micromachined accelerometer;
Support 5V/3.3V input , onboard RT9161, lower pressure drop than the 1117, faster load the appropriate speed, ideal for noisy power environment;
Common pin, pin standard 100mil (2.54mm), easy for the matrix board;
PCB size: 26 (mm) x14 (mm)
MMA7455 Acceleration Module Tilt Slant Angle Sensor
http://www.ebay.com/sch/i.html?_from=R40&_trksid=p4634.m570.l1313&_nkw=mma7455&_sacat=See-All-Categories
Feature:
Onboard MMA7455 digital output (I2C/SPI), low power, compact capacitive micromachined accelerometer;
Support 5V/3.3V input , onboard RT9161, lower pressure drop than the 1117, faster load the appropriate speed, ideal for noisy power environment;
Common pin, pin standard 100mil (2.54mm), easy for the matrix board;
PCB size: 26 (mm) x14 (mm)
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Here is a copy of the updated 1.8patch1, I made a mistake in the other copy posted because of the 2's complement. I have corrected the problem and proud to say, the MMA7455 is ROCK SOLID in the MWC 1.8. I had to remove the first bit from the lower byte.
Code: Select all
void ACC_getADC () {
TWBR = ((16000000L / 400000L) - 16) / 2; // change the I2C clock rate to 400kHz speed
i2c_getSixRawADC(MMA7455_ADDRESS,0x00);
ACC_ORIENTATION( ((rawADC[3]<<8) | (rawADC[2]>>1)<<1) ,
((rawADC[1]<<8) | (rawADC[0]>>1)<<1) ,
((rawADC[5]<<8) | (rawADC[4]>>1)<<1) );
ACC_Common();
}
- Attachments
-
- MultiWii_1_8_patch1.zip
- (40.81 KiB) Downloaded 140 times
Re: The Poor Man Accelerometer.
This also works with the 1.8 patch2
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Awesome!
Re: The Poor Man Accelerometer.
Try this
- Attachments
-
- MultiWii_1_8_patch2_MMA7455.rar
- (37.63 KiB) Downloaded 146 times
Re: The Poor Man Accelerometer.
I also bought mma7455 from ebay and I have couple question:
I have 3,3 v from regulator going in ITG 3205(WMP cone) directly with onboard nunchuck pull-up resistors(pullups in software disabled).
Is it ok to connect mma7455 in parallel regarding two pair of pull-up resitors?
What about orientation?
Thank you in advance!
I have 3,3 v from regulator going in ITG 3205(WMP cone) directly with onboard nunchuck pull-up resistors(pullups in software disabled).
Is it ok to connect mma7455 in parallel regarding two pair of pull-up resitors?
What about orientation?
Thank you in advance!
- Attachments
-
- mma4755.jpg
- (5.79 KiB) Not downloaded yet
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
I have had them connected both ways, with the Pullup Resistors enable in the software and without and the MMA7455 worked very well under both conditions. I would suggest using 3.3 volts with the ITG3205 because I have seen some weird behavior running it at 5 volts, the MMA7455 purchased from eBay will operate at either 3.3 or 5 volts. The MMA7455 has built-in Pull-ups so you are good with the ITG3205, just disable the Arduino pull-ups.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Note: When using version 1.8 or higher, make sure to fully check the movements in the Gui, there is a very weird bug that I thought was due to the 2's compliment but I now believe it is related to the Calibration procedure. This bug only shows up when the Calibration Offset value is at a partial value and I don't believe this problem is isolated to just the MMA7455. The Calibration procedures for the MMA7455 is somewhat difference then the other Accelerometers, actually much simpler but I have not made the modifications yet. With version 1.7, the MMA7455 is rock solid.
Re: The Poor Man Accelerometer.
Thank you copterrichie!
-
- Posts: 1
- Joined: Tue Oct 25, 2011 9:14 am
Re: The Poor Man Accelerometer.
GY-29 is a small, thin, low power, 3-axis accelerometer with high resolution (13-bit) measurement at up to ±16 g. Digital output data is formatted as 16-bit twos complement and is accessible through the I2C digital interface. http://module.blog.com/gy-29-3-axis-acc ... r-arduino/
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
misslins2011 wrote:GY-29 is a small, thin, low power, 3-axis accelerometer with high resolution (13-bit) measurement at up to ±16 g. Digital output data is formatted as 16-bit twos complement and is accessible through the I2C digital interface. http://module.blog.com/gy-29-3-axis-acc ... r-arduino/
It used the ADXL345 and is fully supported in the WiiCopter firmware.
Re: The Poor Man Accelerometer.
copterrichie wrote:Note: When using version 1.8 or higher, make sure to fully check the movements in the Gui, there is a very weird bug that I thought was due to the 2's compliment but I now believe it is related to the Calibration procedure. This bug only shows up when the Calibration Offset value is at a partial value and I don't believe this problem is isolated to just the MMA7455. The Calibration procedures for the MMA7455 is somewhat difference then the other Accelerometers, actually much simpler but I have not made the modifications yet. With version 1.7, the MMA7455 is rock solid.
Hi, any progress on this? I mean, is there really problem with the MMA7455 calibration?
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Peck wrote:Hi, any progress on this? I mean, is there really problem with the MMA7455 calibration?
I have not worked on it, been busy with another project. As stated however, just make sure to check using the GUI all sensing directions and make sure there are no abnormal jumps in the readings.
Re: The Poor Man Accelerometer.
copterrichie wrote:I have not worked on it, been busy with another project. As stated however, just make sure to check using the GUI all sensing directions and make sure there are no abnormal jumps in the readings.
Thanks! I just asked, because I think I have the same problem, but I don't know where's the calibration offset. I had issues only on one axis.
I played today a lot with it, and I think I figured it out... I don't know much about microcontrollers, but I had the MMA7445 code from the 1.7 version, which was stable for me too.
This works for me:
Code: Select all
static int8_t rawADC_MMA7455[6];
i2c_rep_start(MMA7455_ADDRESS); // I2C write direction
i2c_write(0x00); //Registry to start reading from.
i2c_rep_start(MMA7455_ADDRESS+1); // I2C read direction => 1
for(uint8_t i = 0; i < 5; i++) {
rawADC_MMA7455[i]= i2c_readAck();}
rawADC_MMA7455[5]= i2c_readNak();
accADC[ROLL] = -((rawADC_MMA7455[1]<<8) | (rawADC_MMA7455[0]>>1)<<1);
accADC[PITCH]= -((rawADC_MMA7455[3]<<8) | (rawADC_MMA7455[2]>>1)<<1);
accADC[YAW] = ((rawADC_MMA7455[5]<<8) | (rawADC_MMA7455[4]>>1)<<1);
ACC_Common();
I know it's not using the i2c_getSixRawADC, but does basically the same, but I figured out, that the "big" difference in 1.7 and 1.8 code is,
that rawADC is uint8_t, but rawADC_MMA7455 is int8_t type, which I used.
I also tried it with the original code (using i2c_getSixRawADC), and only changed the type of rawADC, and the problem disappeared too, but it's not a good idea to change it, my servo gone nuts on my tricopter However the gyro values seemed to be good too on the GUI.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Peck wrote:copterrichie wrote:I have not worked on it, been busy with another project. As stated however, just make sure to check using the GUI all sensing directions and make sure there are no abnormal jumps in the readings.
Thanks! I just asked, because I think I have the same problem, but I don't know where's the calibration offset. I had issues only on one axis.
I played today a lot with it, and I think I figured it out... I don't know much about microcontrollers, but I had the MMA7445 code from the 1.7 version, which was stable for me too.
This works for me:Code: Select all
static int8_t rawADC_MMA7455[6];
i2c_rep_start(MMA7455_ADDRESS); // I2C write direction
i2c_write(0x00); //Registry to start reading from.
i2c_rep_start(MMA7455_ADDRESS+1); // I2C read direction => 1
for(uint8_t i = 0; i < 5; i++) {
rawADC_MMA7455[i]= i2c_readAck();}
rawADC_MMA7455[5]= i2c_readNak();
accADC[ROLL] = -((rawADC_MMA7455[1]<<8) | (rawADC_MMA7455[0]>>1)<<1);
accADC[PITCH]= -((rawADC_MMA7455[3]<<8) | (rawADC_MMA7455[2]>>1)<<1);
accADC[YAW] = ((rawADC_MMA7455[5]<<8) | (rawADC_MMA7455[4]>>1)<<1);
ACC_Common();
I know it's not using the i2c_getSixRawADC, but does basically the same, but I figured out, that the "big" difference in 1.7 and 1.8 code is,
that rawADC is uint8_t, but rawADC_MMA7455 is int8_t type, which I used.
I also tried it with the original code (using i2c_getSixRawADC), and only changed the type of rawADC, and the problem disappeared too, but it's not a good idea to change it, my servo gone nuts on my tricopter However the gyro values seemed to be good too on the GUI.
BINGO!!!
2's Complement!
Re: The Poor Man Accelerometer.
Hi, I was wondering if you all know where I can access the datasheet for the GY-29 accelerometer. I purchased one recently, and don't know what pin is associated with what. Any help is appreciated. Thanks
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
My quick search reveals that the GY-29 MAYBE the same as ADXL345.
http://module.blog.com/gy-29-3-axis-acc ... r-arduino/
http://module.blog.com/gy-29-3-axis-acc ... r-arduino/
Re: The Poor Man Accelerometer.
Yes, it uses the ADXL345, but I don't know what the pins on the breakout board is associated to . There are more pins on the ADXL345 than on board the GY-29 provides
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Sorry, I don't have that information. Would the seller have this information?
Re: The Poor Man Accelerometer.
Hi,
here would be what can help you
flyman777
here would be what can help you
flyman777
- Attachments
-
- GY-29.zip
- (150.03 KiB) Downloaded 268 times
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
Better late than never right? Well, I finally got around to adding code for the MMA7455 to version 1.9 and I also changed the Accelerometer's sensitivity from 2g to 8g.
This copter is using an original WM+ running at 2kHz and the MMA7455 Accelerometer as stated above.
URL Link to code
URL Video of Test Hover
This copter is using an original WM+ running at 2kHz and the MMA7455 Accelerometer as stated above.
URL Link to code
URL Video of Test Hover
-
- Posts: 506
- Joined: Thu May 05, 2011 8:13 am
- Location: Slovenia
Re: The Poor Man Accelerometer.
Hello,
MMA7455 is rated for 3.3V and 5V, does that mean it will work directly connected to Arduino (without level converters)?
Regards Andrej.
MMA7455 is rated for 3.3V and 5V, does that mean it will work directly connected to Arduino (without level converters)?
Regards Andrej.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: The Poor Man Accelerometer.
That would depend upon the breakout board. The ones on Ebay, you can use 3.3 or 5 volts and they have a logic leveler on the board.