ESP32 Door Sensor

Arduino

The goal of this project was to figure out how many times people went in and out of my dorm room over a 24 hour span of time. In order to find this out I used an ESP32 to measure the amount times that the door was opened. This was done by attaching a powerful magnet to the frame of the door and then using the built in hall effect sensor in the ESP32 to read magnetic field values. When the door is closed the ESP32 reads really low negative values because it is against the south side of the magnet and then when the door is opened it will just be reading the background values which will be much higher. I then took these readings every second and then wrote a program that would give me the highest and lowest recorded values, as well as the average and rolling average every ten minutes. This then allowed me to graph the data and wherever there was an outlier on the max value chart I knew the door was opened. Overall I found that the door was opened approximately 22 times in a day which would mean that a person came and left 11 times assuming that every entry and exit is a system consisting of two door openings.

0 Lifts 

Artifacts

Name Description
Final Code This is the final code that I used to gather my readings   Download
YouTube Explanation Here's a brief YouTube video showing off the whole project as well as some earlier code that I tried to get working.   Link
Feedback