More than a dozen college students were awarded a total of $5,000 for their inventions Sunday at a technology-development marathon at Stony Brook University.

A team of four Stony Brook students won the grand prize of $2,000 for ToiletGo, an app that works with motion and light sensors to determine whether bathroom stalls are occupied.

Six teams each took home a prize of $500 for apps that detect spine curvatures, guide people through workouts and improve billiard players’ form. Other winning projects included a system that monitors school safety, a website to keep people on a budget, and an app that can turn on a light switch remotely.

Another team won a drone for an app that finds an open parking spot.

About 50 students had two days to design and develop prototypes of apps and software at Hack@CEWIT, which was held at the university’s Center for Excellence in Wireless and Information Technology.

The name of the event deals with creating a “hack” that works with existing technology to provide a new service, not with hacking into a computer system such as in other “hackathons.”

advertisement | advertise on newsday

“This has been a very impressive 43 hours for the kids,” said Satya Sharma, executive director of CEWIT.

The goal of the competition is to foster the spirit of innovation in students, Sharma said.

“Our idea is not just to have fun but to give them that spark,” he said. “How can they take that idea further and create new companies?”

Winning students could end up bringing their projects into a university incubator or working with the tech companies that sponsored the event, Sharma said.

Richard Huang, 20, said that even though his team’s ToiletGo project won, the team members — Shen Shao, Tingyi Zhao and Hanpeng Jiang — want to “think carefully” about the best use of their technology before deciding to start a business.

Huang said he hadn’t known most of the programs and hardware they used before the event began Friday afternoon, but learned some of it from seminars held during the competition. For the other half, “we were Googling.”

Jiang said he got the idea for ToiletGo from living in a dorm.

“It’s really annoying. You’re always checking whether a . . . [stall] is empty or not and then you’re just waiting five to 10 minutes in front of a toilet,” Jiang said.

When students weren’t working, they attended workshops, yoga classes and movie screenings — and attempted to get some sleep.

Melanie Logan, 18, said she slept three hours while developing a photo program all weekend.

advertisement | advertise on newsday

“I’m so tired I’m barely standing up,” she said.