Have a Little Heart (Rate Sensor)

This post has been republished via RSS; it originally appeared at: Channel 9.

Daniel Wertheim shares a cool little(?) project that mashes together a number of components, services and technologies...

Visualising my heart rate on stage using a Hue lamp and a heart rate sensor and .NET

"This week I held a talk at Swetugg, a two day Swedish conference for .NET developers. My title was: "NATS, what a beautiful message protocol!". In order to show a good use-case of NATS I put together a small demo where I read my heart rate in real time using a sensor and ANT+ SDK, which was published via NATS. I then had two different services (apps) running. Both subscribed to the NATS subject to which the heart rate readings were published. One service wrote the data to InfluxDB so that it could be visualised in Grafana. In another subscriber I took the data and matched it to a certain colour and then used the HTTP-API of the Philips Hue bridge to make a Philips Hue Go indicate if I was "calm" or "stressed".

...

The overall solution

I put together a small sketch to give a quick overview of how the pieces worked together

image

Some Docker containers...

The "message" HeartRateReceived...

ANT+ SDK...

The Indexer...

image

...

The HueController

The last piece was a service/app that got a copy of the published message and updated the colour of the lamp. If you are interested, you can get more information about the API of the Philps Hue bridge: https://www.developers.meethue.com/documentation/getting-started

...

This demo worked well for me. And shows a very good use-case for NATS. Pumping frequent, small sized sensor data, where transactional guarantees is not needed and "at most once" delivery is OK.

That's it. Hope it can inspire you to build something as well."

[Click through for the whole thing]