Show Posts
Pages: [1]
1  Using Arduino / Sensors / Accelerometer MMA7361 readings on: January 20, 2013, 03:17:25 pm
I have problems with the sparkfun MMA7361 readings, I only detect significant changes when for example, rotate the accelerometer along it's x axis (the y value changes indicating up/down), and so on, but when I move the accelerometer up and down and not along one axis, I don't detect anything, what's the problem with my readings... Thanks... PD, I connected all of the pins except ST (selftest) and the 0g and gselec....


Code:
#include <AcceleroMMA7361.h>

AcceleroMMA7361 accelero;

int x_change;
int y_change;

int x;
int y;
int z;
void setup()
{
 Serial.begin(9600);
 accelero.begin(13, 12, 11, 10, A4, A2, A0);
 accelero.setARefVoltage(5);
 accelero.calibrate();
}
void loop()
{
  x_change = x - accelero.getXAccel();
  y_change = y - accelero.getYAccel();
  x = accelero.getXAccel();
  y = accelero.getYAccel();
  
  if(x_change > 20)
  {
    Serial.print("LEFT\t");
  }
  else if (x_change < -20)
  {
    Serial.print("RIGHT\t");
  }
  else
  {
    Serial.print("NONE\t");
  }
  
  if(y_change > 15)
  {
    Serial.print("DOWN\n");
  }
  else if(y_change < -15)
  {
    Serial.print("UP\n");
  }
  else
  {
    Serial.print("NONE\n");
  }
  delay(500);
}
2  Using Arduino / General Electronics / Re: MMA7361 3 axis accelerometer and arduino UNO on: December 28, 2012, 06:11:06 am
It would be Ok If I make a voltage divider to drop 5v to 3.3v for the input pins of the accelerometer?
3  Using Arduino / General Electronics / MMA7361 3 axis accelerometer and arduino UNO on: December 27, 2012, 08:17:53 pm
Hi, I would like to know how to connect MMA7361 3 axis accelerometer, because in sparkfun's web page

https://www.sparkfun.com/products/9652

says that works with a 3.3v voltage, The arduino UNO have a 3.3v that can be used, but what about the rest of the output pins (the X,Y,Z out I suppose that can be connected directly to the analog input pins but I expect that I will receive bad readings because the UNO is 5V) and input pins (I suppose If I connect digital pins of the UNO directly to the other MMA7361 pines I would broke the accelerometer because of the voltage).... someone can help me on how to connect this accelerometer ??

Schematic of the accelerometer

http://sparkfun.com/datasheets/Sensors/Accelerometer/MMA7361-Breakout-v11.pdf

Thanks.
4  Using Arduino / General Electronics / Re: voltage divider? on: December 23, 2012, 06:08:04 pm
ok, then.. what is the purpose of connecting the LDR and the analog pins if you will get 1023 ever?? (the pictures was taken from a book and reads the data in the analog pin in both cases)
5  Using Arduino / General Electronics / voltage divider? on: December 23, 2012, 05:52:44 pm
look at these 2 images (look at the LDR part):

1. http://imageshack.us/a/img809/5138/99917903.png
2. http://imageshack.us/a/img72/6295/11723497.png

I know that the first circuit is a voltage divider, but what about the second one? is a voltage divider too? what is the difference between them? (suppose that the resistor is 100ohms and tghe LDR of 10K) what will be the Vout of each resistor/LDR in each image??

Thanks.
6  Using Arduino / General Electronics / Re: analog pins and resistors on: December 22, 2012, 08:49:36 pm
Thanks for the info, the open collectors clarify the questions about resistors in IC, but Do I need to suppose open collectors are used in all IC that outputs analog signals, or like the ICs, depend on the manufacturer?, second as I said before it clarify the question only for the ICs, seeing this circuit for example

http://imageshack.us/photo/my-images/27/74765784.png/

to me, It's like is a pull resistor, then my next question is.... components based on variable resistors can generate an open circuit, or that image uses the resistor as a divider?, and how do you identified that was a pull resistor/divider (because to me It's a pull resistors because provides a path to 5v or GND)

Thanks.
7  Using Arduino / General Electronics / Re: analog pins and resistors on: December 22, 2012, 07:23:02 pm
like for example viewing some examples of books, piezo sounders connected to analog pins I see that uses resistors, flex sensors, ultrasonic rangefinders, LDR (another resistor than itself) too... but in accelerometers I don't see that uses resistors.
8  Using Arduino / General Electronics / analog pins and resistors on: December 22, 2012, 06:45:44 pm
my question is very simple, Do I need to connect resistors to any electronic component connected that outputs analog signals? and why?, and what happens when I don't do that?

Thanks.
Pages: [1]