Inspiration
The Myhal Centre oftentimes does not provide an ideal studying place: 1. Myhal uses a motion sensor to detect if there are people to reduce energy consumption. This mechanism is used heavily in the non-popular floors. This sensor works well with movement(e.g. when people walk by), however it doesn’t always account for stationary students studying. As a result, the lights will completely turn off after 20 minutes if no motion is detected. The student will then have to get up and wave at the sensor to re-activate the lights.
- Many areas at Myhal are filled with students studying during peak hours, making other students that arrive later have to wander around to find empty spaces in different location. This results in the students losing time.
What it does
A student will not need to worry about the motion sensor detecting them by flailing their arms around. A camera connected to a DragonBoard running OpenCV in each study area can detect if there is a human studying in that space.
- The DragonBoard is also connected to the internet, appending and updating the MongoDB database with the current number of students in a study area. A website then reads the data from this database, allowing the students to find a free area to study in.
How we built it
We used MongoDB to store the maximum number of available spaces in a study area, along with the current number of students studying at the moment.
A DragonBoard410c connected to a webcam and a motion sensor runs the Python code that connects to the MongoDB database, detects the number of people using OpenCV, and connects to a Grove shield to control the 'lights' (LEDs in our case) and the PIR motion sensor. The motion sensor detect the first 'motion' of a student entering a room, turning the lights on for the camera to be able to function properly.
We also have a website hosted on Google Cloud using React.js and Node.js. The backend connects to the MongoDB database, allowing the front end to then display the building name, study areas of that building, and the maximum and current number of students in that area.
Challenges we ran into
The person detection using OpenCV was not accurate for people sitting down and also for crowds, detecting less people than there is.
The connection between the Grove shield and the DragonBoard was hard to set up due to the GPIO connectivity. Furthermore, getting the unsteady serial connection between the Arduino code and the Python code took a long time to debug and get it working.
The DragonBoard had a bug where the network module failed when the OS was updated, delaying the project by a few hours. However, we managed to get a serial connection between a mobile hotspot device and the DragonBoard established, allowing us to continue with our project
The full-stack nature of this project proved to make it difficult to distribute and manage the workload to get the whole thing working, but we managed to complete this project to a working state.
Accomplishments that we're proud of
- Getting OpenCV to work.
- Connecting and uploading to the database from the DragonBoard then retrieving the data from another location (website).
- Connecting to he Grove board and turning the LEDs on and of with the motion sensor using the DragonBoard.
What we learned
- MongoDB
- OpenCV
- DragonBoard
- Managing a full-stack project with a team
What's next for StayEnlightened
- Getting a fleet of cameras and sensors in different locations all uploading to the MongoDB database.
- Training the crowd detection model more to be more accurate
- Using the time of day and amount of natural light to adjust the intensity of the light fixtures.
Built With
- arduino
- dragonboard-410c
- express.js
- google-cloud
- grove.io
- logi-webcam
- mongodb
- node.js
- opencv
- pir-sensor
- python
- react
Log in or sign up for Devpost to join the conversation.