Okay, this is crazy. It's actually working Black box, you know the mask It's working let me explain. Hey, what's up everyone? My name is Sean Hodgins and welcome back to my channel So a few days ago, you may have seen me post this on my Instagram if you don't follow me you should today I'm gonna show you how I made that image really cool We're basically gonna take this pile of parts and build our own image sensor And digital camera. It's gonna be cool. Let's go What I'm holding in my hand is a one kilo pixel image sensor Well, it will be once I put all the components on it. It's a matrix of 32 by 32 photo cells To put the size and perspective most camera phones today on average have a 12 megapixel image sensor That's over 12,000 times more pixels than what you see here Even the original Game Boy camera had four times the amount of pixels Let's take this video for example. If you're watching an 1080p, it's 1920 by 1080 So let's square it off and make it black and white. So now it's 1080 by 1080. Now here it is at a thousand pixels Now 500, now 100, now 32 by 32 the same density as the image sensor I'm gonna build It's pretty difficult to make out some details of this resolution But let's shrink it down to its original pixel density Is it amazing how the details come back? Since this image sensor has over a thousand components on it I know it's gonna take me a super long time So I'm gonna design some of the frames and start the 3D prints now and hopefully everything will be finished around the same time So originally I had plans to make this a digital pinhole camera hence the name Digi Obscura But I found I wasn't able to get enough light through the pinhole I'm sure you can make it work with some fancy algorithms to collect more light I decided to take a part in old lens and old Canon zoom lens and use the front glass which is essentially a magnifying glass If you're gonna recreate this project you're gonna have to find your own magnifying glass and probably modify the 3D printed parts so that you can mount it in front You can find the focal length by shining it on a wall with some light in the background and finding the distance that the image shines through in focus You'll probably only want a two times magnifying glass I found that anything larger had to be too far away from the image sensor Now you may remember a project called the Mega Mox which was a 32 to 1 multiplexing board that I made That was a long time ago and that was actually for this project So basically we've got two 32 to 1 moxes and they will choose one side of the photo cell, one of them will And the other one will choose the other side so you actually can pick any photo cell you want to be part of the voltage divider which is on the second board The way the image sensor captures the image is it tells this photo cell to be active and take the light in, get the analog reading and save it Then go to the next one and it keeps doing that and it's not a very fast process which is why it takes a couple of seconds to capture one image So if you move the sensor well there's one image being captured it'll just be garbage because you're getting light from here at this time and light from here at this time So that's the basic principle of it There are only a few parts to the assembly, the microcontroller circuit board, then we got the image sensor circuit board which plugs right into it in the back These both mounts inside the camera in two different locations, this is obviously slightly inside The focal plane distance is from the image sensor to back of the lens that you're using Then you've got these two 3D printed parts, camera body and the lens mount, this you may have to change if you can't find an old Canon lens to break apart like I did There's plenty of different options to use here and that's why this is mountable so you can change the distance, you can change this thickness here So if you need yours to be further away then you can make this thicker or thinner and it mounts on there And then the lens sits inside there and then it all goes together like this Okay, so I finally got everything together and working, it's still not perfect but I'm going to try to perfect everything so that when you build it it'll be easy I've got the camera body, it's a little bit different than I originally planned and I've got the lens mounted out front The cool thing about this is I've also included an OLED screen, a shutter button and an SD card which means it's basically just a portable digital camera Pop the battery in and you go out and take some shots Now when I was testing this I hooked it up to my computer and I basically ran it like a webcam So the first program that I ran used a program called processing which would basically send a value to the Arduino The value would be which pixel it wanted to know how much light was coming in and then this would send it back And it would do this over a thousand times and you would get an image Now this helped me debug a ton of things, I even set up a little laser to be on one pixel because I was trying to debug some bridges and soldering issues and programming issues But it's finally working, so what do you do when you have a working digital camera? You take some pictures, so you might recognize this guy, he's going to be the subject for the photo I was also testing out using a black and white grid here, but he's got some good contrast, I've got a black book behind it And when I pop the battery in, turn on and we will throw the SD card in Now because the shutter takes like five seconds, you don't want to be touching the camera at all or you might get blurry lines and things like that And you also need a lot of light, so I was considering putting some LEDs out front so that it actually turned on and was taking the picture Maybe version 2 Right now I just use a flashlight and it says camera ready on the OLED screen and then we'll take a picture, says 3, 2, 1 And now it's collecting the data And it should save to the camera, there you go There's one photo, we'll do another one Cool, now let's open these on the computer So let's throw the SD card in and we'll see the photos that we just took And you can see they're super small, but they're only 32 by 32 pixels It's pretty incredible that this actually works, I'm still amazed You can see the details in the mask, everything's in focus That's focused as you can get with 32 pixels As I mentioned earlier, with the Game Boy camera, they actually only had four different contrasts And with this you have eight bits, so 256 different grays Now let me try a few portrait shots on myself, see how they turn out So here's the images I just took What's cool is these come out of the Arduino as a bitmap file, so if you take the SD card right of the Arduino It actually makes the file that your computer can open as an image, straight from the camera So these actually turned out really awesome So I can't believe the detail is actually in these photos But since this is an image photo, one of the coolest things is you can actually import these in the Photoshop And manipulate the image as you would any photo, change the contrast Because there's a lot of tricks that digital cameras will do to make a better image And you can actually build that into the Arduino firmware if you knew how to do that Obviously as you enlarge it, the details go away One of the things I noticed is since the scan rate of the sensor is so low That means each pixel is being turned on very slowly You will actually pick up frequencies in LED lighting or overhead lighting And it will pick up different brightnesses, so I actually have some examples here A photo I took with the flashlight on a lower setting And you'll see that you can't see the image because each pixel is picking up a different amount of light Because it's actually strobing with a pulse width modulation That's how it dims in LED But it works, it's a fully DIY image sensor built from scratch I know I used a lens from Canon camera, but I'm sure there's some smart people out there that could probably get the pin hole to work As I'm sure you're all aware, these projects are open source and they will never be behind a paywall However, if you want to support the channel, consider becoming a patron on Patreon The photo cells alone in this camera cost around $200, and that's because there's just so many of them And I can attribute most of those costs to my patrons So the support is very welcome and helps me develop other projects Anyways, everyone, you know the deal, be good and have a good night Thanks for watching!