1 of 1

BenchSense

Team C8: Max Adams, Derek Kim, Sid Sapra

18-500 Capstone Design, Spring 2024

Electrical and Computer Engineering Department

Carnegie Mellon University

System Architecture

Product Pitch

BenchSense aims to tackle the problem of overcrowding and inefficient use of the gym. BenchSense is a mobile-app integrated with hardware sensors designed to monitor gym occupancy as well as individual bench availability. Along with displaying real-time updates on the gym, BenchSense also displays weekly crowd predictions for each hour of the day so that users can plan out their schedules in advance. Furthermore, to personalize the workout planning, users can see the likelihood of a bench being available at their time of arrival. Our solution empowers gym users with the information they need to avoid peak times, access available equipment, and overall manage their workouts more efficiently. ��To simulate real-time display, we aimed for a 10 second latency from sensor detection to app update. We achieve a latency of 5 seconds to meet our latency requirement. We wanted the battery life of our bench sensor to be 1 week but fell short with the actual battery life lasting 3 days. Additionally, we set our accuracy requirement for the people counting sensor and the bench sensor to be 85% and 90% respectively. For the people counting sensor, we achieved 80% accuracy and for the bench sensor we achieved 95% accuracy. Finally, for the predictive model, we set our goal to be 80% accuracy, and we achieved 70% accuracy.

The physical components of our system start with the bench sensor module and the people counter module. The bench sensor can be seen in figure 1 with labeled parts. The NodeMCU contains detection software that relies on its ADC readings of the IR sensor output to send HTTP requests to update the central hub on that bench’s occupation status . In the people counter, ADS1015 ADC connects to the Raspberry Pi using I2C, and the output of two Sharp GP2Y0A710K0F IR distance sensors connect to the ADS1015. The detection software on the Raspberry Pi uses readings from the ADS1015 to detect if a person is entering or leaving a space.

Information from the physical systems are sent to our backend server which acts as our central hub for data transactions and processing within our system. The frontend periodically sends requests to the backend to retrieve the latest data to be displayed on the mobile app. The backend API was developed using Flask and the frontend was developed using Flutter. Both the frontend and backend are hosted on an AWS EC2 instance.

For the predictive models, pandas and fastai were used for data cleaning, along with OpenMeteo API for getting both past and predicted weather data. A sklearn’s Random Forest Regressor was used after testing with a large number of estimators to determine the optimal value for crowdedness. The model was used to predict the number of people, which were then classified into 4 levels and compared against validation data to calculate accuracy values. Numpy’s polyfit was used for the bench model to determine the time for which the bench is predicted to be unavailable for each hour, which was then used to estimate the likelihood of finding an available bench.

http://course.ece.cmu.edu/~ece500/projects/s24-teamc8/

System Description

System Evaluation

Conclusions & Additional Information

Our system consists of two hardware systems that update the application through an EC2 instance that acts as our data and application server. Our predictive model uses the data stored in the EC2 instance to make predictions and forwards these predictions back to the server to be displayed on the application.

To validate the accuracy of the physical systems, we tested several scenarios. We tested two scenarios for the bench sensor (figure 5) and four scenarios (figure 4) for the people counter. For the people counter, we counted a 1 person change as a success. We want to be able to gauge crowding rather than an exact number of occupancy while adhering to minimal invasiveness.

Overall, we are proud of what we have accomplished. We faced a few challenges while developing this project. The main lesson we learned is that a very large amount of data is required to build accurate ML Models, so it would have been much more helpful if we were able to debug and deploy our sensors earlier in the semester.

We met most of the requirements we set for ourselves. To add to this project in the future, more data about the gym would be useful. For more accurate people counting, using a WiFi packet sniffer of some sort could be used rather than physical sensors and possibly give better crowding measurements.. Adding a few more features to the app such as the ability to add the ideal workout time to your calendar would be a good direction for the future too.

To test the accuracy of the RFRegressor the dataset was divided into a testing and validation dataset with an 80/20 split, and values measured by the sensor were used as a testing dataset. The model had 70% accuracy on the validation and testing dataset. An RMSE value of around 17 was observed showing how close predictions were to real values.. For the Polynomial Regression, an R2 value of 0.92 (strong correlation) was seen.

Figure 6: Average Voltage vs Distance for IR sensors

Figure 5: Bench Sensor Test Results

Figure 4: People Counter tests and results.

Figure 1: Bench Sensor Module

Figure 2: People Counter with two Sharp IR sensors

LM7805

47 μF cap

Sharp IR Sensor

NodeMCU

12V Battery Pack

Figure 3: Block Diagram of our project