This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Calliope Mini as external Accelerometer
#1
Question 
Dear phyphox-Team,

first of all: Thanks for your great work! Phyphox is a wonderful piece of software.

I would like to use a Calliope mini in conjunction with phyphox as an accelerometer.
(background: exploring the periodic movement of a spring by students in secondary education)
Therefor I was able to edit the following configuration of a new bluetooth experiment.

Here are my questions:

  1. Do you have any recommendations for further improvements?
  2. Is it possible to "smooth" the graph, i.e. to set a higher rate of given datapoints?
  3. After filing the buffer, old data points are deleted (as expected) but the time line (x-Axis) does not keep in sync, it keeps staying static. Any ideas?
  4. How would it be possible to get linear acceleration from a Calliope?

Here are some notes from my site:

  1. I gave the bluetooth input the somewhat weird name "mi" to let it find the Calliope MIni as well as the MIcro:bit.
  2. Acceleration data is given in "Micro-g", that's why I added the formula " / 1000 * 9.81 "
  3. I was only able to get results within phyphox after using the beta editor makecode.calliope.cc/beta for starting the bluetooth service on the Calliope. As I'm using phyphox on iPads in the class it would be easier to use the Calliope Mini App, which is currently (to my understanding) not possible. I will discuss this in the Calliope forum later.

Thank you for your help!


Code:
<phyphox xmlns="http://phyphox.org/xml" xmlns:editor="http://phyphox.org/editor/xml" version="1.7" editor:version="1.0" locale="en">
    <title>Acceleration Calliope</title>
    <category>Bluetooth</category>
    <description>Reads the acceleration sensor and plots a graph</description>
    <link label="Documentation of BLE micro:bit">https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html</link>
    <translations>
        <translation locale="de">
            <title>Beschleunigung Calliope</title>
            <string original="Acceleration x">Beschleunigung x</string>
            <string original="Acceleration y">Beschleunigung y</string>
            <string original="Acceleration z">Beschleunigung z</string>
            <string original="Absolute">Betrag</string>
            <string original="Acceleration">Beschleunigung</string>
        </translation>
    </translations>
    <data-containers>
        <container size="1" static="false">Ax_mg</container>
        <container size="1" static="false">Az_mg</container>
        <container size="0" static="false">t</container>
        <container size="1" static="false">Ay_mg</container>
        <container size="1000" static="false">A_abs</container>
        <container size="1000" static="false">Ax</container>
        <container size="1000" static="false">Ay</container>
        <container size="1000" static="false">Az</container>
    </data-containers>
    <input>
        <bluetooth id="Accelerometer" name="mi"  mode="notification" rate="1" subscribeOnStart="false">
            <output char="E95DCA4B-251D-470A-A062-FA1922DFA9A8" conversion="int16LittleEndian" offset="0">Ax_mg</output>
            <output char="E95DCA4B-251D-470A-A062-FA1922DFA9A8" conversion="int16LittleEndian" offset="2">Ay_mg</output>
            <output char="E95DCA4B-251D-470A-A062-FA1922DFA9A8" conversion="int16LittleEndian" offset="4">Az_mg</output>
            <output char="E95DCA4B-251D-470A-A062-FA1922DFA9A8" conversion="string" extra="time">t</output>
        </bluetooth>
    </input>
    <output>
    </output>
    <analysis sleep="0"  onUserInput="false">
        <formula formula="([1]/1000)*9.81">
            <input as="in" clear="false">Ax_mg</input>
            <output as="out" clear="false">Ax</output>
        </formula>
        <formula formula="([1]/1000)*9.81">
            <input as="in" clear="false">Ay_mg</input>
            <output as="out" clear="false">Ay</output>
        </formula>
        <formula formula="([1]/1000)*9.81">
            <input as="in" clear="false">Az_mg</input>
            <output as="out" clear="false">Az</output>
        </formula>
        <formula formula="(sqrt([1]*[1]+[2]*[2]+[3]*[3])/1000)*9.81">
            <input as="in" clear="false">Ax_mg</input>
            <input as="in" clear="false">Ay_mg</input>
            <input as="in" clear="false">Az_mg</input>
            <output as="out" clear="false">A_abs</output>
        </formula>
    </analysis>
    <views>
        <view label="Graph">
            <graph label="Acceleration x" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="true" history="1" labelX="t" labelY="a" labelZ="" unitX="s" unitY="m/s²" unitZ="" logX="false" logY="false" logZ="false" xPrecision="2" yPrecision="2" zPrecision="2" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"      >
                <input axis="x">t</input>
                <input axis="y">Ax</input>
            </graph>
            <graph label="Acceleration y" aspectRatio="2.5" style="lines" lineWidth="1" color="00ff00" partialUpdate="false" history="1" labelX="t" labelY="a" labelZ="" unitX="s" unitY="m/s²" unitZ="" logX="false" logY="false" logZ="false" xPrecision="2" yPrecision="2" zPrecision="2" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"      >
                <input axis="x">t</input>
                <input axis="y">Ay</input>
            </graph>
            <graph label="Acceleration z" aspectRatio="2.5" style="lines" lineWidth="1" color="0000ff" partialUpdate="false" history="1" labelX="t" labelY="a" labelZ="" unitX="s" unitY="m/s²" unitZ="" logX="false" logY="false" logZ="false" xPrecision="2" yPrecision="2" zPrecision="2" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"      >
                <input axis="x">t</input>
                <input axis="y">Az</input>
            </graph>
        </view>
        <view label="Absolute">
            <graph label="Acceleration" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="t" labelY="a" labelZ="" unitX="s" unitY="m/s²" unitZ="" logX="false" logY="false" logZ="false" xPrecision="2" yPrecision="2" zPrecision="2" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"      >
                <input axis="x">t</input>
                <input axis="y">A_abs</input>
            </graph>
        </view>
    </views>
    <export>
    </export>
</phyphox>
Reply


Messages In This Thread
Calliope Mini as external Accelerometer - by Jonathan Haug - 03-03-2020, 10:23 PM

Forum Jump: