Accelerometer fried?

By the stupid thing I think I just did you would never know I have been playing with electronics since we used tubes.
Hooked up a MMA77361L triple axis analog accelerometer, for a very simple tilt sense project. The example program had a self test portion that sent a signal from pin 12 on the Arduino to the breakout board.
Now while I made sure the power in was 3.3v, it didn’t dawn on me until the 3rd board wouldn’t change the value of any of the output pins that the 5v digital high signal for that the Arduino puts out probably fried the chip. According to the datasheet, it can only take Vdd (3.3v) for a high value for the self test function.
Do I need to order more (notice I don’t even think I will need just one) accelerometers and use a voltage limiting circuit on the self test pin to keep from frying them?
This is the really simple example I was using to test things.

#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.getXVolt();
  y = accelero.getYVolt();
  z = accelero.getZVolt();
  Serial.print("\nx: ");
  Serial.print(x);  
  Serial.print("mV\ty: ");
  Serial.print(y);  
  Serial.print("mV\tz: ");
  Serial.print(z);
  Serial.print("mV");
  delay(500); //make it readable
}

All values returned through the serial monitor are steady in the center of the value range (aprox. 1.62v) on all pinouts no matter how I move the board.
Please no chastising, I feel dumb enough already. A simple yes, no or DUUUH will do.
TomJ

Next time, put a 1K resistor between your part and the Arduino. This will protect the 3.3v part.

// Per.

Thanks Zapro, Yeah I figured. I've got 3.3v zeners, and LM33Ls I can use too, just forgot. I was hoping I was forgetting something in the code. Oh well, it's just money. TomJ

I wouldn't think that sending a 5 Volt signal for a self-test would burn out the whole board. You may want to look at your code a little closer. For example, aren't x, y and z supposed to be doubles instead of integers? And I always set the pinMode, either INPUT or OUTPUT for the pins, though I don't know if that matters.

Don't feel bad. I burnt out my $25 accelerometer by mistakenly sticking its ground wire in the 5 Volt bus on the breadboard. The smell of something hot alerted me to my stupidity. But too late. The board was ruined.

Dannii, Thanks. The code came from examples included with the library download. I didn't write it, just trying to get the board to work. I have looked at other accelerometer examples and they are similar. I do get values from the accelerometer, whether I use the voltage sketch or two others that give either raw data or g-force values, they just don't change from mid range of AREF when I move or tilt the board. I have tried running the sketch with the self test pin removed and also with the calibrate lines in the code commented out. Still no change in the output values of the axises to the Arduino. This won't be the first time I have tried to design something that took a few tries, so I'll try again. Tomj

Solved!!
Used an example sketch for a completely different analog accelerometer and now I can get the output numbers to change.The library for the MMA7361 that I was using doesn’t seem to work.
If you have time, look back at the code above and see the calls to the functions to the library are labeled accelero.xxxx but in the .cpp file for the library they are labeled acceleroMMA7361.xxxx
example:

///


/// constructor
///

AcceleroMMA7361::AcceleroMMA7361()
Could this be the problem? I don’t know how to look at the library .h file to check there.
Thanks again for the help.

TomJ

At least it looks like your board is still working. That's good.

I tried to find out more about that library, and had difficulty finding the latest version of the library and the example code you mentioned. My own experience with libraries like that has not been good. It's often easier just to write the code myself than to figure out how the library works. Sometimes adding a layer of abstraction helps. Sometimes it doesn't.

Dannii, I found the homepage of the library http://code.google.com/p/mma7361-library/ and the download I have is the latest but he has a revision he has here http://code.google.com/p/mma7361-library/source/detail?r=3805d151fe69dfe02a01ca97bc65253dbf213226 has the new code for Arduino 1.0, I just don't know how to get it into my library. What opens a .h library file for editing?

Tumbleweed: What opens a .h library file for editing?

I always use Microsoft Visual Studio C++ Express. That's a bloated program but it works well for me. I'm sure there are other text editors that would work too, but I don't know what they are.

I took a look at the library, but I'm no expert on libraries and could not figure out how to use it, or what your problem might be. Perhaps a new post in the "programming questions" section of the forum might get more attention than you will get here in the electronics section under "Accelerometer fried?" as a title.

As mentioned, with my accelerometer, I found it easy to just write the code myself. Just do an analogRead on the pin you have the axis output wired into. Worked great until I burned out my board by hooking the ground wire up to power. Good to know your board still works.