Blog 6 - Lock in

Source: Canva AI
 


7/05/24

HRV Lock in Day 1


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. 


Testing HRV sensor enclosure
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:


Link : https://youtu.be/rFSGY9IteMw


3D Print Links

        Heart with pulse
         Pulley mechanism
        Sensor ring - Wasn't great fit
2 Axis servo mount
        Pulse sensor finger snap - Worked very well 
        Pulse bracelet - did not work great bad fit on the hand



Code Links










Comments

Popular posts from this blog

Iteration 2 | Jack | HRV Micro:bit Research

Iteration 5.2 | Lock In | Jack

Week 1: HRV Review