Dear viewer, these subtitles were generated by a machine via the service YouTube and therefore are (very) buggy. If you are capable, please help us to create good quality subtitles: https://c3subtitles.de/talk/2156 Thanks!
[Laughter]
[Music]
[Laughter]
the upcoming talk is about the cardio
badge two years of evolution um please
let's all for second remember back 2019
the last camp that is what it looks like
um you were d uh it was dark there were
some jimnys in the background there were
lots of very shiny very beautiful lights
and on your wrist your uh your cardio
your
badge that's what uh what this talk is
about uh your speakers Schneider and Ray
hi will explain the new possibilities
that came up in the previous two years
for that batch uh Schneider is working
on has been working on most of the
batches actually he's been working on
the rocket the radio
sdr1 and also on the cardio and R is a
rust Enthusiast and a cardio firmware
hacker and with that enjoy the
talk hello this is rahik I'm Schneider
we're here to talk to you about the
cardio
batch let's start the adventure timer
and see how long this is going to take
us not everyone might be familiar with
the cardio batch so we're going to
quickly introduce it the iio badge is
the badge of the C communication Camp
2019 it's a wrist mounted device packed
with sensors featuring a micropython
interpreter and Bluetooth low
energy it's able to take an ECG it has
an accelerator meter a air quality
sensor and a bunch of other things The
micropython Interpreter makes it
possible even for beginners to program
it without writing a single line of
embedded C code this was the goal of the
cardio to get people to work with such
embedded systems and provide a companion
during Camp to interact
with you can see the picture where
someone embroidered a LED onto their
wristband using conductive thread
connecting to the side of the cardio
where we have easily accessible contacts
you can use micropython to interact with
them get the LED lighting for example
when someone sends you a
message producing the cardio bed was
quite a challenge in
itself the project
failed
dramatically almost multiple times if
you're interested in such Hardware
products and how they come to be and
let's say just half a year you can check
out this threet on
Twitter it details everything from the
design phase to the first prototypes to
in quote mass production of the cardio
bch right up until Camp during camp a
lot of things happened the firmware
improved a lot people had a lot of fun
and we're here to talk to you about what
happened
afterwards one of the notable things
might be that we had some workouts in
Berlin to get together and improve on
the cardio or just help people out who
want to work with them due to all the
things you know happened in 2020 and
20 this wasn't possible anymore so we
held virtual workouts which is how we
call the meetings uh which we are doing
to work on the cardio you see a
screenshot of our virtual meeting at rc3
last year where someone was pointing
their microscope at one of the sensors
on the top of the cardio to have a look
at what's actually going on in
there before we go further into all the
details of
cardio a
personal note if you own a cardio please
get a case it's important to protect it
and make sure that your display for
example stays intact while you're
wearing it and that you have a lot of
fun over the coming years with your
cardio it also makes it possible to more
easily interact with it because the
buttons are quite small and most cases
provide better access to them there's
more elaborate cases and there's easier
cases to produce some of them are 3D
printed some of them are laser cut if
you own any of these machines a laser
cutter or 3D printer do yourself a favor
produce a case if you don't have one ask
around we have a Wiki page with
different designs and the sources to
them check them out and have fun with
them RX is now going to talk a little
bit about the firmware the apps and
other things which make the cardio
actually do
anything on cardio we have a dual course
or microcontroller we use this to have
an operating system on Core 1 which has
the Bluetooth stack and sensor Services
running the other core is entirely
available to the user and by default it
runs a micropython interpreter so you
can easily write scripts in Python but
you can also write your own applications
for this core in C or
rust using the provided API between the
two cores this is all documented in the
fir
dos on the other side of Bluetooth on
the phone we have a companion app for
Android this app is available on fdroid
using the provided QR code on the slide
the companion app is used to access some
of the features from cardio remotely for
example you can set your personal State
there or you can upload files to the
cardio's fire system or you can install
apps apps come from the Hatchery the
Hatchery that's an a repository from
batch. Team for batch apps um which
supports cardio among other badges many
cool apps were uploaded there during
camp and afterwards so far we've counted
191 submissions for cardio there we want
to show some of those here that's micro
marble that's a game for cardio using
the accelerometer we want to show this
because it is written in Python and it
demonstrates how much you can do with
cardio even as a
beginner
and it is written in Python but it still
runs surprisingly smooth running on a
microcontroller there's also a lot of
other apps for example Persistence of
vision displays using the RGB LEDs on
cardio there's a lot of apps using the
sensors creatively for example XIs a
compass app or an
altimeter and because cardio looks a lot
like a smartwatch many people have been
writing watch faces for it for example
the control center
but even though cardio looks a lot like
a smartwatch that's not the only thing
it can do it has a lot of sensors and
you can do a lot more than just wear it
on your wrist as a watch just as an
example cardio would be just one step
away from becoming your next bicycle
tail light with an integrated brake
light we now want to show some
demonstrations of what you can do with
cardio using some of the features which
have been implemented after camp
for example there is f Fox Firefox is an
app from rwth a which transforms a phone
into a mobile laboratory you can use
cardio sensors with Firefox over
Bluetooth low energy and this is what we
want to demonstrate on cardio as schneid
said there is an environmental sensor
the BME 680 this sensor provides some
Standard Environmental values like
temperature pressure humidity but it
also provides measurements which can be
used to infer an indoor air quality
value and this is what we want to
demonstrate to do this let's move over
to the hardware
lab we're now in the hardware lab to
show how to use Firefox to read out some
environmental data from cardio
to do this we first need to prepare
cardio a bit uh the first step is
enabling BC that's a library that is
used to calculate the indor air quality
using the BME 680 sensor data to do this
enter the bme680 app and in the app
there is uh this message to press the
top right button to enable BC this will
reset
cardio and once it's booted again now BC
is enabled in the back background and
starts collecting sensor data next up we
need to uh set up Bluetooth um enter the
Bluetooth app for that and turn on
Bluetooth because it is disabled by
default cardio will reboot again now
with Bluetooth also enabled and now you
need to enter the Bluetooth app once
more uh because this will then put
cardio into pairing
mode okay now on the phone you need to
open the cardio
companion and uh press the pair button
and you should now see a list of cardiio
and select yours
there and um you can press the pair butt
and connect
button now both devices will show a pair
code confirm it on both
ends and you should now have a
successful pairing
now you need to exit uh from the
dialogue in the companion app and you
need to restart the companion app once
because there is still a bug that we
need to
fix once you've done so you can press
the connect
button to connect to
cardio okay with the successful
connection we can now uh switch to
Firefox in fir Fox we want to add an
experiment for cardio environmental data
this can be done with the plus button
and then pressing add experiment from QR
code you need to scan a QR code which
you will find on the cardio
Wiki this will automatically set up the
experiment
now then enter the experiment uh you can
find it um under the cardio
section press the play button
and now cardio will hopefully connect
and you will see some sensor data roll
in uh cardio will update the data
roughly every 3 seconds so one new
sample every 3
seconds and uh I should note that this
runs in the background so um regardless
of what cardio app is currently running
so for example right now there should be
the uh default watch running here here
it is um the BC Library runs in the
background and also the Bluetooth stack
updates values in the
background so in
Firefox um you can see a number of
diagrams there is first three diagrams
for temperature humidity and pressure I
guess those are self-explaining and then
if you scroll down uh there's the in air
quality measurements first there's an
accuracy measurement then there's the IQ
itself um the accuracy will start at
zero and you need to wait for it to
reach either two or three um before the
values make any sense um it will take
some time because the sensor needs to
calibrate itself
first um and once the accuracy is up um
you can see I AQ values um they have a
special meaning which we will show later
and then in the very bottom there is a
CO2 diagram this does not actually show
CO2 values but instead it shows was
called a an equivalent CO2 value and
this is essentially a guesstimate of um
how much CO2 could be in the air um from
the values the sensor
measured on this slide here you can now
see what the indoor air quality values
we just got from in FX
actually mean this table is from the BME
680 data sheet so you can see lower
values are generally
better and uh if the IAQ goes too high
the data sheet recommends that you
should ventilate the room an important
thing to note here is uh the initial
values we get in fifox are bogus that's
because PC needs some time to calibrate
the sensor and only after this
calibration is done we will get
reasonable results you can see this in
the
IQ accuracy value you should wait for
this value to reach either two for
medium accuracy or three for high
accuracy and only at that point uh the
IQ values will make any
sense the setup with fir Fox is one way
to use this but of course you can also
push the data elsewhere this is a
screenshot of a grafana dashboard
showing the same data
in the background there is no red
running and an influx DB on a Raspberry
Pi the idea here is to use cardio as a
Data Logger and you could use this kind
of setup for example to monitor the
environmental parameters of a
room back to fir Fox for a second this
screenshot shows what's going on behind
the scenes there there's this noe-based
workflow on the left there's this
Bluetooth node where cardio sensor data
comes in this sensor data then gets
recalculated into the appropriate ranges
for the diagrams and then gets moved
into the graph nodes on the right to be
shown in the experiment you could of
course change this to do different kinds
of experiments with different sensors
from
cardio with the Data Logger setup it
looks very similar node red is also a
no-based workflow you can see on the
right the graph that's used here the
left nodes are for connecting to cardio
and triggering readout of the
characteristics then the samples get
moved into this function node this the
code for this node is on the left uh
this just converts the samples into the
appropriate format for the database and
this is where the data goes next into
this influx DB from where grafana can
then read out the values and show nice
diagrams providing environmental data
via Bluetooth low energy is directly
baked into the cardio firmare if you
want to write your own applications
using Bluetooth low energy you have the
option to use the micropython Bluetooth
API to do
this in this segment we're going to show
you how to write a simple application
which controls a few external LEDs on an
LED strip using Bluetooth flow energy
the python code executed by the card
audio is split in three sections the
first one defines the service here you
need to come up with some unique
identifiers called uyu IDs you can look
up the Wiki page which is listed on the
slide to figure out how to do that the
second part
is a function which gets called when a
connection is made or a new packet comes
in via Bluetooth in this case we're
just acting on Bluetooth rights and
forwarding the data to to the RGB LED
strip which we connected via some
crocodile clamps the third section
simply turns on Bluetooth and then spin
Loops in an endless loop waiting for a
connection and data to come
in usually would now put this file onto
the cardio's file system navigate to it
using the menu and execute it but that's
not a very convenient way to develop new
applications instead we want to
introduce you to the py cardio tool
which allows you to directly execute
python files via USB
you call it using p cardio. py and the
file name you want to execute hit enter
and now you can observe it loaded the
data onto the cardiio RAM and started
executing the file it also outputs the
lock data on the same terminal as you
can see it's now the print with waiting
for connection is
shown to send data to this device we've
deviced a little python script on the
host which connects to the cardio and
sends some RGB LED values RGB values I'm
sorry once you execute this it starts to
connect to the cardio which takes a few
seconds and then in Rapid fashion sends
a few RGB values to
it now you can extend this script as
much as you want if you want to have a
flesh once you get a new email or maybe
if someone messaged you no
problem if you disconnect from the
cardio or from
USB you can see that the LEDs continue
lighting the cardio is running on its
battery and the data comes in via
Bluetooth you can find the files to do
this in our Wiki as well as our
repository if you're looking for a more
elaborate example of this function fun
ality we've recently been experimenting
with Apple devices as they provide
native Bluetooth low energy
functionality to companion devices like
the cardio badge they offer the
functionality to receive notifications
for incoming messages if the bluo FL
energy device subscribes to them via
bluo FL
energy you can see a demo of this right
now where a modified gatch registers
with this service of an Apple device
device and receives a notification when
a new email comes
in this is not yet published but we
intend to publish a modified gatch on
the
Hatchery sometime next year so you can
make use of the cardio and this
notification functionality from your
Apple device note that there's no
additional software or app needed to do
this the Apple device already provides
this
another thing you can do with ble is hit
devices human interface
devices cardio has support for these and
there is a hit demo uh included in the
new firmware for example you can use
this human interface device to um
emulate a mouse uh in this case using
the accelerometer which means if you
tilt cardio the mouse gets moved we've
connected this to the Android phone here
and as you can see the mouse cursor can
be remov using cardio now so let's use
this to change the personal state of
cardio in the companion app using
cardio of course a mouse is not the only
device that can be emulated for example
you can emulate a keyboard which means
uh you can press key or do key presses
um which you can then uh send to a
connected host so for example in the hit
demo you can set uh or send uh volume up
and volume down key
presses uh but um this entire interface
is accessible to micropython so you can
very easily use this uh for whatever
applications you
fancy of course one of the main features
of the cardio is to take an ECG to do so
you can simply start the ECG app mount
the cardio to your wrist and press with
a finger on one of the exposed
contacts after some time the signal will
stabilize and show your heartbeat this
takes a few seconds due to the involved
circuitry but eventually you'll get a
signal like that where you can easily
make out your heartbeat at the moment
it's around H 90 BPM I think IEX is a
little bit
nervous we've recently introduced the
feature to receive this data via Bluto
flow energy as well we're making use of
this in our latest release of the cardio
companion and if you open the cardio
Companion now while having the ECG app
running on the
cardio you'll get a new button to take
an
ECG let's press this and as you can
see the ECG data that you see on the
display is now also
streamed to the
phone we're going to work on sharing
this data or making it possible to share
this data and save it to files via your
phone and also have the option to run an
ECG continuously in the
background to make use of this feature
you might want to think about soldering
one of these it's a cable which adapt
the USBC connection of the cardio to
standard ECG connections that for pads
that you can buy um about everywhere if
that's not fancy enough for you you can
also think about getting a chest strap
which wraps around your chest and has
conductive pads on the side this makes
it possible to wear the cardio for
example while running and take a full
ECG while doing
so we've also created an application
which runs on a PC it's written in
Python which also connects via bluo
energy collects the data and applies a
few basic filters it adds a 50 HZ noise
filter to filter out noise coming from
the grid and also creates a um fft to
get an idea of the frequency components
of your
heartbeat after all these demos let's
head back to the main room to highlight
some of the other things which happened
during the last two years in the world
of
cardio a lot of happens in Scamp as you
saw just now but of course that's not
all we want to show a few more things
first of all the battery life time is
much better
now with the new default watch phase
gatch you can get up to two days with
ble disabled or about one and a half
days with B enabled of battery
Lifetime on the slide you can see some
code um you can add optimization to your
own apps by adding this time do sleep
call this is what the firmware uses as a
hint that your application is now not
busy and it then scales down clocks and
does similar things to reduce battery
consumption another thing that was
improved a lot is
B we worked a lot on making B more
reliable and especially getting it to
work reliably with newer generation
Bluetooth
devices we also added some
security so if you remember during camp
we had a lot of people randomly dropping
files on to other people's cardos this
is no longer possible or at least not as
easily because now there's this numeric
comparison um code which you need to
accept on cardio before someone gets a
successful
pairing and as we've shown you can now
Implement your own Services your own B
services from
micropython which also allows a lot more
um ble
stuff we also implemented automatic time
synchronization when cardio gets a ble
connection it will now automatically
synchronize time with the connected
device it does this using a standardized
service called the current time service
this is implemented by default on iOS so
when pairing to an iOS device this will
just work on Android this is not
implemented by default but the cardio
companion app implements it so if you
have that installed and running it
should work just as well importantly
this does not only synchronize time but
also the time zone so wherever you are
you should now immediately get the
correct time on your
badge another thing another few things
that happened USB storage mode you no
longer need to go to the boot loader to
get into USB storage mode to load files
onto cardio you can do this directly
from the firmware now there is a new
menu Point called USB storage
we added RTC um support so deep sleep
RTC support which means that um the RTC
time is kept during off time for the
cardio
uh a much requested feature that we
added is image splitting which means uh
an an and a PNG loader you can now put a
PNG file onto cardio's file system and
easily display it on the display from
micropython
one thing I want to highlight that's
been happening very recently is
integration of a vector graphics
renderer this is CTX CTX is
a is a vector rizer written by Pippin
which is specifically also optimized for
use of
microcontrollers he helped us integrate
it into the cardio firmware and um this
means with the latest release you now
get anti-alias
fonts
for now this is only implemented in the
graphics backend which means um it just
improves the render quality of the
existing Graphics API but in the future
we also want to give direct access to
CTX to user code which means you can do
all kinds of crazy vector graphics
effects on cardio now there are some
other things we want to do in the future
and Schneider will tell you about
them
there's certainly many options on where
to improve the
cardio one of them is the IOS app during
Camp a beta version of an iOS companion
app for the cardio was deviced there was
a test flight version for beta testing
sadly it never made it into the IOS app
store if you are a apple
developer and you're interested in the
cardio please get in touch with us so we
can get the cardio companion for iOS
into the App Store it will allow a whole
new set of users to experience the
cardio in all its
features specifically this also means
installing applications from the
Hatchery at the moment people who use
iOS devices have to mount the cardio in
via USB and drag over some files
manually onto the file system that works
no problem but a nicer user experience
obviously is what Android users have
with their cardio companion where they
can scroll through the apps and just
directly download them through a BL
connection R and I don't have apple
developer accounts that's why it never
happened but please get in touch with us
so we can do
that the other big thing we want to
improve is ECG as you've seen we've
implemented streaming of ECG data via B
and we want to build upon that the
cardio companion is about to receive at
least the ability to save the ECG data
and share it directly from the
app there's some research out there
which looks at how to make use of ECG
data for example to improve meditation
skills or look at how biorhythms of
people synchronize when they interact
with each other this should be much
easier now with ECG streaming via B
enabled if you're an Android developer
and you know your way around cotlin it
should be an easy start to do some basic
analysis on ECG
data there's also quite a bit to do on
improving the documentation of ECG
setups how to use the wrist
straps um how to use oh sorry how to use
um chest straps how to connect them what
kind of options to choose in the ECG
menu of the ECG
application this will
be one of our main focuses to improve
cardio this concludes our talk right
here it took us around 31 hours 43
minutes and 55 seconds to do so at least
that's what the Adventure Time on my
cardio tells me
if you want to get in touch with us you
can have a look at our documentation on
our Wiki the URL is there it uh gives
you links to our git repository our fir
documentation user guide and similar you
can join us in the cardio batch channel
on theet as well as on Matrix the two
channels are bridged to each other so
you can use whatever you you best or if
you're into that thing go to Twitter or
C.O and have a look at our handles
there with this it's now time to go to
the Q&A stage and get in touch with
you so get right yeah
sure thank you very much for the awesome
talk people if you would like to add
questions please put them to Twitter
masteron or thec network uh and we
actually get our first question um is
there a nice reusable um ECG sensor
option um the so set is not very good
for daily
use that's a it's excellent question we
I I tried to touch on that U when we
were in the lab and I show the RIS strap
um sorry chest strap I have one on me
right now I won't pull out my shirt but
you can get these for commercial ECG
sensors they wrap around your wrist and
you can un do them um and there's an
easy way to adapt these um ECG leads
that you can add to the
USBC jacket of the of the cardio um we
are working on
some instructions on that inside the we
but that's the most convenient way and
should also work for example for running
in
similar what will we see as a bank
a the Mi
Camp excellent
question um so you might
remember the um radio badge and the
cardio badge they have something in
common they feature a very specific
sensor or
functionality and that was out of
availability and personal interest and
similar and to give people the option to
play with these things
but if there is going to be another
dadge for Camp
2023 42 years of CCC it should be about
interaction of people it should mainly
focus on social aspects and interaction
with the
camp I think we'll have a discussion
about that early next
year thank you so not a specific very
like not every feature and not that one
specific sensor but more focusing on
people and getting people to talk to
each other and have very lowkey options
of getting in touch and interacting with
each
other all right thanks and is there by
any chance an option left to get a
cardio badge Yes actually we have great
news that we can share um one of the
Hardware Distributors uh who sponsored
the cardio badge um is working on resp
spinning the design files as a reference
design for one of the chips and that's
Maxim Analog Devices now um it's still
in the works we have no clue about the
time scale but um they're working on it
it's in the sap system and it has a
designator so looks uh promising that
it's actually going to happen Okay where
should people uh watch out for this to
uh to get
updates the Twitter account and our car
Social
account
um would you mind going to the bme680
slide because we did update the slides
after the first R and there's one
important one about the bme680 we were
talking about it measuring air quality
and we want to very make it very clear
it is measuring volatile organic
compounds in the air essentially things
you could smell it does not measure CO2
directly but it infers it assumes okay
if there's lots of smell in there let's
assume it's all from humans how much CO2
would they probably have put into the
room as well and that's what the CO2
measurement here is
about because we had questions about CO2
measurements and what they actually
mean right thanks thank you thanks and
um you're probably going to love about
that one but uh is there still a chance
to get a radio
bch there are very few still avail
I think maybe like 10 maybe so if you
approach us with a good idea of what you
want to do with it a project just have
to like convince us that you know should
get one then you'll get
one well good excuse to get into SDR
Hing um at least it's fun
yeah all right um so then thanks again
for the awesome talk thanks for the
patient and answering the questions and
most all thank you for making the cardio
badge thank you we also want to thank
our video Angels who helped us produce
the video we want to thank all the
cardio team we are just two people of a
large team who made the cardio possible
and it wouldn't be without them you can
have a look at the camp talk to see most
of them all right then that was our last
talk for today um at least two of the
stages are still um broadcasting as a
live stream if you would like to
continue uh watching otherwise see you
tomorrow and um please provide feedback
on that talk and on all the other talks
we had today that is really helping the
speakers and um feedback is something
you miss if you just talk to your camera
so be a nice person be be a nice live
form and just do that and with that see
you tomorrow that's
party
bye
[Music]
wow
[Music]
War