Shop OBEX P1 Docs P2 Docs Learn Events
Accelerometer help — Parallax Forums

Accelerometer help

jayee165jayee165 Posts: 6
edited 2011-10-12 12:59 in General Discussion
I recently purchased the memsic accelerometer for a project. I am not quite understanding the correct use of it. Attached to a breadboard is the accelerometer and 9 volt battery. I am aware that the acceleromater only requires 3 to 5 volts, but I also used 4.5 volts and recieved the same outcome. I wired the accelerometer as instructed by it data sheet. The X and Y reads to be around 3.8 Volts flat on the ground. Aren't they suppose to read 0 Volts until I start to tilt it? I seen some projects use a resistor coming out of the X and Y outputs. Will I need to use a resistor and what size? Lastly, a microcontroller is mainly used when u want to read the data coming from the accelerometer on a computer screen?

Comments

  • FranklinFranklin Posts: 4,747
    edited 2011-10-11 20:16
    If you provide data like the part number, a link to the data sheet, a schematic of how you have it connected and the method of testing perhaps you will get help. Did you buy any of this from Parallax?
  • jayee165jayee165 Posts: 6
    edited 2011-10-11 20:39
    sorry I thought that i gave sufficient amount of information. It is the memsic 2125 accelerometer. Its available on
    proj1.jpg
    the Parallax website. The link for the data sheet is http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/28017-Memsic2Axis-v2.0.pdf
    proj2.jpg
    1024 x 1372 - 181K
    1024 x 765 - 105K
  • sylvie369sylvie369 Posts: 1,622
    edited 2011-10-11 20:45
    Why did you connect a 9V battery to it? The Vdd is supposed to be no more than 5 VDC.
  • jayee165jayee165 Posts: 6
    edited 2011-10-11 21:05
    At the moment I dont have the correct material to connect 3- 5 volts. I only have the correct material to connect 9 volts. My partner has that correct material. But we also received the same results when we used 4.5 volts. At first we used the 9 volts and seen that it was too much volts. After that we have been using the 4.5 volts. Hopefully, we didnt damage it. I used the 9 volts right now to take a picture of the reading. Which that reading is the same for both 4.5 volts and 9 volts.
  • shimniokshimniok Posts: 177
    edited 2011-10-11 22:57
    All the accelerometers I've used or read about measure + and - acceleration. This one measures -3g to +3g. The analog sensors output a range from 0V to VDD to represent the range from -max to +max, so 0g acceleration doesn't correspond to 0V. E.g. if the range is 0-3V, then the mid point is 1.5V which represents 0 accel.

    BUT....

    If you read the datasheet, this Parallax-packaged device outputs a PWM signal, not an analog voltage. "Each axis has a 100 Hz PWM duty cycle output in which acceleration is proportional to the ratio tHx/Tx."

    You can measure the signal with a microcontroller capable of counting the duration of the high pulse width. "This is easy to accomplish with the BASIC Stamp PULSIN command or with the Propeller chip’s counter modules." My DMM has a %duty measurement; I would expect this would work, too. Hope this helps.

    I also hope you didn't fry the chip but there's a pretty fair chance you did.
  • sylvie369sylvie369 Posts: 1,622
    edited 2011-10-12 04:35
    jayee165 wrote: »
    At the moment I dont have the correct material to connect 3- 5 volts. I only have the correct material to connect 9 volts. My partner has that correct material. But we also received the same results when we used 4.5 volts. At first we used the 9 volts and seen that it was too much volts. After that we have been using the 4.5 volts. Hopefully, we didnt damage it. I used the 9 volts right now to take a picture of the reading. Which that reading is the same for both 4.5 volts and 9 volts.

    I have no idea whether or not 9 volts will fry that chip, but it's well outside of the limits in the user materials. Unless you know a LOT more than I do about these things, you should never exceed those limits. The Memsic data sheet says
    ABSOLUTE MAXIMUM RATINGS*
    Supply Voltage (VDD, VDA) ………………...-0.5 to +7.0V

    so you're not quite as far from the limits as you'd think based just on the Parallax documentation, but you're still outside the manufacturer's "absolute maximum". Unless you know something I don't know, don't do this.
    =====================
    I just put a Parallax 2125 into a breadboard, and fed it 5 volts. I can measure the output using just a voltmeter. When it's laying flat, I get about 2.5 volts - the midscale voltage you'd expect, given that it is at the 0 G point. When I tilt it one direction, it goes up to a little over 3 volts, or about 1/3rd of the way to the 5V maximum - again, what you'd expect from going from 0 G to 1 G (1/3rd of the unit's 3 G max). When I tilt it the other way, I go about the same distance down.

    If you're putting in 4.5 volts, you should get about 2.25 volts when it's laying flat on the ground. If you're not, I'm afraid my best guess is that you fried it with the 9V.
  • jayee165jayee165 Posts: 6
    edited 2011-10-12 06:58
    From the information I have recieved from you all and how it should work, the accelerometer is still functional. Mainly, I am trying to accomplish my accelerometer to work in a certain way. If I tilt the accelerometer past a certain angle, I would like for a buzzer and a LED to come on. Right now its not working in that manner because the outputs are going to constantly read a voltage. I had the buzzer and LED connected to the outputs and they were always on. From my understanding of what you all are telling me, I am going to need a microcontroller for this project because it is not going to function how I planned. Is this item sufficient for my needs. http://www.parallax.com/Store/Microcontrollers/BASICStampProgrammingKits/tabid/136/List/0/ProductID/297/Default.aspx?SortField=ProductName%2cProductName My partner is trying to go an easier route. He wants to use a resistor on the outputs then connect it to a the buzzer and LED. He is throwing ideals about a voltage divider and etc. There is not an exact angle that the accelerometer needs to be tilted to make the buzz and LED go on. So, he is saying hopefully we can skip the programming and microcontroller part and trick it to work in our favor. Which route would you all suggest?
  • RDL2004RDL2004 Posts: 2,554
    edited 2011-10-12 07:16
    It sounds like what you really want is a tilt sensor and not an accelerometer.
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-10-12 07:24
    Rather than the BASIC Stamp kit you selected, maybe one of the propeller based platforms?

    Gadget Gangster's USB Propeller Platform http://www.parallax.com/Store/Microcontrollers/PropellerDevelopmentBoards/tabid/514/CategoryID/73/List/0/SortField/0/Level/a/ProductID/711/Default.aspx

    Propeller Demo Board: http://www.parallax.com/Store/Microcontrollers/PropellerDevelopmentBoards/tabid/514/CategoryID/73/List/0/SortField/0/Level/a/ProductID/340/Default.aspx

    These offer the much more capable Propeller micro-controller for less money plus there is demo code in the library that comes with the Propeller Software tool. I plugged my accelerometer into a breadboard, wired it up and was running the demo program in no time.

    I don't think you can get it to do anything without a micro-controller.
  • ercoerco Posts: 20,259
    edited 2011-10-12 08:51
    RDL2004 wrote: »
    It sounds like what you really want is a tilt sensor and not an accelerometer.

    At $5, that tilt sensor is quite a bargain. Unfortunately, it looks like it's always triggered in one of the 4 directions, there's no provision for level.

    If that doesn't work for you, jayee165, consider ball tilt switches or even mercury switches (if you can find them). You could wire your LEDs & buzzer directly thru the mercury switch, no uC required.
  • RDL2004RDL2004 Posts: 2,554
    edited 2011-10-12 10:00
    Well, they only mentioned one angle, but it looks like if it was mounted vertically it would give two distinct signals for either right/left or forward/back. Two of them, mounted vertically and perpendicular to each other would give distinct signals for forward, back, left and right. It's not clear from the datasheet, but I'm assuming the view is from above, looking down at the chip.
    412 x 227 - 50K
  • jayee165jayee165 Posts: 6
    edited 2011-10-12 10:51
    Hey guys, thanks so much for the help, suggestions, and information. I have one last question. Say that i program the microcontroller to be aware of when the acceleromerter's tilt angles. Once the angle reaches a desired number it will trigger the buzzer and LED. If and once the angle goes back to zero, i want the buzzer and LED to stay on. What type of switch or item do u suggest I use? Or can that be implemented in my code for the microcontroller?
  • SRLMSRLM Posts: 5,045
    edited 2011-10-12 11:50
    jayee165 wrote: »
    Hey guys, thanks so much for the help, suggestions, and information. I have one last question. Say that i program the microcontroller to be aware of when the acceleromerter's tilt angles. Once the angle reaches a desired number it will trigger the buzzer and LED. If and once the angle goes back to zero, i want the buzzer and LED to stay on. What type of switch or item do u suggest I use? Or can that be implemented in my code for the microcontroller?

    You can implement this is code. It would have a flow something like this:
    1. Wait for correct tilt
    2. Turn on buzzer and LED
    3. Endless loop
    
  • ercoerco Posts: 20,259
    edited 2011-10-12 12:59
    Mercury switch and SCR. Google it. Simple.
Sign In or Register to comment.