Week 9

John Cheung - Sun 17 May 2020, 1:18 am

Video Demonstration

This is the prototype video I created for this project. The first part introduced our team domain and problem space. Followed by the target audience and the intended experience that i wish to bring to them. The second part is a 1 minute user testing, the interaction plan and real demonstration will be recorded in this part. The third part is the major components of this project which was simply mentioned in my week 8 journal, some changes are applied in the final prototype. The fourth part is the functionality description, including heart rate visualisation, breathing instruction instruction and heart rate detection and judgement. At the end of the video, I will explained the simulated features and what I am looking for and planning to implement in my final product.

Code


void loop() {

  uint8_t rateValue;

  uint8_t goodRate = 0;

  int soundsens = analogRead(soundpin);

  heartrate.getValue(heartratePin); ///< A1 foot sampled values

  rateValue = heartrate.getRate(); ///< Get heart rate value 

  if(rateValue)  {

    Serial.println(rateValue);

    goodRate = rateValue;

    u8g.setFont(u8g_font_unifont);

    u8g.firstPage();

    do {

       if(goodRate!=0) {

        char beat[8];

        sprintf(beat,"Beat:%3d",goodRate);

        u8g.drawStr(20,40,beat);

       if(goodRate > 98){

            

            u8g.firstPage();

            do {

            adraw4();

            digitalWrite(ledPin, HIGH);

            digitalWrite(ledPin2, LOW);

            digitalWrite(ledPin3, LOW);

            } while( u8g.nextPage() );

            delay(4000);

            u8g.firstPage();

            do {

            bdraw7();

            digitalWrite(ledPin, LOW);

            digitalWrite(ledPin2, HIGH);

            digitalWrite(ledPin3, LOW);

            } while( u8g.nextPage() );

            delay(7000);

            u8g.firstPage();

            do {

            cdraw8();

            digitalWrite(ledPin, LOW);

            digitalWrite(ledPin2, LOW);

            digitalWrite(ledPin3, HIGH);

            } while( u8g.nextPage() );

            delay(8000);

            u8g.firstPage();

            do {

            ended();

            digitalWrite(ledPin, LOW);

            digitalWrite(ledPin2, LOW);

            digitalWrite(ledPin3, LOW);

            } while( u8g.nextPage() );

            delay(4000);

            break;

        }else{

          continue;

          }}

      else {

        u8g.drawStr(10,20,"Wait!");

       }

      } while ( u8g.nextPage() );

  }

  delay(20);

}

There are two major components in this program. The first part is displaying heart rate on the OLED screen by changing the unit of the default heart rate sensor data to suit the Arduino working environment.The second part is identifying whether the user's heart is above 98, the 4-7-8 exercise will be activated in this case with the aid of LED light. After completing the 4-7-8 exercise, the system will check the user's heart rate once again to determine which situation they are experiencing.

Reflection

Before finalising this version, I have got a very big problem when I was doing the user testing with my previous prototype. In the previous prototype, I installed a microphone to guide users to practice 4-7-8 exercise, the green light will be switched on when the microphone sensed the correct input throughout the whole 4-7-8 process. They need to perform the correct action to jump into the next stage, for example: Breathe in for 4 seconds -> Hold breathe for 7 seconds. But no user reported a drop in heart rate even 10 rounds of 4-7-8 exercises were performed. But this situation got better when I removed the microphone. It may be due to the stress and anxiety brought to the users when they were doing the task wrongly. For my final prototype, I removed the microphone and replaced it with the 3 colors LED lights.