Author Topic: Accelerometer use?  (Read 9816 times)

0 Members and 1 Guest are viewing this topic.

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: gb
  • Electronics Engineer - Tinkerer - Nerd
Accelerometer use?
« on: May 13, 2013, 07:50:20 pm »
Hello today i recieved one MMA7361 Accelerometer unit.
First i would like to know
How you can read an accelerometer ... for example the output in the z axis is 800 what that 800 means.
Also what is a gyroscope.... i could not find a video that was only about the gyroscope
And third how can i hook it up to my arduino ... i read the datasheet but i keep wiring it wrong and getting some values that wont change.Also there are no videos showing how to wire it ...
To sum up ... i got an accelerometer that i dont know how to read it or use it .. and i dont know some practical uses for it ...
Thank you and i am sorry for some of my questions but i could not get answers to them
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2425
  • Country: de
    • Frank Buss
Re: Accelerometer use?
« Reply #1 on: May 13, 2013, 08:01:58 pm »
A quick Google search shows this page:

http://arduino.alhin.de/index.php?n=21

The same Google search gives you this datasheet link:

http://www.freescale.com/files/sensors/doc/data_sheet/MMA7361L.pdf

On page 3 it says typical 800 mV/g. I guess the value you are measuring is mV, and if you are not living on the moon, it should show 1 g.

But I can't answer, why you get it, if you don't have practical use for it. Maybe try again Google, with something like "accelerometer projects", and pick one of the 2 million results which you like.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: gb
  • Electronics Engineer - Tinkerer - Nerd
Re: Accelerometer use?
« Reply #2 on: May 13, 2013, 08:07:24 pm »
A quick Google search shows this page:

http://arduino.alhin.de/index.php?n=21

The same Google search gives you this datasheet link:

http://www.freescale.com/files/sensors/doc/data_sheet/MMA7361L.pdf

On page 3 it says typical 800 mV/g. I guess the value you are measuring is mV, and if you are not living on the moon, it should show 1 g.

But I can't answer, why you get it, if you don't have practical use for it. Maybe try again Google, with something like "accelerometer projects", and pick one of the 2 million results which you like.
Thanks the datasheet is fine i checked that too but with this wiring the sensor did not work....
Anyway the other site saved my life i can tell!!! ill try this method of wiring it and see what comes up its in German but its ok ich spreche English und Deutch :P (i am not so fluent but still :D)
 

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: gb
  • Electronics Engineer - Tinkerer - Nerd
Re: Accelerometer use?
« Reply #3 on: May 13, 2013, 08:13:27 pm »
I dont know.... the wiring looks fine but i still get some fixed values (x: 519   y: 519   z: 583)
I dont know ill try changing example
The example i have uploaded
Code: [Select]
#include <AcceleroMMA7361.h>

AcceleroMMA7361 accelero;
int x;
int y;
int z;

void setup()
{
  Serial.begin(9600);
  accelero.begin(13, 12, 11, 10, A0, A1, A2);
  accelero.setARefVoltage(3.3);                   //sets the AREF voltage to 3.3V
  accelero.setSensitivity(LOW);                   //sets the sensitivity to +/-6G
  accelero.calibrate();
}

void loop()
{
  x = accelero.getXRaw();
  y = accelero.getYRaw();
  z = accelero.getZRaw();
  Serial.print("\nx: ");
  Serial.print(x);
  Serial.print("\ty: ");
  Serial.print(y);
  Serial.print("\tz: ");
  Serial.print(z);
  delay(500);                                     //(make it readable)
}
Maybe my accelerometer is broken....
 

Online PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5514
  • Country: nl
Re: Accelerometer use?
« Reply #4 on: May 13, 2013, 08:35:58 pm »
I dont know.... the wiring looks fine but i still get some fixed values (x: 519   y: 519   z: 583)

You realise that nothing will change if you leave it sitting on the table?
Keyboard error: Press F1 to continue.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2425
  • Country: de
    • Frank Buss
Re: Accelerometer use?
« Reply #5 on: May 13, 2013, 08:40:47 pm »
The values look wrong, at least for x/y it should be different from z, if lying parallel to Earth (x=0g, y=0g, z=1g).

Did you use some sort of breakout board, like on the webpage? You should check all connections with a multimeter, if all pins have the right voltage when powered, e.g. VDD=Sleep=3.3V etc. X/Y/Z-out voltage should change, if you turn it. Measure it with disconnected X/Y/Z cables to your Arduino, maybe you've connected the wrong pins on your Arduino side. Then you could connect just the X/Y/Z pins of the Arduino side to 3.3V and then to 0V and see if the console output changes, to check this.

I hope you didn't use 5V for the digital control pins for sleep, g-select etc.? I don't know if you can change this for the Arduino, because if it was 5V, your accelerometer might be broken now.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4720
  • Country: au
  • Question Everything... Except This Statement
Re: Accelerometer use?
« Reply #6 on: May 13, 2013, 08:51:23 pm »
if you drive a car, set it up to log or display the forces applied in the vehicle, there are actually commercial products like this used to help train early drivers, mainly with braking and turns,
 

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: gb
  • Electronics Engineer - Tinkerer - Nerd
Re: Accelerometer use?
« Reply #7 on: May 14, 2013, 06:52:38 am »
I dont know.... the wiring looks fine but i still get some fixed values (x: 519   y: 519   z: 583)

You realise that nothing will change if you leave it sitting on the table?
But of course i dont leave it on the table :P i hooked up the accelerometer with female to male cables to the arduino so i can swing it freely!!!
 

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: gb
  • Electronics Engineer - Tinkerer - Nerd
Re: Accelerometer use?
« Reply #8 on: May 14, 2013, 06:59:04 am »
The values look wrong, at least for x/y it should be different from z, if lying parallel to Earth (x=0g, y=0g, z=1g).

Did you use some sort of breakout board, like on the webpage? You should check all connections with a multimeter, if all pins have the right voltage when powered, e.g. VDD=Sleep=3.3V etc. X/Y/Z-out voltage should change, if you turn it. Measure it with disconnected X/Y/Z cables to your Arduino, maybe you've connected the wrong pins on your Arduino side. Then you could connect just the X/Y/Z pins of the Arduino side to 3.3V and then to 0V and see if the console output changes, to check this.

I hope you didn't use 5V for the digital control pins for sleep, g-select etc.? I don't know if you can change this for the Arduino, because if it was 5V, your accelerometer might be broken now.
No i thought that i broke it too but when i checked the wiring it ws properly hooked up :S
And i checked the connections again :
ST --12
GS--10
GND-GND
3.3--3.3
5--5
X-A0
Y-A1
Z-A2
SL-13
OG-11
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: Accelerometer use?
« Reply #9 on: May 14, 2013, 07:09:57 am »
And which variety of Arduino are you using?
Disregard...It'll never work...
« Last Edit: May 14, 2013, 07:20:11 am by Skimask »
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: gb
  • Electronics Engineer - Tinkerer - Nerd
Re: Accelerometer use?
« Reply #10 on: May 14, 2013, 07:19:58 am »
And which variety of Arduino are you using?
I am using Funduino (a copy of arduino that served my well for months now) and the Chip it uses i an Atmel ATMEGA 2560 16AU 2245
And i have 2 of these but the accelerometer was use with only one of them
 

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: Accelerometer use?
« Reply #11 on: May 14, 2013, 07:21:01 am »
So, you're using an Arduino that normally runs at 5v logic outputs, with a chip that requires no more than 3.3v at it's logic inputs?
How does that work?
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 

Offline ChrisGreece52Topic starter

  • Frequent Contributor
  • **
  • Posts: 832
  • Country: gb
  • Electronics Engineer - Tinkerer - Nerd
Re: Accelerometer use?
« Reply #12 on: May 14, 2013, 07:28:19 am »
So, you're using an Arduino that normally runs at 5v logic outputs, with a chip that requires no more than 3.3v at it's logic inputs?
How does that work?
I did not quite get that ... sorry... but my setup is an Funduino Mega 2560 (Same product as arduino Mega) And an accelerometer (MMA7361) hooked up to it and it does not work. ...
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2425
  • Country: de
    • Frank Buss
Re: Accelerometer use?
« Reply #13 on: May 14, 2013, 12:52:41 pm »
There are different Arduino types. The German wikipedia page has a nice table: http://de.wikipedia.org/wiki/Arduino-Plattform The important aspect is the operating voltage (Betriebsspannung). If it is 5V, and if you have just a breakout board for your accelerometer without voltage level shifter ICs on it, then this might be the reason that it doesn't work. Because when the operating voltage of the Arduino is 5V, then the voltage at the IO pins are 5V, too (see the schematic of the standard Arduino, http://arduino.cc/en/uploads/Main/arduino-uno-schematic.pdf : VCC of the Atmega8 is 5V, and then the datasheet of the Atmega 8: http://www.atmel.com/Images/Atmel-2486-8-bit-AVR-microcontroller-ATmega8_L_datasheet.pdf page 235: output high voltage at VCC 5V for 20mA is min 4.2V, so if you draw less than 20mA, the output voltage can be nearly 5V). Unfortunately the datasheet for the accelerometer is not very detailed (or I didn't find it), but you can assume, that it is not allowed to apply higher voltages than the operating voltage VDD at the logic input pins. Maybe there a MMA7361 version of the chip, without the "L" suffix for 5V? You might be lucky, because the digital pins of the Arduino might not deliver enough current to destroy the accelerometer, but it might not work while overvoltage is applied.

So next step would be as explained before: test the accelerometer without the Arduino connected and a multimeter, then test the Arduino pins without the accelerometer connected. If both works, the higher voltage on the control pins might be the reason that it doesn't work. You can use a resistor divider to reduce the voltage from 5V to 3.3V (Arduino out -> 3.9k -> 2.2k -> GND, use the junction at 3.9k/2.2k to connect to the accelerometer).

Sorry if it sounds a bit tedious to read all the documentation, to think about it and to do all the measurements and tests, but there is no free lunch, if you want to build something yourself :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->