As discussed in the Brainstorming blog there had been a list of work that needed to be completed by my group, this includes:
1. Creating a HRV wearable (Myself and Hasan)
2. Building a wave machine (Everyone)
3. Wearable to/from Tweet, spreadsheet using IFTTT (Jack)
4. Calculate phase difference for servo output. (Everyone)
The class had been split into two groups one to design a the wave machine and the other to design a teddy bear that would "breath" according to the users HRV.
To begin the lock in the Pulse sensors for the HRV measurements needed a way to stay in the same position so that a user was able to give accurate and meaningful measurements. Originally Hasan was assigned this work but he had not any experience in 3D printing so I decided to jump onto this and help out in order to get the wearable out of the way as quick as possible so that the group could work collaboratively on the wave machine later down the line. For this I decided to scroll on Thingiverse for pulse sensor covers and to print a few different types out and see how they differ in measuring HRV.
The first casing that was made was a finger snap this was printed in 30 mins and fit nicely with the pulse sensor inside.
Hospital Type pulse sensor enclosure
The second model was a bracelet but did not give very good readings and was difficult to attach because of how small it was and the holes printed for attaching did not click together properly and required sanding so this model was scrapped.
Bracelet pulse sensor enclosure
Another pulse sensor attachment that was printed was a ring type sensor encasement, similar to the bracelet this was also difficult to attach and did not give good readings.
Ring Type sensor enclosure
After the sensor enclosures were all printed they were tested too see how the enclosure effects the sensors performance. The hospitals type sensor was the clear winner here so a second version of the enclosure was printed so that both groups would have their own wearable that would accurately measure their HRV levels.
Pulse sensor wearable working
At this point I had wanted to 3D print more artifacts given it was convenient and efficient to turn on a print do other work. So I decided to print a servo housing that would rock the ocean in a bottle back and forth by lifting one side of the bottle up and down. I went with a 2 Axis design I had found online with the hopes of attaching it to the built.
Once it was printed and tested the servo was not able to lift the bottle full of liquid by itself meaning that we needed another way of moving the bottle.
2 Axis motor housing
In the mean time while I was 3D Printing Jack and Hasan were busy assembling a cardboard version of the Wave machine that would lift the ocean in a bottle back and forth.
Once built I had created a simple Microbit script that would change the position of the servo motor based on a button press.
Manual servo motor test
This had allowed us to manually test how well the servo would lift the bottle and we could make adjustments to the artifact if needed.
In order to help the servo motor achieve lift Jack suggested the idea of installing pulleys using nuts and bolts which were installed to the cardboard iteration in order to decrease the amount of work that the servo motor had to do while increasing the servos output force. This resulted in the motor running smoothly and easily lifting the bottle up and down.
Wave machine iteration #1
I wanted to have a better understanding of how this worked so I found by watching a video afterwards that the more pulleys that are used the higher output force that could be achieved, a good example of this is a screenshot of a YouTube video that I have labelled on how pulleys work:
This shows that a small amount of force applied to the input pulley results in over three times the output force.
If you are interested in this particular YouTube video it can be found here:
This brought day one of the lock in to a close with the work set out for the next day being to make a more polished version of the wave machine and integrating the MQTT cloud board.
8/05/24
HRV Lock in Day 2
During the second day of the lock-in, Hasan and Jack found some old hardback ring binders that we could use as templates for the second iteration of our wave machine. Meanwhile, I discovered a pulley mechanism on Thingiverse that seemed perfect for our project. However, there was a catch the original model was too large and used 6 mm bolts which were very bulky and would stick out significantly on the finished product.
To solve this, I resized the 3D print to half its original scale. This adjustment allowed us to use smaller 3 mm bolts and significantly reduced the print time from 1 hour and 5 minutes to just 17 minutes per pulley.
Full scale pulley vs Half scale pulley print time
Once the pulleys were printed, Hasan noticed a small gap between the two halves when they were placed together this led to the rope slipping and getting stuck inside the pulley itself. To fix this, we clamped the pulley together with the frame using nuts and bolts. Additionally, we added tape to the inside of the pulley to create a smooth surface, ensuring that the rope could glide smoothly without getting stuck.
Inside of pulley lined with blue electrical tape.
Fully Assembled wave machine
Once the wave machine was assembled, we used the script mentioned earlier to manually test the servo motor's movement. This test was designed to mimic a user's Heart Rate Variability (HRV) input, which we planned to implement later.
Now that the wave machine component of the project was finished it could be added as one of the MQTT outputs that is part of the existing MQTT Cloud board architecture.
This would mean that we just need to make the existing HRV code an input to the system and make the wave machine an output for the system.
Proposed Project Architecture
HRV System.
In order to take an accurate HRV measurement we had used a new version of Jason's HRV code which auto calibrates the system to adjust a users max and min pulse every time button A is pressed. This was changed and the code for updating the min and max pulse for HRV was moved to function that executed every second meaning that an even more accurate HRV measurement would be sent across the radio network:
This HRV measurement can then be received by the cloud board to process and then send it back out to the wave machine.
Sending HRV via radio
Cloud Board System.
The cloud board was then set up to receive the users HRV via radio signals, this would then send the HRV value to the wave machine via MQTT. This meant that as the HRV data was being sent it could also be seen on the MQTT dashboard app. The code for the cloud board itself used the same design pattern covered in blog 4 only this time instead of sending the roll value from the micro bit HRV was sent instead.
This means that since HRV was swapped in place of roll, the system can preform any IFTTT action when triggered by the right HRV value. For example if your HRV has a very low spike it could trigger a push notification to warn the user.
Along with all of this functionality Jack had also managed to integrate the cloud board with google sheets by using the IFTTT protocol which allowed for the real time logging of HRV data.
Wave Machine System.
The wave machine was then set up to receive a radio signal from the cloud board that is triggered via MQTT.
The Wave machine used a mapper function to map HRV values to servo motor positions, making the system move up and down as the users HRV does.
Snippets of the servo motors mapper function
Fully assembled wave machine
Conclusion
Overall the creation of the HRV Wave Machine was a challenging but rewarding project. Over the course of two days (and a semesters worth of preparation), we successfully developed a wearable HRV measurement device, built two wave machines, utilized pulleys, and integrated the wave machine into the MQTT cloud board architecture and mapped incoming HRV values to servo motor positions, effectively translating HRV data into physical motion.
Alongside this i feel that my 3D printing skills have improved by working on 3D printing the sensor enclosure. This directly led to more accurate HRV measurements, as the hospital-type enclosure provided the most stable readings. The enclosure improved the precision of data sent to the MQTT cloud board, ensuring the wave machine's movements accurately reflected the user's HRV.
This of course would not be possible without the contributions made by previous students of the Applied robotics lab who had worked with the MQTT cloud board, it is clear that their efforts had laid the groundwork for out groups achievements.
An example of the HRV Wave machine can be seen in the following video:
Iteration #2 - Micro: Bit Research & HRV Jack Duggan | 20094010 | IOT Apps For the second iteration sprint of the module, I got hands-on with the Micro:bit. I had previously used these devices way back in secondary school for Leaving Certificate Computer Science, so the basics came back to me fairly quickly. We were sent home to 'research' the Micro:bit, and become familiar with it's basic functionality, before class on Friday the 2nd of February. In the class, I worked alone (as we had an odd number of students present) with a Micro:bit V2, an expansion board for the Microbit, and a heart rate sensor. Above is the physical setup Below is the device output screen with my finger on the sensor. The top graph shows my pulse as analogue input as identified by the sensor. Some mathematics is performed (as shown under the below graph) that converts these pulse values to HRV (delta_t). This HRV value is then displayed on the 'boxier looking' graph underneath. The way t...
Iteration 5.2 | The Lock-In 🔒 Jack Duggan | 20094010 | 10/05/2024 The "lock-in" was something initially devised months ago, an idea that involved taking a couple of days towards the end of the semester to commit fully to this module. As the semester began to wind up in terms of general workload, it became increasingly apparent that this "lock-in" would be necessary. In week 10/11 when we finally set it in stone, it was a great relief off all of all shoulders, knowing it was one less module to stress about, especially with already rampant workload due in week 12/13. With the lock-in pencilled in for the second week of May, it allowed myself and the others to put increased focus on other modules, and helped reduce the stresses we faced at this time. Eventually, the lock-in week did come around, and I and the others arrived in the room on Tuesday 7th May at 10am sharp. We had split into two teams, one team consisting of Emma, Conor and Eric that would look at adding H...
What is it? Heart rate variability (HRV) is the measure of the variation between heartbeats. It is controlled by your autonomic nervous system (ANS). This system operates automatically and regulate process such as the heart rate and other bodily functions that are are not under conscious control. This system is broken into two branches the flight or fight (which preparing the body for action and stress) and the rest + digest (which promotes relaxation + recovery). HRV is influenced by the ability to smoothly shift between these two branches. High HRV: Larger difference between successive heartbeats - Indicates a more flexible and adaptable autonomic nervous system. Low HRV: Smaller differences between successive heartbeats - Indicates a less flexible autonomic nervous system. ...
Comments
Post a Comment