MPU 6050 gyro/accelerometer for limit switch replacement

The concept: I got the idea that I could use one of these to do the function of three limit switches but my knowledge is extremely limited and I have some questions.

The hardware: A lever travels in a vertical arc from almost straight down to almost straight up. Think standard light switch with a ten inch lever.

The goal: mount the sensor directly on the lever to sense (the angles of) the two extremes of travel and an additional intermediate position.

My reasoning: It would be mechanically simpler to do this than to mount and tweak/adjust multiple switches.

So, in no particular order:

  • I saw in a YT video reply this quote: “You can use the DMP (digital motion processor) built in to the MPU6050 to get the rotation angles, including yaw. The DMP has some sort of algorithm that corrects reasonably well for drift in yaw.” Does this mean correction only occurs in the Z axis?

  • The reported angles must be repeatable over hundreds of cycles. Is this possible? Apparently the numbers drift off of their starting point. Would periodic recalibration/zeroing be needed?

  • Will it make a difference whether the sensor board is mounted horizontally, affecting the X or Y axis or vertical, affecting only the Z axis?

  • Do any wireless versions exist – even if by other manufacturers – at a hobbyist price point?

  • Referring to the previous item, if a wireless unit is not available, what pieces would be needed to cobble one together?

  • Would one wireless method be preferred over another?

Thanks for your replies.

An accelerometer can be used with a microprocessor to measure tlit angles for stationary objects. Basically you use it to know the direction of "down". Google "tilt sensing accelerometer" for details.

All accelerometers need a micro and power supply to do that, so you would be trading one set of complications for another. I think lever-type limit switches or "rolling ball" tilt sensor switches would be simpler and more reliable.