Week 9 Journal

Sicheng Yang - Fri 15 May 2020, 9:30 pm
Modified: Fri 15 May 2020, 9:32 pm

Prototype so far

The first relatively complete prototype has been made so far. In the workshop report I got suggestions on how to fix the display. I ended up using a crooked hanger fixed above the helmet. Because the hanger is thick and triangular, it is generally stable, and the display can finally be seen clearly. In addition, regarding the pedometer (actually an accelerometer), after the median filter is implemented, the value has reached a relatively stable state, but in fact in some cases one step will still be recorded as twice. However, the 2: 2 breathing method used in this prototype is based on the number of steps, so the inaccurate number of steps actually has a greater impact on the user experience. But for the time being this is an acceptable result.

So I took a nice photo of it, using the black door as background makes it cyber-ish.

Prototype Helmet

code sharing

Always forgot this function from journal. I'd like to share the median filter implementation.

bool getIsBreathing()


  int arr[100];

  int sum = 0;

  for (int i = 0; i < 100; i++) // get sensor data 100 times


    arr[i] = analogRead(soundPin); // data from analog in


  sort(arr); // bubble sort, see below

  sum = 0;

  for (int i = 45; i < 55; i++) // get 10 values in middle 


    sum += arr[i];


  sum /= 10;


  // judge if over threshold

  if (sum > 100) { //baseline is 70

    return true;


  return false;


Above is the function of getting breathing data and filtering with median filter. Because values from sensor can shift between some random low and high values that influence the performance. But in the most conditions, it will get correct data. So the median value usually will be the most stable data. In that case I can get more reliable data.

The accelerometer uses the same method, but it involving complex Wire library data reading so I think sharing the breathing filtering would be clearer.

void sort(int myArr[]) // bubble sort


  int len = sizeof(myArr) / sizeof(myArr[0]); // get array lenth: total-byte-lenth / first-element-byte-lenth

  for (int i = 0; i < len - 1; i++) // bubble sort


    for (int j = 0; j < len - i - 1; j++)


      if (myArr[j] > myArr[j + 1])


        int temp = myArr[j];

        myArr[j] = myArr[j + 1];

        myArr[j + 1] = temp;





And here is a classic bubble sort method to get the array sort quickly. First time dealing with C language, I'm not so used to having no Array.sort() function helping me out. But those solid algorithm can always save me from the mess.

Video designing

Video design is always an interesting part. I think if I can't find the job of interaction design, I might be able to be a director. I asked Nick to film a story as he after running and checking the app then scratching his head feeling it useless. I think this part works really well.

Because the camera of my prototype basically can only be seen by the user, it makes filming more difficult. In short, I shot a video of a front user running with helmet and a video of only the head and screen from the diagonal back and edited them together. The effect is better than I expected.

I also tried to use Fritzing to draw the circuit diagram, which is very convenient. I should have used it to design my prototype, otherwise it may not be wrapped by the line as it is now.

circuit diagram

Here is the video, take a look if you are interested.

User Testing & Reflection

When I was shooting the video, I also collected user feedback.

The current feedback focuses on users reporting that the helmet is too heavy, mainly because I used a 6 AA battery pack. And because of the time, I wasn't able to build a tutorial screen. The prototype will directly enter the training mode after booting, and the image will not appear until the user finishes the first step, which caused trouble for the user to start using it. Maybe later need to add more detailed instructions to guide the first time users. But after they were familiar with the interface, they all said it was easier to understand.

The good news is that they all believe that this prototype will help running breathing training. But the bad thing is that they did complain about the inaccuracy of the pedometer (yes, they can feel it) and they feel confused about the training when it gone wrong.

So in the following, I may mainly try to solve the problem of the pedometer and make it more accurate.