I have a bike speed meter which uses a magnet at the wheel and a glass encapsulated metal contact to make short circuits, which will be then counted as pulses at the computer.
This sensor is now broken. I've tested the computer with a new speed meter sensor and it's working nicely.
Would you have any suggestions on how could I assemble a similar sensor at home, or maybe create another of my own, preferentially not battery-powered?
You might look into mechanical speed sensors. In the 1940-50s, there were bicycle speed sensors that counted the wheel spokes as they moved and indicated on a device, same as an automobile speedometer.