Smoking and vaping are banned in all New York schools. Now schools are testing technology that can smoke out offenders. The new technology inside a little box may play a big role in holding students who break the law accountable.

"If we get a spike above the line then we know if there's an incident occurring," Digital Fly CEO Derek Peterson said. "And we notify the officials."

New York Gov. Andrew Cuomo in July banned the use of e-cigarettes on all public and private school grounds.

"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,'" Digital Fly software developer Billy Schweigert said.

The device, called Fly Sense, can detect gas and moisture in the air indicating vaping is taking place. A spike in the data means something is suspicious. Peterson said the device then sends an alert to a cellphone.

The device has another sensor to track peaks in sound levels to also determine if bullying or fighting is possibly happening.

From a privacy standpoint, the company said the device has no microphones and can't record conversations. It only measures changes in sound.

Click for more from Fox 5 NY.