Hi,
I want to measure how much my accelerometer is 'moving' or 'tilting'. How can I do this?
I'm using ADXL335 as my accelerometer. The aim of the project is to play a sound file repeatedly based on the acceleration / movement of the accelerometer. The more the accelerometer is 'moving', or accelerating, I want the faster the interval/tempo of the sound file playing.
(i.e. Bigger the difference between the previous reading and 'current' reading, faster the tempo. So if previousReading = 300 and current reading = 310, difference is 10, which is almost no acceleration so tempo should NOT change. If previous reading = 0 and currentReading = 200, difference is 200, which should be big enough so tempo should change)
The thing to note is, the accelerometer is hanging loose on a string.
So the 'zero' (reference) always changes when I hang them (because it's not on a flat&static surface.)
It would mean a lot if you can help me out.
Thanks.
With what? Doing your project for you? We're here to help you if you got stuck with a problem but not to do your job. If you haven't done anything with an Arduino, start with an easier project to get familiar with the IDE and the framework. If you've already done some projects with the Arduino IDE try reading out the sensor you've chosen. Write some code to implement the "algorithm" you described above. Once you got that and still have some problems with some details, post links to all the hardware you're using, post links to all the used libraries and post your actual code (don't forget the code tags, that's the </> button in the editor). If you use more hardware than just an Arduino, also post a wiring diagram so we see how you connected everything.
I don't own one of those but I did enter into my favorite search engine the following "Measuring Accelerometer (ADXL335)'s tilt's motion" and got many useful and informative results.