23.5 C
New York
Friday, September 20, 2024

Changing an Optical Mouse Right into a Digital Digital camera



Again within the olden instances, after I was however a boy, our pc mice had balls. They had been mechanical gadgets that measured the rotation of that ball in two axes. Then optical mice got here alongside and altered all the pieces. They’d higher precision, higher velocity, and didn’t require cleansing. Even trendy trackballs, like the sort I exploit to save lots of my wrist, make the most of optical sensors. These optical sensors are much like what you discover in digital cameras, so Physician Volt did the pure factor and transformed an outdated optical mouse right into a functioning digital digicam.

An optical mouse sensor and a contemporary digital digicam’s CMOS sensor are alike on a superficial stage, as a result of they each output a 2D array of pixels. The optical mouse appears at variations between frames to find out how far it moved and during which route. That’s why optical mice don’t work nicely on very clean, uniform surfaces: the pixels all look the identical and it could’t see a distinction between frames. However an optical mouse doesn’t want a really excessive decision or shade to do its job, so these sensors don’t come near evaluating to even the most affordable digital cameras from a long time in the past.

On this case, Physician Volt used the sensor from an older optical mouse that has a decision of 18×18 pixels. Utilizing his trusty oscilloscope, he reverse-engineered the sign output from that sensor. It spits out an array of hex values for every of the 324 pixels for each body. He then used an ESP32 improvement board to learn that information and show it as a picture on an online interface he had already constructed for one more venture.

The uncooked pixel output coming instantly from the sensor is nearly meaningless to human eyes, as a result of the decision is so low. So Physician Volt turned to interpolation to get higher outcomes. Interpolation algorithms create new information factors based mostly on restricted units and there are a number of totally different algorithms suited to particular purposes. Physician Volt discovered that cubic interpolation labored nicely on this case. It’s a bit just like the “improve video!” scenes in CSI exhibits and is ready to create a better decision picture based mostly on the low-resolution frames.

That labored for issues proper below the sensor, however Physician Volt wished to make use of this like a digicam. So he 3D-printed a mount for Raspberry Pi-style CS-mount digicam lenses. That permit the digicam deal with topics at an affordable distance.

The outcomes nonetheless aren’t nice — a Sport Boy Digital camera from the late ‘90s places this to disgrace. However it’s cool to see recognizable photographs coming from a pc mouse.

Related Articles

Latest Articles