So now I can convert accelerometer output to tilt angle, and more importantly, so can the Arduino. When the Arduino knows the angle, it can use trigonometry to find dimensions of right triangles. Every different tilt angle creates a new triangle in which the arm is the hypotenuse and the other two sides are vertical or horizontal. The length of the hypotenuse (arm) is known, as is the height of the arm’s pivot point. So the Arduino can compute the length of each triangle’s adjacent side and derive the height of the arm’s end above the floor (Figure 4).
Figure 4. The Arduino can derive the height of the arm above the floor because it is told two of the other three dimensions and given a good hint about the angle. It computes the angle and then the adjacent side and then the height.
Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!
Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: A New Arduino MicroPython Package Manager, How-Tos and Much More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi
EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey