Measuring lengths, only with the Calliope mini Board? How's that supposed to work? With this question in mind I woke up one day and immediately started to search for a solution. In order to find something suitable you have to come up with a workaround.The idea for it comes from the physical laws of the pendulum. See pendulum on Wikipedia popup: yes. Because the whole thing looks relatively simple in the result I would like to present it here as a small project. This should also be a suggestion to think about what stands beyond this project and if you can use things differently than given.
Required hardware components and additional material
1 x Calliope mini
approximately 2 meters gift ribbon
A visual demonstration of this project can be seen on YouTube popup: yes. Unfortunately the descriptions are only available in German.
The battery pack is attached to the Calliope mini board with the help of a rubber band which is included in the delivery. The cord or band is tied at the top. That's it.
Calliope mini and band together form a pendulum whose length can be calculated from the pendulum time. To determine this time, the acceleration sensor is interrogated during the pendulum movement.
In the PXT block program comments are defined as description variables for better readability. The duration of an oscillation is determined over the current running time. If two oscillations in succession are approximately equal (5% deviation), the mean value is used for the length calculation. This looks somewhat strange because of the integer calculations.
The output is not always as accurate as seen in the video, but the deviation is mostly within a range of +- 2cm.