Inspiration

Our team noticed that a lot of the dispensers around campus in bathrooms, meant to have free period products, were almost always empty. We don't know how often they get restocked and there is no way to know which bathroom has tampons or pads without checking all of them. So we designed a website that tells you where you can find menstrual products without having to check multiple different bathrooms.

What it does

Code Red is a website that tracks how full period-product dispensers are across campus. Students can see a map of nearby bathrooms with each dispenser’s status (full, running low, or empty) and lets them know the nearest bathroom with tampons in it. Each dispenser has a sensor that reports its fill level to the website in real time. A staff view shows which dispensers are empty, so staff know exactly where to restock instead of checking every bathroom.

How we built it

The Software: The backend is a Python API built with FastAPI and a PostgreSQL database. It receives sensor readings, converts them into a fill percentage and status, and flags empty dispensers for staff. The frontend is built with HTML, CSS, and JavaScript, using Leaflet and OpenStreetMap for the interactive map. Pins are color-coded by status and show an estimated fill percentage, and the site can point users to the nearest dispenser that isn’t empty. The location is used only on the user’s phone and is never stored. A passcode-protected staff view lists the empty dispensers so staff can refill them. We mapped 71 women’s restrooms across 19 campus buildings. Since we have one physical prototype, we simulated data for the rest of the dispensers, while our prototype sends real readings. Everything is hosted on Render.

The Dispenser: We created the dispenser using wood, following a similar model as the dispensers in the Student Center. We then used a Time of Flight sensor on the top of the dispenser to measure the distance to the bottom and calibrated this data to measure how full it is. As tampons are taken, that distance grows, and we calibrated it against the empty and full heights of the box to calculate how full it is. A Raspberry Pi Pico W reads the sensor every few seconds and sends the measurement to our server over Wi-Fi. We also painted the dispenser as a sunset to give it a 2016 look.

Challenges we ran into

For the dispenser, we had to modify our original box so tampons came out one at a time. Otherwise the stack could shift or tilt, and our distance measurements wouldn’t accurately reflect how full the dispenser was.

We also had trouble with the consistency of the ToF sensor. Small changes in the sensor’s angle meant the distance to the bottom of the box changed every time we restocked the tampons. To fix this, we secured the sensor in a fixed position so it couldn’t shift, took the median of 10 readings each time instead of relying on a single measurement, and recalibrated the empty and full distances after mounting it.

Keeping the website running reliably was another challenge. Our free hosting puts the server to sleep when it’s inactive, and dispensers are marked offline after two minutes without a reading, so we had to make sure data kept flowing for the map to stay accurate.

Accomplishments that we're proud of

We built a complete system in a weekend, from a physical dispenser with a working sensor all the way to a live website that anyone can open on their phone. We’re proud that a real sensor reading from our prototype shows up on the campus map within seconds. We’re also proud that the project addresses a real problem we and other students face every day, and that it helps both students looking for products and the staff who restock them.

What we learned

We learned a lot about the unpredictability of hardware, and how to make small adjustments to it in the short amount of time we had to create it. On the software side, we learned how to build and deploy a backend API and how to host a website for free. We also learned how to work on the frontend and backend in parallel by agreeing on how the two would communicate first, and how to collaborate through GitHub without overwriting each other’s work.

What's next for Code Red

In the future we would likely try to implement our dispensers into bathrooms around campus and connect them to our website. In addition, we would see if we can also create dispensers for pads as well, because our current prototype only works for tampons.

Share this project:

Updates

Submission history