Photoresistor-based Single Pixel Camera [Hackaday]

View Article on Hackaday

[Hugh] has been going back through episodes of the Hackaday podcast, and Elliot mentioned in episode 67 that it can often be inspiring to go back through the archives of Hackaday to find ideas for new projects. Well, he did just that and came across a single-pixel camera made using an infrared photodiode. He decided to try and hack together his own single-pixel camera, but this time on the cheap and using an ever simpler component – a photoresistor!

His description of the project tickled me – “I’ve used an ESP32, MicroPython, two servos, a peanut butter jar lid, a toilet paper roll, a paper towel roll, magnets and scrap wood for this version.” That’s certainly a much simpler bill of materials than the original (which was written up by Hackaday way back in 2015), which used a nice metal frame to hold everything together. However, there’s absolutely nothing wrong with improvising with things you happen to have to hand.

The alt-az mechanism

In this case, the sensor is mounted at the back of a paper towel tube, with black tape covering the front and a tiny pinhole poked in the tape to act as the aperture. Similarly to the original, the sensor is scanned over the scene in an XY altitude/azimuth pattern to capture the samples one at a time. It takes just under eight minutes to capture 8100 “pixels” in a 90×90 grid. The servos are driven using a PCA9685 PWM/Servo driver, which makes motor control a lot easier. An important lesson [Hugh] learned during construction was that weak power supplies can cause all sorts of issues when motors or servos are involved. He had been encountering uneven rotation and random halting, but as soon as a beefier power supply was attached everything worked smoothly.

[Hugh] used a much more powerful ESP32 to do the actual gathering of the analog data, which is then sent over a serial port to a Python processing engine which uses Pandas, numpy and matplotlib to do the bulk of the image processing. The resulting processed photo is very recognizable, considering the differences in linearity and sensitivity between a photoresistor and the infrared photodiode used in the original project! It really is incredible what you can do with a few spare parts, some random construction materials, and a little bit of creativity.



Leave a Reply