Skip to content

joelcelen/desk-buddy

Repository files navigation

Project

Logo

Description

"DeskBuddy" is an environment monitoring system to help people who sit and work. The system has two components: the Wio device that monitors the environment and notifies the user, and the Android app where users can define their optimal environment profiles and select their notifications.

The Wio device continuously monitors temperature, humidity, and light levels. These are displayed graphically at the desk of the user, and indicators change color according to user-defined preferences. The sensor data is sent to the Android app in real-time where they are displayed on the home page, and stored in a database from which users can obtain and plot historical measurements. The Wio device also periodically notifies the user that they have been sitting too long and that they need to stand up and stretch. Users can continue working and monitoring their environment after pressing a button. The device also displays one-time or periodic user-defined notifications, as well as motivational messages, which can be defined or customized in the Android app by the user.

Through environmental monitoring, motivational messaging, and user defined notifications, DeskBuddy allows users to work smarter, stay hydrated, and get regular physical movement.

Getting Started and Installation

To be able to use this system, you need a Wio Terminal, the contents of this repository built and installed, and the following sensors:

For further information on installation please see the following wiki pages:

  1. Configure Wio Sensors
  2. Configure WiFi and MQTT
  3. Automated Build Instructions

Purpose and Benefits

Since the pandemic, a lot of people have started working more or exclusively from their homes. Factors such as light, temperature, humidity affect people’s well being and it is something that is often forgotten or overlooked. Other factors that affect people’s well being are posture and taking breaks.

The purpose of this project is to improve people's health, and their working or studying environment while they are working or studying from home.

Through sensors to measure various factors in their home, and consecutive reminders to check their posture and take breaks. We believe this system will help a lot of people improve their working environment, and benefit them feel better while they are working out of the comfort of their own homes.

System Diagram

Logo

Project status

Release - Final Sprint Delivery with CI and automated tests for Android App (from branch 91): 2023-05-20

Release - Final Sprint Delivery with CI for Arduino / Wio Terminal (from main): 2023-05-20

Release - Final Sprint Delivery (without CI): 2023-05-19

Video Demo

Link to video demo

Authors and Contributions

Contributions

  • Setting up MQTT class for the application
  • Making sure Mqtt connection is not publicly available, gets SSL certificate, and username/password from file in gitignore when starting app
  • Setting up the reminders screen for saving various reminder intervals with Rizwan
  • Setting up the silent mode for reminders
  • Designing logo for the app and setting up the Icon displayed in the phone, and the start screen when you open the app
  • Contributing to various wiki page articles and readme
  • Adding enum classes to the app for easier use of topics and colors that should be published to the Wio

Contributions

  • Wio Terminal:
    • Implementing physical button behavior and functionality
    • Refactor button into OOP structure with .h and .cpp which are called in the .ino in Arduino
  • Android App:
    • Creating home page of the app with behavior and GUI appearance connected to this
    • Creating suggestionsbutton and corresponding page with information regarding sensor settings
    • Overall GUI refactoring/edits
  • Contributing to various wiki pages of the git
    • Sprint pages 1, 2, 3
    • Installation
    • Code review guidelines
    • Description
    • Requirements
  • Contributing to README page
  • Working on the CI/CD and pipeline of the project's git.
    • The pipeline implementation encountered a substantial amount of hurdles before it was able to run. It now runs as it should.

Contributions

  • Setting up MQTT class for the application with Karl.
  • Setting up the configurion process of populating the database with sensor measurements.
  • Setting up the the graph activites of the three indoor measurements.
  • Improve the GUI (All activities) after the second sprint (The non-final refinement).
  • Contributing to various wiki page articles and readme (The commit and code review guidlines).
  • Setting up the light sensor code (The first version)

Contributions

  • Wio Terminal (majority of features):
    • Encrypted MQTT connection (SSL/TLS) to HiveMQ cloud broker
      • BrokerInfo.h file with secrets info and SSL certificate
      • MqttTopics.h file with topics
      • MQTT methods - subscribe to 7 topics, publish to 4 topics
      • Parser methods
      • Non-blocking delay implementation with MQTT - crucial for high-throughput messaging without lag (listen while waiting)
    • Wi-Fi reconnection method with Rizwan
    • Refactoring code from procedural to OOP (as much as possible)
      • Event class - standUp, motivate, notification, publish, refreshDisplay
      • Sensor class - store sensor values, indicator colors, and user preferences
      • Display class - draw methods for setup screen, dashboard, events, removing flicker for high refresh rates
      • LED class
      • Buzzer class
      • Button class with Malte
    • Implement Controller in arduino_src.ino loop() to trigger Views: standUp, motivate, notification, publish, refreshDisplay event sequences
    • Timing of events using millis() to achieve multitasking, precise timing, and responsive code execution of multiple event sequences, each running with own timers in parallel
    • Implementing Wio logic for user defined preferences (user-defined timing intervals, messages, environmental preferences)
    • Fix runtime errors in Wio Terminal (such as message corruption - fix through immutable String objects)
  • DeskBuddy Android App:
    • Populate database with sensor data
    • Co-contribute to temperature chart (database queries) with Ahmad
    • Fix runtime errors in Android Application
    • Improve GUI of MainActivity class
  • Contributions to sprint demos, README and Wiki (installation pages: configuring sensors, WiFi/MQTT setup, automated build instructions)
  • Continuous integration (CI) for Arduino / Wio Terminal
  • Continuous integration (CI) for Android App with Malte, Joel, Kalle

Contributions

  • Wio Terminal:
    • Initial setup of temperture and humidity sensor.
  • Android application fuctionality:
    • Creating the RoomProfile class.
    • Creating the ProfileActivity.
    • Setting up a viewSwitcher and creation of a Settings view within the ProfileActivity.
    • Setting up persisting RoomProfile objects for saving of environmental preferences.
    • Importing RoomProfile objects to the MainActivity and publishing the preferences via the MQTT broker.
  • Android application GUI:
    • Creation of GUI elements in the ProfileActivity class.
    • Rework of overall GUI elements, including animated backgrounds and on-click ripple-effect button graphics.
  • Android application testing:
    • Creating basic unit test class for the RoomProfile.
    • Creating RoomProfile instrumented test class with Espresso testing framework.
    • Creating instrumented test class for switching between the activities using Espresso.
  • Android application bug-fixing:
    • Fixing bugs with loading RoomProfiles on initial application installation.
    • Fixing GUI issues with constraints so that all phones will display the elements correctly.
  • Continuous contributions to project planning, scoping, documentation.
  • Continuous integration (CI) for Android App with Malte, Nasit, Kalle.

Contributions

  • Wio Terminal:
    • Wi-Fi class - WIFI.h and WIFI.cpp using OOP principles, solving connectivity issues with Nasit
  • Android App:
    • Saving user profiles using Jackson library - feature was scrapped
    • Implementing Firebase database connection to Android App
      • set up cloud database with Google Services
      • configured project level and app level Gradle to import Firebase dependencies and plug-in
      • saving user profiles to Firebase database - feature was scrapped, decided to use shared preferences instead
      • saving environmental data to Firebase database - refactored into Nasit's implementation
    • Implementing shared preferences to save objects locally
      • methods were used to save profiles including current profile - feature implemented by Joel
      • methods were also used to save user-defined preferences (see below)
    • User-defined preferences for notifications, motivational messages and stand up events with Kalle
      • worked on XML file, activity class was implemented by Kalle
  • Documentation: worked with team on scoping, added security recommendations page to wiki

Logo