Main Content

Ordinary digital cameras work by using a large array of light sensors to capture light as it is reflected from an object. In this experiment, I wanted to see whether I could build a backwards camera: instead of having an array of light sensors, I have just a single sensor; but I control each of 1,024 individual light sources in a 32 x 32 LED matrix.
The way it works is that the Arduino illuminates one LED at a time, while using the analog input to monitor changes in the light sensor. This allows the Arduino to test whether the sensor can “see” a particular LED. This process is repeated for each of the 1,024 individual LEDs rapidly to generate a map of visible pixels.
If an object is placed between the LED matrix and the sensor, the Arduino is able to capture the silhouette of that object, which is lit up as a “shadow” once the capture is complete.
BONUS: With minor tweaks, the same code can be used to implement a “digital stylus” for painting on the LED matrix.”

Link to article