Tutorial.Memsic2125 History

Hide minor edits - Show changes to markup

June 02, 2010, at 06:04 PM by Equipo Traduccion -
Changed lines 3-12 from:

El Memsic 2125 (datasheet) es un acelerómetro de dos ejes capaz de medir la aceleración hasta más / menos 2g. Posee una simple conexión digital: dos pines (uno para cada eje) emiten pulsos cuyo ciclo de trabajo (Duty cycle) corresponde con la aceleración de cada eje.


Memsic 2125 Accelerometer

The Memsic 2125 (datasheet) is a two-axis accelerometer capable of measuring acceleration up to plus or minus 2g. It has a simple digital interface: two pins (one for each axis) emit pulses whose duration corresponds to the acceleration of that axis.

Circuit

to:

El Memsic 2125 (datasheet) es un acelerómetro de dos ejes capaz de medir la aceleración hasta más/menos 2g. Posee una simple conexión digital: dos pines (uno para cada eje) emiten pulsos cuya duración corresponde con la aceleración de cada eje.

Circuito

Changed lines 9-12 from:

Schematic:

click the image to enlarge

to:

Esquemático

Pincha en la imágen para verla en grande

Changed lines 15-20 from:

The 5V pin and GND pins on the Arduino are connected to the 5V and GND pins of the Memsic 2125; digital pin 2 of the Arduino is connected to the X out pin of the Memsic, and digital pin 3 is connected to the Y out pin.

Code

to:

Los pines de 5V y GND (Tierra) de Arduino están conectados a los pines 5V y GND del Memsic 2125; el pin digital 2 de Arduino está conectado al pin de salida X del Memsic 2125 y el pin digital 3 está conectado al pin de salida Y.

Programa

June 02, 2010, at 05:48 PM by Equipo Traduccion -
Added lines 1-6:

Acelerómetro Memsic 2125

El Memsic 2125 (datasheet) es un acelerómetro de dos ejes capaz de medir la aceleración hasta más / menos 2g. Posee una simple conexión digital: dos pines (uno para cada eje) emiten pulsos cuyo ciclo de trabajo (Duty cycle) corresponde con la aceleración de cada eje.


February 24, 2010, at 04:29 AM by Tom Igoe -
Changed lines 23-42 from:
 /*
    Memsic2125
    
    Read the Memsic 2125 two-axis accelerometer.  Converts the
    pulses output by the 2125 into milli-g's (1/1000 of earth's
    gravity) and prints them over the serial connection to the
    computer.
    
    The circuit:
 	* X output of accelerometer to digital pin 2
 	* Y output of accelerometer to digital pin 3
 	* +V of accelerometer to +5V
 	* GND of accelerometer to ground
   
    http://www.arduino.cc/en/Tutorial/Memsic2125
    
    created 6 Nov 2008
    by David A. Mellis
    modified 30 Jun 2009
    by Tom Igoe
to:
Changed lines 25-66 from:
to:
July 05, 2009, at 07:47 PM by Tom Igoe -
Changed lines 21-34 from:

[@ /*

   Memsic2125

   Read the Memsic 2125 two-axis accelerometer.  Converts the
   pulses output by the 2125 into milli-g's (1/1000 of earth's
   gravity) and prints them over the serial connection to the
   computer.

   The circuit:
	* X output of accelerometer to digital pin 2
	* Y output of accelerometer to digital pin 3
	* +V of accelerometer to +5V
	* GND of accelerometer to ground
to:
Changed lines 23-63 from:
   http://www.arduino.cc/en/Tutorial/Memsic2125
to:
 /*
    Memsic2125
    
    Read the Memsic 2125 two-axis accelerometer.  Converts the
    pulses output by the 2125 into milli-g's (1/1000 of earth's
    gravity) and prints them over the serial connection to the
    computer.
    
    The circuit:
 	* X output of accelerometer to digital pin 2
 	* Y output of accelerometer to digital pin 3
 	* +V of accelerometer to +5V
 	* GND of accelerometer to ground
   
    http://www.arduino.cc/en/Tutorial/Memsic2125
    
    created 6 Nov 2008
    by David A. Mellis
    modified 30 Jun 2009
    by Tom Igoe

  */

 // these constants won't change:
 const int xPin = 2;		// X output of the accelerometer
 const int yPin = 3;		// Y output of the accelerometer

 void setup() {
   // initialize serial communications:
   Serial.begin(9600);
   // initialize the pins connected to the accelerometer
   // as inputs:
   pinMode(xPin, INPUT);
   pinMode(yPin, INPUT);
 }

 void loop() {
   // variables to read the pulse widths:
   int pulseX, pulseY;
   // variables to contain the resulting accelerations
   int accelerationX, accelerationY;
Changed lines 65-110 from:
   created 6 Nov 2008
   by David A. Mellis
   modified 30 Jun 2009
   by Tom Igoe

 */

// these constants won't change: const int xPin = 2; // X output of the accelerometer const int yPin = 3; // Y output of the accelerometer

void setup() {

  // initialize serial communications:
  Serial.begin(9600);
  // initialize the pins connected to the accelerometer
  // as inputs:
  pinMode(xPin, INPUT);
  pinMode(yPin, INPUT);

}

void loop() {

  // variables to read the pulse widths:
  int pulseX, pulseY;
  // variables to contain the resulting accelerations
  int accelerationX, accelerationY;

  // read pulse from x- and y-axes:
  pulseX = pulseIn(xPin,HIGH);  
  pulseY = pulseIn(yPin,HIGH);

  // convert the pulse width into acceleration
  // accelerationX and accelerationY are in milli-g's: 
  // earth's gravity is 1000 milli-g's, or 1g.
  accelerationX = ((pulseX / 10) - 500) * 8;
  accelerationY = ((pulseY / 10) - 500) * 8;

  // print the acceleration
  Serial.print(accelerationX);
  // print a tab character:
  Serial.print("\t");
  Serial.print(accelerationY);
  Serial.println();

  delay(100);

} @]

to:
June 30, 2009, at 11:52 PM by Tom Igoe -
Changed lines 22-35 from:

int xpin = 2; int ypin = 3;

void setup() {

  Serial.begin(9600);
  pinMode(xpin, INPUT);
  pinMode(ypin, INPUT);

}

void loop() {

  int pulseX, pulseY;
  int accX, accY;
to:

/*

   Memsic2125

   Read the Memsic 2125 two-axis accelerometer.  Converts the
   pulses output by the 2125 into milli-g's (1/1000 of earth's
   gravity) and prints them over the serial connection to the
   computer.

   The circuit:
	* X output of accelerometer to digital pin 2
	* Y output of accelerometer to digital pin 3
	* +V of accelerometer to +5V
	* GND of accelerometer to ground
Changed lines 36-38 from:
  // read pulse from x- and y-axes
  pulseX = pulseIn(xpin,HIGH);  
  pulseY = pulseIn(ypin,HIGH);
to:
   http://www.arduino.cc/en/Tutorial/Memsic2125

   created 6 Nov 2008
   by David A. Mellis
   modified 30 Jun 2009
   by Tom Igoe

 */

// these constants won't change: const int xPin = 2; // X output of the accelerometer const int yPin = 3; // Y output of the accelerometer

void setup() {

  // initialize serial communications:
  Serial.begin(9600);
  // initialize the pins connected to the accelerometer
  // as inputs:
  pinMode(xPin, INPUT);
  pinMode(yPin, INPUT);

}

void loop() {

  // variables to read the pulse widths:
  int pulseX, pulseY;
  // variables to contain the resulting accelerations
  int accelerationX, accelerationY;
Added lines 64-67:
  // read pulse from x- and y-axes:
  pulseX = pulseIn(xPin,HIGH);  
  pulseY = pulseIn(yPin,HIGH);
Changed lines 69-72 from:
  // accX and accY are in milli-g's: earth's gravity is 1000.
  accX = ((pulseX / 10) - 500) * 8;
  accY = ((pulseY / 10) - 500) * 8;
to:
  // accelerationX and accelerationY are in milli-g's: 
  // earth's gravity is 1000 milli-g's, or 1g.
  accelerationX = ((pulseX / 10) - 500) * 8;
  accelerationY = ((pulseY / 10) - 500) * 8;
Changed lines 75-77 from:
  Serial.print(accX);
  Serial.print(" ");
  Serial.print(accY);
to:
  Serial.print(accelerationX);
  // print a tab character:
  Serial.print("\t");
  Serial.print(accelerationY);
June 30, 2009, at 11:47 PM by Tom Igoe -
Changed lines 3-4 from:

The Memsic 2125 (datasheet) is a two-axis accelerometer capable of measuring up to plus or minus 2g. It has a simple digital interface: two pins (one for each axis) emit pulses whose duration corresponds to the acceleration of that axis.

to:

The Memsic 2125 (datasheet) is a two-axis accelerometer capable of measuring acceleration up to plus or minus 2g. It has a simple digital interface: two pins (one for each axis) emit pulses whose duration corresponds to the acceleration of that axis.

Added lines 9-16:

Schematic:

click the image to enlarge

November 07, 2008, at 10:20 AM by David A. Mellis -
Changed lines 3-4 from:

The Memsic 2125 is a two-axis accelerometer capable of measuring up to plus or minus 2g. It has a simple digital interface: two pins (one for each axis) emit pulses whose duration corresponds to the acceleration of that axis.

to:

The Memsic 2125 (datasheet) is a two-axis accelerometer capable of measuring up to plus or minus 2g. It has a simple digital interface: two pins (one for each axis) emit pulses whose duration corresponds to the acceleration of that axis.

Changed lines 9-46 from:
to:

The 5V pin and GND pins on the Arduino are connected to the 5V and GND pins of the Memsic 2125; digital pin 2 of the Arduino is connected to the X out pin of the Memsic, and digital pin 3 is connected to the Y out pin.

Code

int xpin = 2;
int ypin = 3;

void setup()
{
  Serial.begin(9600);
  pinMode(xpin, INPUT);
  pinMode(ypin, INPUT);
}

void loop()
{
  int pulseX, pulseY;
  int accX, accY;

  // read pulse from x- and y-axes
  pulseX = pulseIn(xpin,HIGH);  
  pulseY = pulseIn(ypin,HIGH);

  // convert the pulse width into acceleration
  // accX and accY are in milli-g's: earth's gravity is 1000.
  accX = ((pulseX / 10) - 500) * 8;
  accY = ((pulseY / 10) - 500) * 8;

  // print the acceleration
  Serial.print(accX);
  Serial.print(" ");
  Serial.print(accY);
  Serial.println();

  delay(100);
}

November 06, 2008, at 06:27 PM by David A. Mellis -
Added lines 1-9:

Memsic 2125 Accelerometer

The Memsic 2125 is a two-axis accelerometer capable of measuring up to plus or minus 2g. It has a simple digital interface: two pins (one for each axis) emit pulses whose duration corresponds to the acceleration of that axis.

Circuit

Share