# using an acceleromter to detect wand movement is my theory correct?

I am wanting to make a Persistance of vision wand that times lighting up and the order of displaying the leds to show the message based on detecting a waving motion and its direction, my plan is to use a 3 axis accelerometer.

The plan would be

add all three accelerometer axis value together to produce a resultant acceleration vector R where

R= Sqrt(x^2+y^2+z^2)

if the accelerometer is slowly moved around rotated but not vigorously waved my theory would be that this vector would just represent G due to gravity and would be close to 1G (using whatever scale factor the accelerometer uses)

If the resultant vector R was significantly different from 1G ie <0.5 or >1.5 than then this would imply that it had received significant additional acceleration (>0.5G) and was being waved. I would then check that this acceleration was along the axis of the message ie right angles to the wand by checking that the acceleration in this direction had also changed significantly, if this was so i would start lighting up my leds in an order determined by the direction of the acceleration.

Before i start building and coding do people think my theory is correct or do i need a more complex movement detection system system

I think you need an mpu, to precisely detec motion movements and map them to your animation on the POV.

Ummm ok these are quite pricey, my understanding is that with the three axis gyroscope you can extract the effect of gravity from the accelerometer and so use the accelerometer to identify all non gravitational accelerations and also detect rotational motion and orientation this is great but i think for my specific requirement this maybe overkill as all i’m interested in is if the wand is being waved quickly in 1 axis so with the following algorithm:

step 1 look for significant change in the resultant acceleration vector R (this means the accelerometer is being accelerated externally not just tilted around) if yes then step 2 if no step 1

step 2 detect if there has been significant change in the acceleration along the axis of the message if yes step 3 if no step 1

step 3 record direction of significant change in the acceleration along axis of message then step 4

step 4 display message forwards or backwards depending on direction of acceleration

I think this will work if you disagree then please explain why ??

Off course yeah, The tilt on a single axis can work forya, I think when you'll wave the wand or hand I mean make waving movements on one side, the accelerometer is going to repeat the movement on that side more than one time and as such I think you can code to recognize such multiple travelling movements to a single side.

i suppose the best way is to record data from the three axis whilst waving the wand around and look at the data and see if it makes sense.

i suppose the ×best way is to record data from the three axis whilst waving the wand around and look at the data and see if it makes sense.

We do not need to load the MCU with extra axis data and commence on some conditions the reason is that the only time other axis would be useful is when you want to note that whether the waving hand or wand is tilted backwards or forwards which I think isn't needed by you.

The easiest and fastest but somewhat inaccurate way to implement what you are talking about is to use the Portrait and Landscape register data which is available in most of the accelerometers out there, so if its like potrait and goes to landscape right then it means 50% of the wave thats one way is completed ,so something like that added with some additional tricky coding may help recognizing the wave in the correct direction the easy and fast way.

i'm using this accelerometer: