Generally, research and invention done by a student independently while enrolled as a student at a university or college would be the intellectual property of the student. This seems to cover the situation that you describe.
Merely using university facilities and equipment does not make the university an owner of the intellectual property created using them absent an express agreement to the contrary which would be very unusual and might even be void as a violation of public policy considerations.
Conceivably, if your use of university equipment and facilities was beyond the scope of the allowed rules for using it incident to being a student, free of charge, the university might charge you a fair rental value of the equipment and facilities used in violation of university policies on the use of those things if it was really excessive (e.g. you accounted for 95% of the machine shop use at the university and wore out the machine much more than it would typically be worn out), but that would not give it an ownership interest in the intellectual property created with the equipment and facilities.
If the student is doing the work as an employee of the university under the supervision of a professor, the analysis regarding whether it was work done for hire that belongs to the university or work for which the student-employee was a partial author (along with everyone else who participated in coming up with it personally) would be subject to the same analysis as in the case where someone is an employee of any other firm. In practice, there would frequently be a written employment agreement spelling out intellectual property ownership if the work was done in a part of the university that usually engages in inventing patentable ideas.