Computer Science2024

Investigation and plan

My task is to create a project that in theory could help a person’s mental and or physical well-being using microbit and document the process. I will make an embedded system that can in some way track or help the user mentally or physically, make an analysis software code to graph the data of the user and make a prediction based off the information recieved, finally I will make a website showing the process of making the project.

- My chosen idea

When I first thought of mental and physical well-being, what instantly came to mind was addictive substances such as vapes becoming a massive problem for young people. While it's a lot more of a social issue that can’t be fixed with just microbits, I thought maybe I could find a way to help show your progress while trying to quit.

The idea is that you can input how much you are craving a vape on to your microbit on a
1-5 scale, it will live graph your data, and then whenever you wanted to view the data it would generate an excel file with the data.

In theory, viewing the data could act as a potential motivator to quit as you better your progress.

- Rejected ideas

• "Workout intensity playlist"
Crafting the "workout intensity playlist" turned into a more intricate idea than initially anticipated. The concept was straightforward: leverage the microbit's Bluetooth connectivity to sync with your phone, then curate a playlist based on the intensity of your workout inputted on the microbit. However, the development for this project stretched beyond my estimated worktime.

• "Hydration reminder"
Making a “Hydration reminder” crossed my mind as it is simple, yet effective. I couldn't think of any way to expand upon this idea, making me want to choose something else.

• "Comfort level tracker"
Considering a "comfort level" project seemed like a solid idea. It involves tracking light sources, heat, and more, which could be useful for the microbit to help people decide if a room is suitable for relaxation or studying. However, as much as it's a good concept, it felt a bit too simple for the capabilities of the microbit, pushing me to opt for something a bit more challenging.

design, implimentation and testing

Firstly, I created a Microsoft MakeCode project where users can input their "addictivity" rate. The addictivity variable ranges from 0 to 5, with 5 indicating a strong craving for a drug and 0 indicating no thoughts about it.

Visually, the variable is represented by a "staircase" style image, and a smiley or sad face depending on its value. to link the variable to the A and B buttons, I used a "change variable by 1" block. Pressing A decreases the value by 1, and pressing B increases it by 1.

Lastly, I added a visual graph using "function plotgraph" and "serial write line" blocks. This allows users to select their addictivity level and see it displayed visually on the micro:bit screen.



Now, when the user changes the variable it shows up on the data simulator in makecode. This data is tracked on what time you changed the variable value and what variable level "addictivity" is currently at.

This data can be automatically graphed and displayed in excel by simply pressing the download button in the top left of the data terminal. The only next step I had to code was the analysis software to analyse the data in this excel or csv file.



I coded the excel file reader in python, users input the file path of their downloaded excel file and it automatically reads the data in the columns to make the prediction of the users well being.

A video of the embedded system and the analysis code is in the downloaded folder for this project called IMG_0.

Making the website itself ended up being more complicated than I expected. I used a website IDE for microbit called Neocities to have a way to download my website, but also so I could have the project on the intenet. I borrowed assets from W3 school's free website templates to make the website user friendly, intuitive and interactive. I was able to add sidebars, headings, back to top buttons and in general have more control over the feel of the website.






What if...?

What if the users addictivity is high or low? what happens?

Well, if the users variable is above or equal to 3 over an extended period of time (10 minutes of run time, this is timed by the data simulator in microsoft makecode), it will give you a positive message for the user to stay strong and that overtime will see improvement. If the variable is below 3, it will display a message congratulating the user to keep going and that their progress is going well.
Data types: time(integer) and user variable/addictivity (string)



What if the user data variable does not change after significant amount of time?

Well, if the 0-5 addictivity variable remains unchanged for 4 hours the microbit will assume that the user is no longer using the microbit to save its battery. It will automatically shut down by using the quit() command which stops the code from running. Data types: Time(integer) and user variable/addictivity(string)


Evaluation

This project has heavily improved my skills in problem solving, coding ability and general understanding of the work that is done in the field of computer science. I was challenged with errors and coding problems many times throughout the time of the project which I ended up being able to suppass. I can confidently say that this project was done to the best of my abilities, and that I believe the aims I was tasked with, have been completed.

My project features the embedded system, a user friendly website containing the details of my work, an analysis coding program that makes a prediction with the users data done successfully.

I was faced with many difficulties as well, such as the analysis program needing coding knowledge that I had not yet known, the embedded system proving more difficult than I thought with the first ideas that I had, and numerous errors throughout as well. Fortunately I was able to overcome these challenges and learn from them.

Overall, I believe my project completes all the critera. A well developed website, a strong embedded system and analysis program and I also think the project concept was modern and necessary into todays world.




references

https://neocities.org -- This allowed me to code and create my website, download and submit my project brief.

https://makecode.microbit.org -- This allowed me to code and make my embedded system with the microbit

Thonny (application) -- This is the IDE I used to code my analysis program

https://stackoverflow.com/questions/14941097/selecting-pandas-column-by-location -- stack overflow was typically the website I used to find solutions to problems that I could not fix by myself

https://www.w3schools.com/w3css/w3css_templates.asp -- I was able to use some style sheet assets from w3 schools free template sites

Imovie (application) -- this was used to edit my video for the project


Video

A video of the embedded system and the analysis code is in the downloaded folder for this project called IMG_0. Unfortunately Neocities (HTML IDE) does not allow video outside of youtube for free.