Return to Video

36C3 - phyphox: Using smartphone sensors for physics experiments

  • 0:00 - 0:20
    36C3 preroll music
  • 0:20 - 0:28
    Herald-Angel: Good. Ladies and gentlemen,
    we have here a talk by Sebastian Staacks.
  • 0:28 - 0:30
    Do I pronounce this well?
    Sebastian Staacks: Yes.
  • 0:30 - 0:33
    Herald: Yes. Staacks. Staacks. [In German]
    Ich musste das mal in Deutsch sagen. And
  • 0:33 - 0:41
    he's related to the University of Aachen.
    He did a PhD physics. And he was in a team
  • 0:41 - 0:47
    that developed a fantastic application, as
    I mentioned earlier on. He developed the
  • 0:47 - 0:52
    app phyphox. Do I pronounce this well?
    Staacks: I would say phi-phox, physical
  • 0:52 - 0:55
    phone experiments.
    Herald: Okay. Yep. Of course. I'm sorry.
  • 0:55 - 1:02
    I'm not in that kind of department. But
    this application actually gives you all
  • 1:02 - 1:07
    the possibilities off your the usage, off
    your smart smartphone. Really? Really
  • 1:07 - 1:13
    extending certain borders, to my opinion.
    So please give a warm, warm welcome here
  • 1:13 - 1:14
    to Stefan.
  • 1:14 - 1:21
    Applause
  • 1:21 - 1:25
    Stefan: Thank you. Thank you for the
    introduction and welcome everybody to my
  • 1:25 - 1:31
    talk. Yeah. As you've just heard, I'm a
    physicist from the RWTH Aachen university
  • 1:31 - 1:36
    where I developed the app phyphox. Phyphox
    is an app for those of you who do not know
  • 1:36 - 1:41
    it already. That uses the sensors in the
    smartphone for physics teaching. So the
  • 1:41 - 1:46
    idea is that students can use their own
    phones to do experimentation in class, in
  • 1:46 - 1:52
    the lecture hall. So for schools and
    universities. I should explain. That in
  • 1:52 - 1:56
    contrast to some other talks by me. This
    one will not be that much about education
  • 1:56 - 2:00
    because it is the chaos communication
    Congress and this is the hardware track
  • 2:00 - 2:05
    here. So I tried to tell you a little bit
    about the app, a little bit about the
  • 2:05 - 2:10
    sensors that we have on our phones and.
    Yeah. Would we love to get in touch with
  • 2:10 - 2:15
    some, especially people from maker
    community and from open source communities
  • 2:15 - 2:21
    to find some connections, how he can get
    many open source projects together?
  • 2:21 - 2:25
    Because I've got so much feedback from
    teachers and I think I could also use some
  • 2:25 - 2:32
    feedback from other developers as well. So
    I would like to start with a short
  • 2:32 - 2:37
    explanation of what we actually do. So
    yes, I said I come from a university and
  • 2:37 - 2:42
    there we have this introductionary lecture
    for physics students, which is called
  • 2:42 - 2:47
    experimental physics one. And it's typical
    lecture. Looks like this. We have a fancy
  • 2:47 - 2:52
    new lecture hall by now, but the situation
    is the same. We've got 300 I think 370
  • 2:52 - 2:57
    students this year sitting in a lecture
    hall and doing no experimentation at all.
  • 2:57 - 3:00
    There's only one guy experimenting and
    that's the professor. And the students are
  • 3:00 - 3:06
    sitting there and enjoying the whole show
    like they would enjoy a YouTube video and
  • 3:06 - 3:10
    maybe they are mildly amused if something
    goes wrong. OK. And we thought we could
  • 3:10 - 3:14
    change this by using the sensors in the
    smartphones. We're not the first ones with
  • 3:14 - 3:18
    the idea to use the sensors there, but for
    some reason we decided to write our own
  • 3:18 - 3:23
    app, which turned out to be quite
    successful then. So in contrast to the old
  • 3:23 - 3:26
    version where students just had to look at
    and I'll get the assignments where they
  • 3:26 - 3:30
    can do their own experiments with their
    own measurement devices. And to give you
  • 3:30 - 3:35
    an idea of what this looks like. I would
    like to start with the first experiment.
  • 3:35 - 3:39
    Which is about centrifugal acceleration or
    centripetal acceleration depending on your
  • 3:39 - 3:45
    preferred frame of reference. So the idea
    is from a rotation movement, we want to
  • 3:45 - 3:50
    measure the radial acceleration as a
    function of the angular velocity. So the
  • 3:50 - 3:55
    rotation rate. To do this we take a
    regular smartphone, this is an iPhone 8 in
  • 3:55 - 4:00
    this case and we put it into a salad
    spinner. Okay. We get some rotation in
  • 4:00 - 4:10
    there and whoops let me just place it in
    there. Sound is not important, but it
  • 4:10 - 4:17
    sounds nice. I have been told. So here we
    get the live data from the phone already.
  • 4:17 - 4:23
    Acceleration on the y axis and angular
    velocity on the x axis. If the salad
  • 4:23 - 4:27
    spinner is actually moving. And what you
    see is the faster I rotate the spinner,
  • 4:27 - 4:32
    the farther on the right you get your data
    because that's angular velocity and also
  • 4:32 - 4:37
    the radial acceleration increases. If I'm
    not going too fast because then I do not
  • 4:37 - 4:42
    get any data at all anymore. Let's slow
    down again and we can fill up the gaps
  • 4:42 - 4:48
    there by going really slow and filling up
    this path. And in the end, if so, who here
  • 4:48 - 4:55
    has a physics background some more than
    expected. Great. Because those of you who
  • 4:55 - 4:59
    just raised their hands would not be
    surprised that we expect a square
  • 4:59 - 5:03
    relationship between the radial
    accaleration and angular velocity. Those
  • 5:03 - 5:08
    of you who do not know will believe me
    from this plot where on the x axis we've
  • 5:08 - 5:13
    got the angle of velocity squared and on
    the y axis the radial acceleration we get
  • 5:13 - 5:18
    a straight line and that's what you would
    expect. So besides the physics, because
  • 5:18 - 5:22
    this is not that much about the physics.
    This is a simple experiment all our
  • 5:22 - 5:26
    students could do and actually they ge, we
    gave them this assignment. We gave them
  • 5:26 - 5:31
    also a bonus point if they created a
    video. Don't worry. Their consent to that
  • 5:31 - 5:34
    we use the video was not related to the
    point, they first got the point and then
  • 5:34 - 5:39
    we asked for their consent to use the
    video. And we learned two things from
  • 5:39 - 5:44
    these videos. A Our students do not really
    have salad spinners. they've got bicycles
  • 5:44 - 5:49
    and office chairs, but b and that was the
    most important thing. It looks like I
  • 5:49 - 5:55
    mean, these are from this year where we
    got almost 100 videos they we actually
  • 5:55 - 5:58
    could trigger them to go out, search for
    something where they've got the
  • 5:58 - 6:05
    rotationary movement and they could repeat
    this experiment. Ok. Another example which
  • 6:05 - 6:09
    actually changed just the course of the
    lecture a little bit is a situation where
  • 6:09 - 6:14
    we first give the assignment before we
    actually let them, before we actually
  • 6:14 - 6:19
    discuss the theory behind this, which
    means in this example, this is a little bit
  • 6:19 - 6:25
    older because we did not get there yet this
    year, we assigned our students to build
  • 6:25 - 6:30
    string pendulums. They look very similar
    because we were very precise about how
  • 6:30 - 6:35
    they should build them. And then we had an
    online form where they could submit the
  • 6:35 - 6:39
    length of their pendulum and the frequency
    they received from it that they measured
  • 6:39 - 6:44
    with the pendulum. They should do this for
    three different cases. And the idea was
  • 6:44 - 6:49
    that we did this assignment long before we
    discussed the pendulum in the lecture so
  • 6:49 - 6:53
    that they have got a little bit of
    research experience. And after we
  • 6:53 - 6:57
    collected all the data from them, then the
    lecture would discuss the pendulum. So the
  • 6:57 - 7:02
    physicists were there now. We do a small
    angle, approximation solving differential
  • 7:02 - 7:05
    equation. All this theory stuff. And in
    the end we were done, we could tell our
  • 7:05 - 7:09
    students, well, we do not have to do this
    experiment on stage. Now, because all of
  • 7:09 - 7:14
    you did this experiment and we simply can
    compare the theory that we just arrived
  • 7:14 - 7:19
    with your data. And it worked out quite
    well. So you see most of the white points,
  • 7:19 - 7:23
    which is the data from the students
    matches the theory, which is the orange
  • 7:23 - 7:28
    line, except maybe for those three who
    should proceed on a career of theoretical
  • 7:28 - 7:33
    physics. But yeah, so this is all
    something got nice feedback from and this
  • 7:33 - 7:38
    is in principle how we use the app and
    what it's designed for. There are also of
  • 7:38 - 7:42
    course many applications in school by now.
    More teachers use this in school than we
  • 7:42 - 7:46
    use it at the university. So we take this
    into consideration as well. But that's the
  • 7:46 - 7:49
    reason that I am standing here talking
    about the sensors in the smartphone.
  • 7:49 - 7:55
    That's the reason that I am trying to
    access them. so let's have a look at what
  • 7:55 - 7:59
    sensors we actually have in our phone. I
    think the first one that most of you would
  • 7:59 - 8:04
    think often talking about sensors besides
    obvious stuff like the microphone would be
  • 8:04 - 8:10
    the accelerometer. So I think yeah, I
    think I first explain how the
  • 8:10 - 8:14
    accelerometer works. OK, so the
    accelerometer in your phone is actually a
  • 8:14 - 8:18
    so-called MEMS device. MEMS is M E M S
    stands for Micro Electrical Mechanical
  • 8:18 - 8:24
    System and it looks roughly like this.
    It's a simplification. If you search for
  • 8:24 - 8:29
    actual MEMS devices, simply search for M E
    M S and accelerometer and you find some
  • 8:29 - 8:31
    pictures. They usually are a little bit
    more complicated, although the
  • 8:31 - 8:36
    accelerometer is not that much more
    complicated. It consists of an orange
  • 8:36 - 8:40
    case. Yeah, well so far so obvious, but
    also two contacts. The blue and the red
  • 8:40 - 8:45
    one and important part is this silvery
    structure here or the metallic structure
  • 8:45 - 8:49
    which is under etched its bit hard to see
    on this picture, but it's actually
  • 8:49 - 8:53
    floating. It's only attached to the sides,
    you see light in between here. So if you
  • 8:53 - 8:59
    move around, the accelerometer the inner
    path, can actually move. So let's do this.
  • 8:59 - 9:04
    So at each point where the device is extra
    riding in one direction or the other
  • 9:04 - 9:11
    direction, due to inertia the that the
    metallic part in here is distorted, moved
  • 9:11 - 9:16
    into one direction and we can measure the
    amount by which it is deflected by this
  • 9:16 - 9:21
    movement with the two contacts by
    measuring the capacity between these
  • 9:21 - 9:26
    structures. So that's the principle of the
    accelerometer. One thing to mention at
  • 9:26 - 9:33
    this point is that it's in the sense of
    physics. It does not really only measure
  • 9:33 - 9:37
    acceleration. It measures acceleration you
    see in this image of the device
  • 9:37 - 9:41
    accelerating. We get some data, but if you
    imagine we take this device and rotate it
  • 9:41 - 9:47
    like this, then of course you also get a
    deflection of the of the metallic part by
  • 9:47 - 9:51
    gravity. So gravity is pulling it down as
    well. And that's the main reason the
  • 9:51 - 9:56
    accelerometer is in there because the
    developers and manufacturers of the phones
  • 9:56 - 10:00
    are not really interested in measuring
    acceleration, at least there aren't that
  • 10:00 - 10:04
    many use cases for it. But instead, what
    they want to have is an indication on
  • 10:04 - 10:08
    which direction is down or which direction
    is up. So when you rotate the screen of
  • 10:08 - 10:13
    your phone, actually they can rotate the
    content of the phone as well or with this
  • 10:13 - 10:18
    you can also then control video games by
    tilting your phone and stuff like this.
  • 10:18 - 10:24
    Because gravity also deflects the
    accelerometers. Earth's acceleration,
  • 10:24 - 10:27
    which you try to avoid because from
    didactic point of view, this is a
  • 10:27 - 10:34
    nightmare to distinguish these both. But
    the point is that we can detect rotations
  • 10:34 - 10:39
    like this and this is pretty much in every
    phone. I mean, this is not really a
  • 10:39 - 10:43
    statistic. This is just the first pie
    chart we have about availability. I have
  • 10:43 - 10:48
    never encountered a single phone or tablet
    that does not have an accelerometer. So if
  • 10:48 - 10:54
    anyone ever encountered some special
    device, some very unique device that
  • 10:54 - 10:57
    doesn't have one. Let me know because I
    would be interested in this at least. I do
  • 10:57 - 11:01
    not know of any device on which phyphox
    actually runs, which doesn't have an
  • 11:01 - 11:07
    accelerometer. A bit more interesting is
    which data rate we can achieve. So most
  • 11:07 - 11:12
    accelerometers have several hundred
    samples per second. Actually the fastest
  • 11:12 - 11:19
    ones go up to 500 hertz and but there are
    also many devices that only do one hundred
  • 11:19 - 11:24
    hertz That's 100 values per second. These
    are mostly the cheaper Android devices and
  • 11:24 - 11:29
    all the iPhones. So I think the internal
    accelerometer will do more on an iPhone.
  • 11:29 - 11:35
    But I have to admit, at some point I can
    understand why they might limit this. But
  • 11:35 - 11:39
    on an iPhone, you get 100 hertz. That's
    the limit. From the API, what you can get
  • 11:39 - 11:46
    there. But this is actually quite a lot. I
    will later see what we can do with this.
  • 11:46 - 11:50
    And one other point about calibration of
    this thing. Actually for all the sensors
  • 11:50 - 11:55
    to get reasonable units from the system so
    the acceleration is given in meter per
  • 11:55 - 12:00
    square second. I just realized that if I
    get the units, that's something I would
  • 12:00 - 12:06
    really tell my students. But yeah. So on
    the x axis, it's a meter per square second
  • 12:06 - 12:11
    and you see that as a wide range of values
    that you get there. So this data is from
  • 12:11 - 12:15
    our sensor database. I would mention it
    later as well. This is contribution from
  • 12:15 - 12:19
    our users what data there this. This only
    absolute value that we get from resting
  • 12:19 - 12:24
    phones and we would expect nine point
    eight one meter per square second for
  • 12:24 - 12:29
    earth acceleration. There are some local
    variation, but not on that scale. So do
  • 12:29 - 12:33
    not expect your sensors to be well
    calibrated. Also, if you've got any app
  • 12:33 - 12:38
    that tells you you can push a single
    button and then calibrates your sensor,
  • 12:38 - 12:43
    don't trust it. It's not that simple.
    These sensors may have different errors on
  • 12:43 - 12:49
    each axis. They're all 3D sensors we've
    got an X, Y and z axis. These errors can
  • 12:49 - 12:52
    be linear errors so you have to multiply a
    correction. It could be an offset. So it
  • 12:52 - 12:57
    would have to add an correction. And on
    top of this, the entire device could be
  • 12:57 - 13:01
    tilted within your phone. OK. So actually,
    if you look into the data sheets of the
  • 13:01 - 13:07
    accelerometer, they have some tolerance on
    how much they might already be shifted or
  • 13:07 - 13:11
    rotated within the package. And when
    soldering it into the phone, I would
  • 13:11 - 13:15
    assume there will be an additional error.
    I've seen so many different errors on
  • 13:15 - 13:20
    different phones. It's not that easy to
    simply calibrate that. But let me give you
  • 13:20 - 13:25
    an example of what you can do with it. Or
    just a quick look first. So we see in our
  • 13:25 - 13:29
    app. Yeah. So this is phyphox. OK. Thank
    you. Got this. You have an entry
  • 13:29 - 13:34
    acceleration with G. That's the extra raw
    data from the sensor or as raw as we get
  • 13:34 - 13:41
    it. If I started you see if I shake it,
    you get some readings there. It's fast.
  • 13:41 - 13:46
    It's already great. You can apply to
    pendulum and measure the acceleration of
  • 13:46 - 13:52
    the pendulum like this. But something I
    want to demonstrate is that we can also
  • 13:52 - 13:56
    get the frequencies from this data by
    doing a fourier transform and calculating
  • 13:56 - 14:02
    the frequency spectrum of this exploration
    data and to demonstrate this I brought a
  • 14:02 - 14:08
    little device a old hard disk drive. It says
    it's broken, but it's still rotating and
  • 14:08 - 14:14
    that's important part for us. So if I
    place my phone on top of it, start the
  • 14:14 - 14:20
    measurement. Turn on the hard disk drive.
    And then you see a peak showing up in the
  • 14:20 - 14:25
    spectrum and it settles at 120 hertz. If
    you don't believe me. Unfortunately, we
  • 14:25 - 14:28
    don't have a camera here right now. You
    can later have a look. It's supposed to
  • 14:28 - 14:34
    run at seven thousand two hundred RPM,
    which is 120 hertz. We can even get a time
  • 14:34 - 14:39
    resolution of this. So if I turn it off
    again, you see how the frequency drops
  • 14:39 - 14:47
    down. And if I turn it on again. There it
    comes up again. OK. So this an example of
  • 14:47 - 14:49
    what you can do. It's great for students
    that can check if the washing machine at
  • 14:49 - 14:54
    home is working properly or they can
    check other things. But usually I do not
  • 14:54 - 15:00
    like to bring washing machines to talks.
    So I used the hard disk drive here. One
  • 15:00 - 15:04
    other thing you might have noticed before
    is that we've actually got acceleration
  • 15:04 - 15:10
    with G and acceleration without G. The
    second one is actually a sensor that
  • 15:10 - 15:16
    removes Earth's gravity. So if I start the
    one with G, you will notice that down here
  • 15:16 - 15:22
    on the Z, the axis you still have the 9.81
    meter per square second, which is great
  • 15:22 - 15:26
    because if i rotate the phone. This
    contribution goes to other axis and we can
  • 15:26 - 15:29
    determine the orientation of the phone.
    But this is bad actually for dedactics
  • 15:29 - 15:33
    because actually the phone is resting.
    It's not moving at all. There's no
  • 15:33 - 15:37
    velocity involved. There's no
    acceleration. So luckily, there's also an
  • 15:37 - 15:43
    acceleration without G, which gives us
    roughly 0 an all axis unless I actually
  • 15:43 - 15:48
    accelerate this thing. Problem with this
    is this is only a virtual sensor. This is
  • 15:48 - 15:52
    a sensor that's fusing the data from the
    accelerometer with an additional sensor
  • 15:52 - 15:57
    like the gyroscope. So we can actually
    distinguish between rotating the phone or
  • 15:57 - 16:02
    accelerating it in one or the other
    direction. Usually you only get
  • 16:02 - 16:07
    acceleration without G. If you also have a
    gyroscope in your phone, I've seen two or
  • 16:07 - 16:10
    three devices that offer you acceleration
    without G, even though they don't have a
  • 16:10 - 16:17
    gyroscope. This case, don't trust them.
    This is merely guessing. OK. So it's. They
  • 16:17 - 16:24
    probably have only low frequency filter
    on top of this, or they're averaging out
  • 16:24 - 16:30
    your movement and this doesn't really work
    for anything. Yeah so that's the
  • 16:30 - 16:34
    accelerometer or one other thing I want to
    mention is if you look into the API to
  • 16:34 - 16:38
    access the sensors yourself for some
    reason you will notice acceleration
  • 16:38 - 16:42
    without G is usually called linear
    acceleration in our app since it's made
  • 16:42 - 16:45
    for teaching. We decided to call it with
    and without G. So if you find
  • 16:45 - 16:49
    accelerometer, that's the one with G and
    linear acceleration is the one without G.
  • 16:49 - 16:55
    If you look at other apps or the API.
    Okay. Next up, I already mentioned this
  • 16:55 - 17:00
    one is a gyroscope. If you have, some
    physics background. Then when you think of
  • 17:00 - 17:05
    a gyroscope, you're thinking of a device
    that's spinning fast so it has some angular
  • 17:05 - 17:10
    momentum and then usually you want it to
    be heavy and to have the weight at the
  • 17:10 - 17:16
    large radius. We've got a strong moment of
    inertia so that you get when it's spinning
  • 17:16 - 17:21
    fast, a strong, angular momentum and due
    to the conservation of angular momentum.
  • 17:21 - 17:25
    These spinning devices can keep an axis
    regardless of rotating the frame around
  • 17:25 - 17:30
    it. That's what I was thinking about, a
    gyroscope of what I think is a gyroscope.
  • 17:30 - 17:35
    When you just give me the term out of
    context, of course, a heavy, huge, fast
  • 17:35 - 17:38
    spinning device is the last thing you want
    in your phone. So that's not what's meant
  • 17:38 - 17:43
    with the gyroscope when people are talking
    about gyroscopes in your phone. Instead
  • 17:43 - 17:48
    there again you have a MEMS device. So
    again, micro electromechanical system. You
  • 17:48 - 17:52
    notice this looks almost exactly like
    accelerometer. If you look for real
  • 17:52 - 17:56
    devices, those are actually much more
    complicated because they need some
  • 17:56 - 18:02
    specific geometry to make sure that they
    do not act like an accelerometer. But the
  • 18:02 - 18:08
    principle is easy to explain with the same
    geometry. So we again have this floating
  • 18:08 - 18:14
    metallic part and we've got 2 contacts. So
    again, we've got a part that can wobble in
  • 18:14 - 18:18
    this direction here. But on top of this,
    we've got the motion that's perpendicular
  • 18:18 - 18:23
    to this. So this is now not depicting the
    motion of your phone, but this is
  • 18:23 - 18:27
    depicting a vibration that the gyroscope
    does by itself all the time. So there are
  • 18:27 - 18:31
    different ways to build them. Some have a
    rotary motion, some have this linear
  • 18:31 - 18:35
    motion. Also, the way to create this
    motion makes this device so much more
  • 18:35 - 18:39
    complicated. But in principle, it's a
    similar structure which is vibrating forth
  • 18:39 - 18:46
    and back and now if you add rotation to
    it. It's a little bit hard to see it as
  • 18:46 - 18:51
    it's rotating the inner part now suddenly
    gets deflected. That's changed, right?
  • 18:51 - 18:55
    Frame of reference. So let's get the
    camera in sync with this device. What you
  • 18:55 - 19:00
    now see is that the inner part is moving
    left and right, although the device itself
  • 19:00 - 19:06
    is only moving up and down. And the reason
    is I don't want to deduce it entirely
  • 19:06 - 19:10
    here, but most of you probably have heard
    of it. This is the Coriolis effect. So,
  • 19:10 - 19:15
    yes, in fact, your phone is determining
    the rotation rate of your phone, not the
  • 19:15 - 19:18
    actual angle, but the rotation rate or
    angular velocity due to the coriolis
  • 19:18 - 19:25
    effect, which is just mind blowing if you
    do some of the calculations. There are
  • 19:25 - 19:32
    some manufacturers on the Internet which
    claim that they can detect a movement of
  • 19:32 - 19:37
    the order of magnitude of a single atom.
    And I believe them because we use similar
  • 19:37 - 19:42
    structures in solid state physics. So
    that's possible. If you want to try it,
  • 19:42 - 19:47
    just turn on the gyroscope on your phone.
    And do slight rotation like this, which is
  • 19:47 - 19:53
    about the Z axis, one perpendicular to the
    display, you can detect really slow
  • 19:53 - 19:58
    rotations with this. And think about the
    fact that this is done using the coriolis
  • 19:58 - 20:04
    effect and it's just mind blowing I think.
    So this sensor is a bit more available.
  • 20:04 - 20:10
    Actually, almost 80 percent of the phones
    have them. This has become significantly
  • 20:10 - 20:15
    more since Pokémon GO. The reason is
    when this game came up, suddenly people
  • 20:15 - 20:19
    noticed that there's a device called the
    gyroscope. And if it's not present, they
  • 20:19 - 20:23
    did not have this AR mode where you can
    actually take pictures of the nice cute
  • 20:23 - 20:28
    Pokémon and so on. So this is when the
    many people noticed it and the
  • 20:28 - 20:32
    manufacturers decided, OK, let's just
    throw in the gyroscope as well, because
  • 20:32 - 20:35
    it's not that expensive, in fact, usually
    it's on the same chip as the
  • 20:35 - 20:39
    accelerometer. Then they're sold as one
    thing it's an IMU - Inertia Measurement
  • 20:39 - 20:45
    Unit not important at home, but so it's
    quite a common thing. And the sensor rates
  • 20:45 - 20:51
    look pretty much the same. You mostly
    notice the dip in the 100 hertz regime
  • 20:51 - 20:55
    because those are the real cheap phones,
    which then also don't have a gyroscope.
  • 20:55 - 21:00
    But most of the phones achieve higher
    rates. Again, since we were laughing
  • 21:00 - 21:06
    before the iPhones also are here again at
    the 100 hertz. Wouldn't make sense to have
  • 21:06 - 21:11
    the gyroscope faster at this point. Yeah,
    but that's it about the gyroscope you've
  • 21:11 - 21:16
    seen it in action in the salad spinner.
    And that's one of the sensors you do not
  • 21:16 - 21:22
    really see that often directly, but were
    just mostly there to assist other things
  • 21:22 - 21:28
    that you do where you need to get smooth
    motion like controlling games, AR . And
  • 21:28 - 21:34
    actually removing the Earth's acceleration
    from the accelerometer. Next up is a
  • 21:34 - 21:39
    magnetometer, which I think is a more
    obvious sensor because that's your compass
  • 21:39 - 21:45
    in your device. So when you're doing
    navigation with a GPS in your car, it's a
  • 21:45 - 21:50
    simple thing. GPS gets a position, you get
    a sequence of position as you going and
  • 21:50 - 21:52
    from the sequence of the positions you
    get, the direction you're moving in your
  • 21:52 - 21:57
    car and your phone is attached to the
    dashboard at least i hope so. So it's
  • 21:57 - 21:59
    pointing in the same direction you're
    moving, everything's obvious. But if
  • 21:59 - 22:04
    you're standing on an open space looking
    for not sure a train station or anything
  • 22:04 - 22:08
    and you wondering which direction you want
    to go from point of view of GPS, it's
  • 22:08 - 22:12
    always the same position it doesn't get an
    orientation. You need a compass, which is
  • 22:12 - 22:17
    the magnetometer. How do we get a compass
    on your phone? This is usually a hall
  • 22:17 - 22:23
    sensor. A hall sensor is in principle just
    a conductor with charge carriers so these
  • 22:23 - 22:28
    are the nice shiny white balls here
    drifting from one side to the other so
  • 22:28 - 22:32
    it's just an electric current. And if you
    apply a magnetic field to an electric
  • 22:32 - 22:37
    current or to any electric charge, then
    there is an effect. You might know from
  • 22:37 - 22:41
    school, which is called the lorentz
    effect. So there is a charge going one
  • 22:41 - 22:45
    direction, you get the magnetic field
    perpendicular to this and then the charge
  • 22:45 - 22:51
    is deflected into a direction
    perpendicular to the flying direction. And
  • 22:51 - 22:55
    yeah, that's lorentz effect the older
    guys, of you would know it from CRTs. If
  • 22:55 - 23:00
    you bring a magnet close to a CRT, the
    entire image is messed up due to this
  • 23:00 - 23:06
    effect. And that's what we're using in
    hall effect sensor or hall sensor you've
  • 23:06 - 23:12
    got this electric current and if you bring
    a magnetic field close to it, the charge
  • 23:12 - 23:17
    carriers are deflected to one side or the
    other. And therefore, if you're measuring
  • 23:17 - 23:23
    the voltage perpendicular to the flow of
    the count, you get. Yeah. You get an extra
  • 23:23 - 23:26
    voltage that's proportional to the
    magnetic field. That's the hall effect.
  • 23:26 - 23:32
    That's how your phone is able to determine
    the magnetic field. This one is even more
  • 23:32 - 23:37
    common than the gyroscope simply because
    it's used for navigation and people start
  • 23:37 - 23:42
    to notice if it's not. If it's not present
    and they do not get an orientation in the
  • 23:42 - 23:50
    navigation software. But the actual rate
    of the sensors is much slower than for the
  • 23:50 - 23:55
    accelerometer. Most of them are running at
    100 Hertz. It will be important in two
  • 23:55 - 24:00
    more slides. Besides that, there's not
    that much strange about the availability
  • 24:00 - 24:06
    of this, but it's extremely sensitive
    because it's supposed to measure Earth's
  • 24:06 - 24:10
    magnetic field. Earth's magnetic field has
    the strength around 50 micro Tesla. This
  • 24:10 - 24:16
    is not much actually if ever carried the
    magnetic magnet with you. Did you fear of
  • 24:16 - 24:20
    some force from the Earth's magnetic
    field? Of course, it didn't need to build
  • 24:20 - 24:23
    some compass where the needle is floating
    on something like this to actually get a
  • 24:23 - 24:28
    rotation. It's a very weak field and
    that's good news and bad news as well,
  • 24:28 - 24:32
    because on one hand, it's very sensitive.
    downside is it's very sensitive. Which
  • 24:32 - 24:36
    means it saturates very early. If you want
    to measure the magnetic field of an actual
  • 24:36 - 24:42
    magnet. Don't even try it will saturate
    right away. You do not get anything to
  • 24:42 - 24:48
    demonstrate how how sensitive this
    actually is. I've brought a flashlight, so
  • 24:48 - 24:55
    a very simple one. And I switch to a modus
    where we've got an s.o.s signal. That's
  • 24:55 - 25:01
    coming up, a point in this direction and I
    place it next to the magnetometer in my
  • 25:01 - 25:06
    phone. And yeah, you see right away so
    much of his seeing the lights are pointing
  • 25:06 - 25:10
    in this direction. You see the s.o.s
    signal popping up in the magnetic field
  • 25:10 - 25:15
    reading simply because of the current
    going through the LED. So that's what we
  • 25:15 - 25:18
    call an Oersted-field. This is just the
    typical magnetic field you get from any
  • 25:18 - 25:23
    current flowing. So I stop it. We got a nice
    SOS signal over there. Three short, three
  • 25:23 - 25:31
    long and three short signals. And it's just
    coming from this simple flashlight. And
  • 25:31 - 25:37
    this is also a good indicator on how
    sensitive this thing is. I mean, if you
  • 25:37 - 25:44
    place your phone in a case with a magnetic
    some magnetic closing mechanism, compass
  • 25:44 - 25:47
    wouldn't work anymore. If you're not
    careful when paying your clothes and you
  • 25:47 - 25:52
    place your phone on the big magnet that
    removes the theft protection from the
  • 25:52 - 25:56
    clothes, something in your phone would get
    magnetized and would certainly be stronger
  • 25:56 - 26:01
    than Earth's magnetic field. For the rest
    of the day, your compass would be pointing
  • 26:01 - 26:07
    in the wrong direction. Okay. Luckily,
    usually the phones are able to notice this
  • 26:07 - 26:12
    and they recalibrate the phone to simply
    subtract any constant fears. That again is
  • 26:12 - 26:15
    bad. If you want to do absolute
    measurements because you have not much
  • 26:15 - 26:23
    control over the recalibration mechanism,
    you can access the raw data value. So if
  • 26:23 - 26:27
    you folks there's a checkmark where you
    can disable the calibration, but then you
  • 26:27 - 26:31
    have to do everything by hand. You will
    certainly have some background that's
  • 26:31 - 26:35
    annoying. And one other thing, you should
    also take care and notice where your
  • 26:35 - 26:39
    actual magnetometer is because in most
    phones it's on top left corner, top right
  • 26:39 - 26:44
    corner, top center. And this Pixel 3 is a
    very strange one. It has it on the right
  • 26:44 - 26:49
    hand side, but it's never dead center. I
    think because of all the currents in the
  • 26:49 - 26:53
    phone, I mean, you're charging your
    battery with three amps. How much you
  • 26:53 - 26:57
    charge them now? This would yield a
    stronger field than a flashlight and you
  • 26:57 - 27:03
    would see it in the magnetometer again.
    Now for what you can do with this. So as
  • 27:03 - 27:07
    little homework for all of you who came by
    train yesterday, when I came here on the
  • 27:07 - 27:13
    ICE, I turned on the magnetic spectrum,
    the same thing as the acceleration
  • 27:13 - 27:17
    spectrum you just seen. And when you're
    doing it on train, you would see a peak at
  • 27:17 - 27:24
    16.6 hertz. It might depend on your actual
    seat. You might move it around a little
  • 27:24 - 27:31
    bit. But so far I usually always saw this
    peak. This is the electrification
  • 27:31 - 27:36
    frequency of the German railway. So you
    can simply check if it's working properly.
  • 27:36 - 27:43
    You should see 16.7 hertz. Okay. One other
    thing that some of you might get in your
  • 27:43 - 27:46
    head right now, that you could do this
    with simple electrical outlets. There you
  • 27:46 - 27:50
    would get a problem with the rate. So
    that's what I mentioned, that the rate of
  • 27:50 - 27:56
    the sensor is quite important. I also got
    something via Twitter yesterday. Just as a
  • 27:56 - 27:58
    response to the other one, I thought,
    well, I was looking for an example like
  • 27:58 - 28:02
    this for this talk talk, so I just put it
    in. This is a measurement of an American
  • 28:02 - 28:08
    power outlet which is run at 60 hertz. But
    this guy is seeing 40 hertz and he was
  • 28:08 - 28:16
    wondering about this. That's what's called
    aliasing. So the alias effect, sort of you
  • 28:16 - 28:20
    might notice this from computer games.
    They usually use it in slightly different
  • 28:20 - 28:26
    context. The idea is if you're measuring a
    frequency that's higher than half of the
  • 28:26 - 28:30
    data acquisition rate of your sensor. So
    this one is runningat 100 hertz like most
  • 28:30 - 28:36
    of the phones do. Then half of this
    frequency is what's called the Nyquist-
  • 28:36 - 28:40
    frequency. And you notice that the
    spectrum goes from zero to the Nyquist-
  • 28:40 - 28:45
    frequency. This is simple math, not simple
    math, but its maths. The roots of the
  • 28:45 - 28:49
    fourier-transformation, you could say so.
    And if you try to detect a frequency
  • 28:49 - 28:54
    that's higher than this, so an American
    power outlet with 60 hertz, actually the
  • 28:54 - 29:00
    higher frequency is showing up as on the
    other side of this upper limit at 40
  • 29:00 - 29:03
    hertz, even if you go to a higher
    frequency, it would shift down further and
  • 29:03 - 29:06
    further until reaching zero and then it
    would shift up again. So if you're
  • 29:06 - 29:13
    interested in this. Check out some
    articles about aliasing. If you're not
  • 29:13 - 29:17
    that interested in this. Just keep in
    mind, if you're measuring frequencies that
  • 29:17 - 29:20
    are higher than half your data acquisition
    rate, you will not see the correct
  • 29:20 - 29:27
    frequency. OK. Then one of my favorite
    sensors, the pressure sensor for this one
  • 29:27 - 29:33
    I need. Again, the phone. That's not on a
    wire. Let me before before I show
  • 29:33 - 29:38
    anything. Let me demonstrate what it can
    do, because that's something I find quite
  • 29:38 - 29:42
    surprising. Let's turn on the measurement.
    By the way, those who are wondering how
  • 29:42 - 29:48
    this works. There's a function in phyphox,
    we call it remote access. It's basically a
  • 29:48 - 29:53
    web server running in the app which
    provides the data so we can simply access
  • 29:53 - 29:59
    the data on the phone to demonstrate or to
    control the measurement. And now here we
  • 29:59 - 30:04
    see the pressure sensor. Right now, just
    mostly noise or what I do now is I hold it
  • 30:04 - 30:08
    up. And if we wait a few seconds, you
    would see that the pressure's actually
  • 30:08 - 30:15
    dropping. It has dropped far enough. Then
    I place it on the ground and the pressure
  • 30:15 - 30:20
    is rising again. So actually, your phone,
    if it has a pressure sensor, has a
  • 30:20 - 30:26
    pressure sensor that's sensitive enough.
    So we turn it off to measure a change of
  • 30:26 - 30:33
    pressure of a distance like this. OK. And
    that's again, when I first tried this, I
  • 30:33 - 30:40
    repeated this test several times before,
    believed it was just not by accident. And
  • 30:40 - 30:44
    how do they do this? You have got another
    device that actually has a cavity. So
  • 30:44 - 30:48
    below the bluish gray part, there's a
    cavity in there which is covered by a
  • 30:48 - 30:53
    silicon membrane, which is the bluish
    part. And if you change the pressure this
  • 30:53 - 30:58
    simply moves it like you would expect from
    a membrane just in small. And to detect
  • 30:58 - 31:03
    this movement, here is some material on
    top of this which changes its resistance.
  • 31:03 - 31:12
    Or resistivity depending on the strain
    created by morphing, dismembering. And
  • 31:12 - 31:16
    unfortunately, this sensor is not that
    much available. So about a third of the
  • 31:16 - 31:20
    devices that we know of have the sensor.
    Of course, there's some bias in there from
  • 31:20 - 31:27
    the users that submit data to us. This
    means that, yes, these are usually the
  • 31:27 - 31:32
    more expensive devices. So my rule of
    thumb is if it's an iPhone, they usually
  • 31:32 - 31:36
    have the pressure sensor except for the
    iPhone SE or some older models. If it's an
  • 31:36 - 31:40
    Android, if you payed half as much as you
    paid for an iPhone, then you have a good
  • 31:40 - 31:47
    chance that you have to pressure sensor as
    well. But OK, that data rates? Yeah.
  • 31:47 - 31:55
    Varies a lot. So the iPhones, like you
    just saw the rate of about 1 Hertz. Most
  • 31:55 - 31:59
    Android phones are on five, ten or twenty
    five hertz. I've never had a device like
  • 31:59 - 32:03
    this in my hand. It does 100 hertz. I
    don't really believe that this makes sense
  • 32:03 - 32:10
    because I already noticed on my phone that
    I think it does 25 hertz. Just handing it
  • 32:10 - 32:16
    because of the sealed casing introduces
    more noise than you can actually use, at
  • 32:16 - 32:21
    least for these small distances that I use
    it for. But you can do other funny things
  • 32:21 - 32:26
    with this. So this is something I received
    by Dianna Cowern. You might know her as a
  • 32:26 - 32:32
    YouTuber called "The Physics Girl". She
    used a pressure measurement on the flight.
  • 32:32 - 32:36
    It's something you should do anyways,
    because that's the way you can figure out
  • 32:36 - 32:39
    how much air you get to breathe up there.
    It's much lower than you might expect.
  • 32:39 - 32:44
    But she saw something else. So at some
    point she saw the drop in the pressure and
  • 32:44 - 32:48
    increase again. And she asked her
    followers, what could this be? And I'm not
  • 32:48 - 32:52
    asking the audience right now. I just give
    you the solution. She wasn't lavatory and
  • 32:52 - 32:56
    she flushed the toilet. So when water and
    air gets sucked out, you can actually
  • 32:56 - 33:01
    measure this. And then about a month ago,
    I found someone else who allowed me to use
  • 33:01 - 33:09
    his measurement. So this guy, Phillip
    Smith, was on an airplane again. But he
  • 33:09 - 33:13
    did not actually go to the lavatory. He
    stayed on his seat and he just checked
  • 33:13 - 33:19
    when people were flushing the toilet. So
    as he sat, there was there were
  • 33:19 - 33:22
    turbulence. So they couldn't go for a
    while. And then there was the rush while
  • 33:22 - 33:27
    the toilet and he was plotting it. So just
    for those of you that came here by plane,
  • 33:27 - 33:32
    just a hint as a conversation starter next time,
    when the guy next to you goes to the toilet and
  • 33:32 - 33:37
    he comes back, tell him exactly all of the
    head to flush the toilet and ask him why.
  • 33:37 - 33:42
    Okay. And you would enjoy the rest of the
    flight. Some other example that we
  • 33:42 - 33:48
    actually use is measuring the movement of
    an elevator. So this is a lift in Aachen.
  • 33:48 - 33:52
    We have the accelometer which measures the
    acceleration of this thing, gets the total
  • 33:52 - 33:56
    height difference of the elevator from the
    again, from the pressure sensor, a
  • 33:56 - 34:01
    barometer. That's a pressure sensor. And
    the velocity of the elevator as well from
  • 34:01 - 34:07
    the change in height. OK, so next time you
    enter an elevator, I want to see you all
  • 34:07 - 34:12
    to take out your phones and measure the
    distance that the elevator is traveling
  • 34:12 - 34:17
    and the velocity at which it does so. OK.
    So these are, in my opinion, most
  • 34:17 - 34:22
    important sensors, some honorable
    mentions. Almost all phones have a light
  • 34:22 - 34:26
    sensor as well, which controls the display
    brightness depending on the ambient light.
  • 34:26 - 34:32
    Unfortunately, there is no API on IOS
    to access this. So if there are apps
  • 34:32 - 34:36
    that seem to access a sensor like this,
    they usually use the camera instead, which
  • 34:36 - 34:39
    is which also works quite well. But it's
    slightly different since the difference
  • 34:39 - 34:44
    between illuminance and luminance, which I
    do not want to go into detail here. And on
  • 34:44 - 34:49
    most Android phones, they are badly
    calibrated or do this so much difference
  • 34:49 - 34:53
    in the quality of the sensors. We have to
    check it on your own phone if it's worth
  • 34:53 - 34:57
    anything. But it's a bit difficult. This
    proximity sensor, which is the one that
  • 34:57 - 35:01
    turns off the screen when you hold the
    phone to your ear when you're
  • 35:01 - 35:05
    actually doing your call. Sounds
    interesting, but unfortunately it only
  • 35:05 - 35:09
    distinguishes or has I know it
    distinguishes between between the near and
  • 35:09 - 35:14
    far value, which is the difference between
    five centimeters. So I do not have that
  • 35:14 - 35:22
    much use for it. There is the temperature sensor,
    maybe if they are officially there, then
  • 35:22 - 35:27
    they usually come along with the humidity
    sensor, but that's the sensors in your
  • 35:27 - 35:31
    phone. So you should be a little bit
    skeptical about this. You're mostly
  • 35:31 - 35:35
    measuring the heat from your battery or
    from your device. They tried to compensate
  • 35:35 - 35:38
    for this, but that's a difficult thing to
    do. So if you actually, one, need a
  • 35:38 - 35:44
    thermometer, take a thermometer. They're
    not that expensive. OK. You might see some
  • 35:44 - 35:50
    temperature sensors that are not official.
    Which phyphhox can pick up. Those are usually
  • 35:50 - 35:54
    temperature sensors that are part of the
    pressure sensor to compensate for
  • 35:54 - 35:59
    temperature effects. So they're not even
    designed to get an outside temperature.
  • 35:59 - 36:06
    OK. So I wanted to mention this. While the
    information about where we got the
  • 36:06 - 36:10
    information about the sensors from, so in our
    App at the very bottom, does this entry
  • 36:10 - 36:18
    submit to a sensor database which tells
    you to leave the phone resting on a table?
  • 36:18 - 36:21
    It also checks if you're actually doing
    this, doesn't let you submit it before it
  • 36:21 - 36:27
    is happy about the error rate or the
    standard deviation of the accelometer. And
  • 36:27 - 36:31
    if you submit it, we collect the data on
    phyphox.org/sensordb and that's
  • 36:31 - 36:36
    where I got the statistics from so far. So
    if you're interested in what a new phone
  • 36:36 - 36:41
    that you're about to buy can actually do.
    Of course we don't give you any guarantee,
  • 36:41 - 36:46
    but you can check up or check out all the
    data, all the phones. At least those that
  • 36:46 - 36:50
    are already in our database. And of
    course, I'm happy if you contribute
  • 36:50 - 36:54
    statistics about the census in your phone
    as well. So you might want to play with
  • 36:54 - 37:02
    this later. And then finally, the last
    thing to finally conclude is some
  • 37:02 - 37:06
    information on how you can access the
    sensors. Of course you can write your own
  • 37:06 - 37:10
    APP. I think here quite a few who can do
    this. Just have a look if you can write an
  • 37:10 - 37:14
    App. Have a look at the API. They're not
    too complicated. It's easy to access the
  • 37:14 - 37:18
    sensor data. If you're not interested in
    designing your own app, but you want to
  • 37:18 - 37:22
    include sensor data in some other
    projects, there are three ways you can use
  • 37:22 - 37:27
    Phyfox for this, which I want to
    introduce, because that's something that's
  • 37:27 - 37:32
    one of the reasons I wanted to connect
    here. Don't hesitate. Phyfox is free. You
  • 37:32 - 37:36
    can get for free on Google Play and on the
    Appstore. And when I say it's free, I mean
  • 37:36 - 37:42
    it's really free. So it's open source. The
    GPL and you can also get an afterwards we
  • 37:42 - 37:48
    assured of code running on your phone
    is the code that you see. And we have
  • 37:48 - 37:54
    three versions how you can.. At least they
    are categorized into three versions. How
  • 37:54 - 37:57
    you can access the sensor data. First
    thing is you can implement something in
  • 37:57 - 38:02
    Phyfox yourself. So I've got this editor,
    visual editor of all file format, which
  • 38:02 - 38:06
    allows you to take a sensor, place on
    mathematics. So this is just adding stuff,
  • 38:06 - 38:12
    but you can apply a Fourier transform or
    anything and then assign it to a graph.
  • 38:12 - 38:17
    Alternatively, and of course a bit more
    powerful. You can have a look at our XML
  • 38:17 - 38:21
    format, which defines all the experiments.
    So actually all experiments to see in
  • 38:21 - 38:26
    Phyfox are not hardcoded, but they are defined
    in our own file format you can edit any of
  • 38:26 - 38:33
    them to your needs. And when you're done
    you can transfer your data with the QR
  • 38:33 - 38:37
    code. Do not try to scan this QR code just
    from your QR code app. You have to scan
  • 38:37 - 38:42
    it from within Phyfox and if you do,
    you'll find a nice little experiment which
  • 38:42 - 38:48
    uses our file formats to implement a Turing
    machine that's counting binary up to 256.
  • 38:48 - 38:51
    So this is the proof that all file format
    actually is Turing complete. So you can do
  • 38:51 - 38:56
    a lot with it. Okay. I'm not suggesting
    that you're trying to implement doom on it
  • 38:56 - 39:00
    or something like this because you won't
    be able to. It's not efficient that way.
  • 39:00 - 39:04
    It's not designed to be Turing complete.
    It just happens to be Turing complete. So
  • 39:04 - 39:08
    if you want to do something more, you can
    connect to Phyfox via a network. You've
  • 39:08 - 39:12
    seen one example with the salad spinner.
    When I said that there is a
  • 39:12 - 39:17
    a web server running on the App. You can use
    this to access the data directly from your
  • 39:17 - 39:22
    preferred programing language. There's an
    example where I'm using Python to read out
  • 39:22 - 39:27
    the sensor data and control a synthesizer.
    So what's running on the web server is
  • 39:27 - 39:31
    basically a rest API. So yeah. Just visit
    our website and learn how to do this. So
  • 39:31 - 39:35
    you can read out the sensor data of a
    network and control your project with it.
  • 39:35 - 39:39
    An alternative to this is a new network
    interface that we have, which is more on
  • 39:39 - 39:45
    this XML side or the design of our
    experiment configurations, which is meant
  • 39:45 - 39:51
    to collect data from many users and not
    life data. So we had this lecture. So this is
  • 39:51 - 39:56
    the new lecture hall, by the way. So we
    had a lecture where every student got a
  • 39:56 - 40:01
    spring from us and there was supposed to
    build a spring pendulum and we collected
  • 40:01 - 40:06
    the data from all students and the lecture
    hall in realtime on the big screen to
  • 40:06 - 40:14
    determine the dependency of the frequency
    from the mass of the pendulum. And another
  • 40:14 - 40:17
    example. Just a few days ago, we during
    the winter solstice, we asked our
  • 40:17 - 40:22
    international users to point their phone
    at the sun. So we get an angle for the
  • 40:22 - 40:28
    elevation of the sun and the azimuth from
    the magnetometer with a compass. And this
  • 40:28 - 40:31
    way we could trace the path of the sun
    across the earth from all the users. What
  • 40:31 - 40:36
    each black point with the line is a
    contribution from a user. So, yeah, from
  • 40:36 - 40:41
    this we could, for example, determine the
    tilted angle of the earth's axis. OK, so
  • 40:41 - 40:44
    just example, what you can do is this
    network interface, as long as we're able
  • 40:44 - 40:48
    to set up some server to receive the data,
    you can use this network interface. We're
  • 40:48 - 40:52
    still working on this network interface.
    So far it can only do HTTP requests, get
  • 40:52 - 40:58
    or post. But we are also planning on
    implementing Mqtt and other protocols like
  • 40:58 - 41:03
    this. And the third option is a Bluetooth
    connection, which is mostly designed for
  • 41:03 - 41:07
    sensors. So if you want. If you have some
    Bluetooth low energy sensor that you want
  • 41:07 - 41:12
    to read out, you can use Phyfox. So
    there's an example of a Texas Instruments
  • 41:12 - 41:15
    sensor tech, which has a software which is
    not designed for Phyfox. But our file
  • 41:15 - 41:20
    format is flexible enough to
    simply tell Phyfox how to read all the
  • 41:20 - 41:26
    data and suddenly we've got the sensor
    that can run independently from the phone.
  • 41:26 - 41:30
    And of course you can include your own
    projects like this. So there is an example from
  • 41:30 - 41:36
    actually my institute, because originally I'm in
    solid state physicist. So we're working a
  • 41:36 - 41:40
    lot with graphene and this is a
    demonstrated we create that was an ESP 32.
  • 41:40 - 41:46
    So this is another version of an Arduino, or
    Arduino compatibel. What we're doing here.
  • 41:46 - 41:50
    We're reading out a graphene Hallsensor
    and so. It's all similar to the holecenter
  • 41:50 - 41:56
    of phone, but based on graphene and we can
    get life measurements in Phyfox with this.
  • 41:56 - 42:00
    And so if you have an Arduino project with
    which you want to.. from which you want
  • 42:00 - 42:04
    to send data that is plotted in Phyfox,
    you can do it with a bluetooth low
  • 42:04 - 42:09
    energy interface. But if you have some
    patients and maybe wait two more months,
  • 42:09 - 42:13
    we are working on Arduino library to make
    this simpler. So this the entire code, you
  • 42:13 - 42:18
    would need to read out the analog input
    from an Arduino and send it to Phyfox to
  • 42:18 - 42:23
    be plotted. OK, so this is working right
    now. If you cannot wait, you can check it
  • 42:23 - 42:25
    out on our website. So this is already
    available, although it's a work in
  • 42:25 - 42:30
    progress. The interface will change a bit
    still. I would prefer if you want to
  • 42:30 - 42:33
    start right now, if you contact me so we
    can get some feedback and maybe even
  • 42:33 - 42:40
    design the library also to your needs. So that
    we get an idea. So with this, I'm about to
  • 42:40 - 42:47
    finish. So just a short summary what I'm
    hoping I can trigger. Yeah. So if you were
  • 42:47 - 42:52
    mildly amused, mightily entertained by
    this by this talk, check out our Web site
  • 42:52 - 42:56
    or check out our YouTube channel or
    Twitter. We can get some more examples,
  • 42:56 - 43:03
    what we do with the sensors in the phone.
    If you are a teacher, are teachers here?
  • 43:03 - 43:09
    Quite a few. That's great! And if you want
    to use this in class or in a lecture,
  • 43:09 - 43:12
    check out our Web site phyfox.org. We've
    got a database of experiments that you can
  • 43:12 - 43:15
    do: phyfox.org/experiments .That's then
    actually about physics and less about the
  • 43:15 - 43:20
    hardware where we also demonstrate the
    experiments and how they work. If you are
  • 43:20 - 43:25
    a teacher and has a specific project in
    mind. Check out our editor to design your
  • 43:25 - 43:32
    own set up with which you can do something
    specific for a very specific experiment.
  • 43:32 - 43:36
    phyfox.org/editor. Then if you are working
    on arduino project and want to plot
  • 43:36 - 43:40
    something, you can visit Phyfox.org/arduino,
    where you already can access
  • 43:40 - 43:45
    our library. Although it's not complete as
    I said. So maybe wait a little bit or
  • 43:45 - 43:50
    contact me first. If you have a Bluetooth
    low energy device that you want to use or
  • 43:50 - 43:56
    integrate. You can visit phyfox.org/ble.
    If it's about a device that you did not
  • 43:56 - 44:00
    design yourself, you probably need some
    background information about bluetooth low
  • 44:00 - 44:05
    energy. Should know what a GATT server is
    and how characteristics and services, new
  • 44:05 - 44:08
    ideas and all this stuff and bluetooth
    energy works. And it's good to get some
  • 44:08 - 44:13
    documentation or to be good as reverse
    engineering, but in principle I haven't
  • 44:13 - 44:20
    seen many devices so far which could not
    work with phyfox easily. Then if you want
  • 44:20 - 44:26
    to read the values for another project via
    network, visit our website, the wiki on
  • 44:26 - 44:31
    our website. phyfox.org/wiki, where you
    can get information about the rest API and
  • 44:31 - 44:35
    on your network interface. And finally,
    something I would really love if you want
  • 44:35 - 44:40
    to contribute. If you can write some apps,
    I mean you can use a lot of things. The iOS
  • 44:40 - 44:46
    app is written in swift. The Android
    version is written in Java. Our webserver,
  • 44:46 - 44:50
    of course, has web development and Html in
    JavaScript. So if you want to contribute
  • 44:50 - 44:56
    there. Visit our Web site at a
    phyfox.org/source. And we would love to
  • 44:56 - 45:02
    see some help in development. With this I
    finish my talk and I'm looking forward to
  • 45:02 - 45:05
    any exchange we will have later and any
    questions. And I'm just thankful that it
  • 45:05 - 45:10
    was allowed to talk here and
    get so much attention. Thank you.
  • 45:10 - 45:21
    Applause
  • 45:21 - 45:27
    Oh, by the way, since it is up there. One
    bad news, unfortunately, I can only be
  • 45:27 - 45:32
    here today. So if you want to talk to me,
    try to catch me today. You can also call
  • 45:32 - 45:37
    me. I actually brought a DECT phone,
    but, uh, sorry, only today.
  • 45:37 - 45:42
    Herald: Oh, my God. So quickly, though, we
    have questions now, 15 minutes, then 15
  • 45:42 - 45:47
    minutes, I think. And then afterwards, you
    have to find him and catch him. Thank you,
  • 45:47 - 45:56
    Sebastian. Questions. Shoot. There is one.
    Question: You mentioned aliasing affect
  • 45:56 - 46:02
    during.. Is it possible to change or modulate
    the sampling frequency to actually find
  • 46:02 - 46:09
    out our frequency above the sampling frequency?
    Sebastian: Yeah, that's that's a good
  • 46:09 - 46:14
    question. Not only because of the of the
    alias affect, but also because some
  • 46:14 - 46:17
    projects also want to reduce the sampling
    frequency. It's a little bit tricky
  • 46:17 - 46:22
    because on both APIs and both IOS and
    Android, you cannot specify a target
  • 46:22 - 46:26
    frequency, you can only specify a
    frequency that specific for certain use
  • 46:26 - 46:32
    case. So for example, you say I need the
    accelerometer data, that's which at a rate
  • 46:32 - 46:36
    that's reasonable for UI changes or at a
    rate that's reasonable for games. Right.
  • 46:36 - 46:41
    Right. That's as fast as possible. So if
    you do it for UI, you get something like
  • 46:41 - 46:44
    let's say two three hertz. We heard something like
    this or you doesn't waiting ages before
  • 46:44 - 46:48
    the screen rotates for games. It's 25 50
    hertz something like this. So we can
  • 46:48 - 46:53
    control the game and fastest is the
    data I've just plotted. And Phyfox always
  • 46:53 - 46:57
    request the fastest we can see and in
    Phyfox we have a setting, we can limit the
  • 46:57 - 47:03
    frequency. Unfortunately, if your
    frequency is not simply a multiple, no,
  • 47:03 - 47:07
    the other way around is. The frequency
    given by the device, is not a multiple of the
  • 47:07 - 47:11
    frequency that you gave. It's not easy to
    break it down to the target frequency. So
  • 47:11 - 47:18
    you usually see some odd cases where
    Phyfox tells to group the sensor events
  • 47:18 - 47:24
    along this to get near this frequency. So
    it might not work that well. And
  • 47:24 - 47:28
    especially if you're looking for the alias
    effect. This might really mess up their
  • 47:28 - 47:32
    alias effect, so you might need to try a
    little bit which frequency looks good to
  • 47:32 - 47:36
    do this. But of course in principle you
    can average about multiple values in this
  • 47:36 - 47:42
    way or simply pick only every end value.
    And this way we'd use the frequency. And
  • 47:42 - 47:46
    yeah, this can be done to our editor or to
    the main screen. There's a plus button
  • 47:46 - 47:50
    with which you can simply expand which
    already allows you to set this simple
  • 47:50 - 47:54
    frequency. Just keep in mind that you
    cannot really always get to the
  • 47:54 - 47:58
    target frequency, right?
    Herald: Right. There is another question.
  • 47:58 - 48:02
    No? Yes. Please.
    Question: Hi. Thanks for the cool task.
  • 48:02 - 48:06
    It's a great app. I love using it in
    school. I was wondering if those cool
  • 48:06 - 48:10
    animations how to sensor types of working
    are available.
  • 48:10 - 48:15
    Sebastian: Sorry. The animation scene.
    Yeah. I think I wonder how to do this
  • 48:15 - 48:21
    best. Before that, I was already thinking
    about sharing the slides. Actually, my
  • 48:21 - 48:27
    talk is space it's just written in HTML in Javascript
    it's not easy to control for everyone. That's
  • 48:27 - 48:33
    why I did not simply upload it. I would if
    I would check later, if I can, upload the entire
  • 48:33 - 48:37
    talk in some way that makes sense either
    on our website. I'm not sure if it makes
  • 48:37 - 48:42
    sense to upload it to the system of the
    conference. Still, after the talk, I would
  • 48:42 - 48:50
    check it, but I am not... I want to share
    the slides, but I probably need to add
  • 48:50 - 48:54
    some documentation on how to use them
    because they are not Power point PDF or
  • 48:54 - 48:58
    Latex generated PDF.
    It's handmade.
  • 48:58 - 49:05
    Herald: You can always cut them out of the
    video getting streamed and La la la la la.
  • 49:05 - 49:09
    Yeah, right.
    Question: Just a quick question of the the
  • 49:09 - 49:13
    axis of the phone. They're like like that
    and that distorts us.
  • 49:13 - 49:20
    Sebastian: So it's not for most phones.
    The X-axis is reading directlon. The
  • 49:20 - 49:26
    Y-axis is upwards along the screen and Z
    access, Z-axis depending on your dialect is
  • 49:26 - 49:32
    perpendicular to the screen. I'd say in
    most cases because officially the X-Axis
  • 49:32 - 49:36
    at least I think I've written this
    documentation for Android is along the
  • 49:36 - 49:40
    natural reading direction of the device.
    So if you've got a huge tablet which you
  • 49:40 - 49:46
    naturally would put in horizontal
    alignment, not portrait mode, it might be
  • 49:46 - 49:51
    that the X-Axis is the long Axis. I have never
    seen this myself, but I'm a little bit
  • 49:51 - 49:55
    careful to say that all these devices have
    the same axis, but Z is definitely always
  • 49:55 - 50:00
    perpendicular to the screen and X and Y are
    than the other ones and they are fixed and
  • 50:00 - 50:05
    usually the short side is the X-Axis.
    Herald: Ok. There is one more question
  • 50:05 - 50:11
    there, please, sir. Take the microphone.
    It's next to you. You got it off the
  • 50:11 - 50:14
    ...
    Question: Hi, you mentioned the necessity
  • 50:14 - 50:21
    of the magnetic sensor to to determine the
    content orientation. Can you not use past
  • 50:21 - 50:25
    G.P.S. data and then integrate over the
    gyroscope data to get the current
  • 50:25 - 50:27
    orientation?
    Sebastian: Lauthing Mathematically, your
  • 50:27 - 50:35
    correct, problem is integrating sensor
    data is not as simple. I'm often
  • 50:35 - 50:42
    surprised on what some software
    can actually do. If you do it naively
  • 50:42 - 50:46
    right now I only have an example in mind
    for the accelerometer cause it could also
  • 50:46 - 50:49
    say you can integrate the accelometer data
    to get velocity. You can integrate the
  • 50:49 - 50:55
    velocity to get the displacement of the
    phone of the location. If you do this,
  • 50:55 - 50:58
    we've got a very simple example in our
    wiki. Very naiv even one without any
  • 50:58 - 51:03
    filtering, then just the noise means
    that's if there's little arrow, you summit
  • 51:03 - 51:08
    up integrations, nothing else but
    suming up in small steps. You get an
  • 51:08 - 51:14
    offset error in the velocity. If you
    integrate this again, you get an error in
  • 51:14 - 51:18
    the location with which is growing with
    the square of the time. So if you do this
  • 51:18 - 51:22
    for location and try it out with our naive
    approach your phone is supposed to
  • 51:22 - 51:27
    be 100 meters upwards after about 10
    seconds. If you do this for the gyroscope,
  • 51:27 - 51:32
    it's a little easier because you only
    want integration. But still there will be
  • 51:32 - 51:37
    some drift. I'm not sure about all the
    techniques the manufacturers imployed to
  • 51:37 - 51:41
    filter out any errors. I mean, obviously
    the gyroscope is self calibrating
  • 51:41 - 51:45
    otherwise, it would be pointing in
    different direction all the time. And on
  • 51:45 - 51:50
    some phones I've seen it jumping
    when it recalibrates. But if you simply
  • 51:50 - 51:55
    integrate this, you will certainly get
    drift, there's no way that you can get
  • 51:55 - 51:59
    a fixed position. What I think what they
    probably do for most cases, they use the
  • 51:59 - 52:06
    gyroscope to immediate direct
    rotation and then try to fuze it
  • 52:06 - 52:10
    in some way with the magnetometer
    information to keep it fixed so that at
  • 52:10 - 52:14
    the end you're not pointing the wrong
    direction. But the gyroscope itself, only
  • 52:14 - 52:18
    on its own, is unfortunately only giving
    you the rotation rate, not the absolute
  • 52:18 - 52:23
    rotation in contrast to an actual
    gyroscope. The big one that's rotating. So
  • 52:23 - 52:28
    it's at least not that easy.
    That's all I can say.
  • 52:28 - 52:33
    Herald. Whow? What the bunch of
    information, Sebastian? I really love the
  • 52:33 - 52:36
    .... There is someone else with a
    question. I really love your replication.
  • 52:36 - 52:39
    Actually, it was really immediately fun
    to, go.
  • 52:39 - 52:44
    Question: Thank you so much for a great
    application. And my question is, just very
  • 52:44 - 52:50
    short. Can you also integrate external
    sensors through Wi-Fi or is it only to be
  • 52:50 - 52:53
    early?
    Sebastian: No. That's what I meant with
  • 52:53 - 53:00
    the network connection. Network usually
    has Wi-Fi in this case, I'm not sure if it
  • 53:00 - 53:05
    would work on a conference like this into
    the cable. So now you can get the data
  • 53:05 - 53:13
    through our REST API. Might not be the
    fastest thing. Maybe we will add to our
  • 53:13 - 53:20
    network, our new network functionality,
    something that will keep open apart and
  • 53:20 - 53:25
    push the data in there, so far the best
    thing to go is with our rest API.
  • 53:25 - 53:27
    Question: I was just thinking about the
    external sensor connection.
  • 53:27 - 53:33
    Sebastian: So external? Sorry, I was
    thinking a different direction. Actually,
  • 53:33 - 53:36
    that's a good question. That reminds me of
    that, that there's something I wanted to
  • 53:36 - 53:42
    add. You can use the REST API in theory to
    push data in there, but that's only a
  • 53:42 - 53:46
    parameter in the Url. It's simple a Get/
    push off a single value which doesn't get
  • 53:46 - 53:52
    get you far and which is quite
    inefficient. However, within you network
  • 53:52 - 53:57
    interface you can do requests to other
    devices so you can GET request and already
  • 53:57 - 54:02
    is able to respa Json packet as a
    response us to interpret the adjacent
  • 54:02 - 54:05
    packet as a response. And that's where
    adding Mqtt and stuff like this, this is
  • 54:05 - 54:10
    supposed to go in both directions. But
    this is really new. So if you've got
  • 54:10 - 54:14
    something specific, try if it works or
    contact me if it's not working, if you
  • 54:14 - 54:20
    need some help, if you find the bug. So but
    it's supposed to work on your network
  • 54:20 - 54:23
    stuff. That's there in the configuration. So
    the idea of the workflow of all this
  • 54:23 - 54:28
    connection with specific devices have
    something set up like this. You create a
  • 54:28 - 54:33
    configuration for Phyfox, which in the end
    is supplied to the QR code. For example,
  • 54:33 - 54:36
    the user scans the QR code. And this all
    the information, how to communicate with
  • 54:36 - 54:42
    the device is already supplied. You can
    also do this for Bluetooth. That the
  • 54:42 - 54:45
    device itself provides it to Phyphox.
    But in the end it's these configurations
  • 54:45 - 54:51
    and for the new network interface, it can
    also receive data from the network. But so
  • 54:51 - 54:56
    far only via HTTP.
    Question: OK. Thank you.
  • 54:56 - 55:02
    Herald: I have maybe a last question if no
    one else has. What's the next step? What
  • 55:02 - 55:06
    is your next goal? Because this is a
    tremendous successful thing. And you see
  • 55:06 - 55:12
    the educational purposes. So that's
    fantastic, actually, isn't it? It's not
  • 55:12 - 55:18
    only on university level if you're using
    it, that's all around in Germany.
  • 55:18 - 55:20
    Sebastian: That's not in Germany. It's by
    the way another thing you could
  • 55:20 - 55:24
    contribute. If you're speaking a language
    that has been translated into Phyfox is
  • 55:24 - 55:29
    translated by volunteers and it's already
    available, I think in 2010 and 2012, 2013,
  • 55:29 - 55:34
    14 languages, something around this. So
    yeah, but next step I think will be using
  • 55:34 - 55:38
    the camera because that's another sensor,
    broadly speaking, which we are not using
  • 55:38 - 55:44
    at all, which can do a lot, but we haven't
    yet started on this. So lot to do in this
  • 55:44 - 55:46
    project.
    Herald: Super. I'm looking forward to see
  • 55:46 - 55:55
    you next year then. Laughing, Applause
    Sebastian Starks, thank you very much. An
  • 55:55 - 55:58
    honor and a pleasure to have you.
  • 55:58 - 56:02
    Postroll music
  • 56:02 - 56:24
    Subtitles created by c3subtitles.de
    in the year 2020. Join, and help us!
Title:
36C3 - phyphox: Using smartphone sensors for physics experiments
Description:

more » « less
Video Language:
English
Duration:
56:24

English subtitles

Revisions