The clever device, called Fly Sense, aims to reduce and eventually stop bullying in schools by making teachers aware of it before it becomes a bigger problem.
Digital Fly CEO Derek Peterson said: "If we get a spike above the line then we know if there's an incident occurring. And we notify the officials."
It can also detect if someone is vaping too, alerting the chosen person in real time.
The company's software developer Billy Schweigert added to FOX News: "If someone is inside the bathroom and they vape, it will contaminate the air, our sensor will pick it up and it will alert somebody in real time, 'Hey, there's a problem here, your air is contaminated, somebody could be vaping, somebody could be smoking, send somebody to check it out."
The software is set to be installed in various schools across New York so it can be tested.
Writing about the software on their website, they shared: "We believe everyone should be able to learn in a safe and secure environment. Digital Fly offers suite of software tools and services to help schools with bullying, cyber-bullying, suicide, self-harm, violence and other potential dangers. Partnering with schools, colleges and universities, we provide turnkey solutions to help with student safety and security - making learning possible for everyone everywhere ...
"Fly Sense is a cloud-based platform that detects and sends alerts to school officials when bullying or vaping is taking place in bathrooms, isolated areas as well as classrooms and lunch rooms of schools. The key to improving life safety and security in schools is through automated situational awareness. Principals and teachers must receive real-time information about a possible threat / situations, so they can initiate the appropriate response plan.
"The Fly Paper Engine communicates with the various Fly Sensors to provide life safety, security and environmental notifications. Ensure the right information reaches the person via the right Fly Sensor so a potential situation can be addressed the right way. With the Fly Sense sensor array you can keep a close eye on what matters most to you and be able to react in time to prevent disaster. Receive alerts directly to your smartphone so you are aware of when a Fly Sensor detects a threat."