Iteration 4 Dominik - IOT and Cloud putting it all together.
So far the functions of the Steam Punk Hat are:
Accelerometer tracking movement
Gyroscope tracking the tilt of the head
Tunnelling Breath to the microphone to create a sensor measuring breath in and out
Pulse meter measuring the BPM
The hat has a bellows with an actuator servo moving up and down.
It’s now time to put it all together and have this data be sent to a cloud dashboard where decisions could be made based on the certain data values. This project now enters the smart wearable tech sector. Wearable devices are becoming more and more popular. Lots of people are wearing smart watches every day but there is research being done today technologies like wearable clothing. This project fits nicely here as we have a lot of sensors that give a lot of information about the human body for example:
Movement: counting the steps and how fast the person is going
Pulse : The heart rate of the person, are they stressed, maybe low pressure? Maybe even absence of pulse?
Breath : Physical and mental state of a person can be deduced from the way they breathe. (https://ideas.ted.com/feeling-anxious-the-way-you-breathe-could-be-adding-to-it/). A lot of research is done in this field and it relates to how you breathe and also your posture. With a correct breathing technique you are guaranteed better sleep, reduction of anxiety and stress and have greater control over your state of mind. Will hoff very famous for his super human ability to withstand extreme cold temperatures says his secret is the breathing. https://www.wimhofmethod.com/breathing-exercises.
The Position of the head especially the tilt is also a good indicator of posture which also has an impact on the wellbeing of a person. Bad posture is also a indicator of poor physical condition of exhaustion.
From the above sensors many observations can be taken the most interesting to us are:
· Heart – BPM
· Breath – In, out and hold
· Steps – Step counter, step per minute, toggle step, moving yes or no.
· Posture – is head down, raw tilt value
· Fall indication- on free fall trigger
Once its known what to measure and take from the sensor the data can be sent to the cloud. We used MQTT and the microbit cloud expansion board. After setting up a beebotte channel and dashboard for the project and setting it up in the microbit code it was time to start sending data. The beebotte dashboard is not the best for real time data so an app like MQTT IOT panel can be used and set up by creating a panel and adding the account keys as username and password to the app.
The first test was to see if it’s possible to receive live data from the pulse sensor on a graph and having a little monitor on the phone. Measuring the time it takes to send an MQTT message is only 4ms it was possible but the graph quickly got messy as the sensor is sensitive to the pressure and it would need to be scaled properly before it is sent.
Since the amount of data being sent is a lot of individual values having something in real time is not viable and also the with the new design pattern we want all the code on a single microbit inside the hat.
While sending the data onto the Beebotte broker we found a few interesting bugs or issues.
1. Sending the data to the broker over a certain limit of characters is not cleared by the esp chip on the cloud board and its appended to the next message.
2. Having the text log on the dashboard actually buffers the messages in a queue until they are printed this slows the retrieval of the data down.
3. The cloud board needs to be powered of the battery not the usb supply as the amount of current is not enough for the internet chip to perform decent comms.
My ideas for using this data that’s in the cloud is:
playing a song that matches the steps per minute or BPM of a person,
Gamifying of breathing patterns and techniques such as Will Hoff’s method,
Sending a message to a trusted contact when there is a very low or high heartrate and fast or irregular breathing.
Sending someone an animated live beating heart matching persons real heartrate.
The code :
https://makecode.microbit.org/_DmP5CXaARLRF
The Next Blog iteration will close out the project and that's where I will explain how to set up the Project and explain how the code works.
Dominik Wawak, April 2023.


Comments
Post a Comment