03-03-2020, 10:23 PM
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:
Here are some notes from my site:
Thank you for your help!
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:
- Do you have any recommendations for further improvements?
- Is it possible to "smooth" the graph, i.e. to set a higher rate of given datapoints?
- 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?
- How would it be possible to get linear acceleration from a Calliope?
Here are some notes from my site:
- I gave the bluetooth input the somewhat weird name "mi" to let it find the Calliope MIni as well as the MIcro:bit.
- Acceleration data is given in "Micro-g", that's why I added the formula " / 1000 * 9.81 "
- 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>