 and welcome to Lady Aida. Hey everybody, and welcome to a desk of Lady Aida. It's me, Lady Aida, here at my desk. Doing some camera engineering, but first up, Mr. Lady Aida's are gonna do news or updates so you won't tell people. Nothing I wanna talk about. Okay, great. All right, so I'm working on camera stuff. You go to the overhead. I'll show off some of the cameras. So here is- I don't wanna focus on it. I don't wanna focus on it. This is the camera that I worked in on last week. This is one with the lens. And I showed off that I also had these samples that had a motor coil inside of them. We took this apart to show the coil inside. And then this has an autofocus capability, whereas this one, you literally turn this little knob thing to focus it. And I wanna try to get the autofocus working because I thought it was kinda neat, but also I was kind of annoyed like the breakout board that I was using, which is, hold on, I have it here somewhere. Maybe not. But it was basically like this. Didn't work with the autofocus. And of course this is an open source so it's like there's a schematic, but schematic wasn't really clear and like the pin numbering was wrong. But basically it looked like something was shorted. Something, you know, the pin for the motor was bridged on the camera breakout. But luckily I had actually been working on a camera breakout myself because there's a couple of things that I don't like about the standard to buy whatever, 12 pin, eight pin camera boards that people sell. So I designed a simple breakout and I was like, well, this is a good excuse to get it together. So I put two together. And you know, because the final two pins on the camera are that coil, and I think like every other breakout like assumes like, oh, if it's not connected we should just connect it to ground, which is, you know, it's like, it's always at the conundrum like you have a schematic and it says NC and you're like, well, should I actually leave it NC or should I connect it to ground? In this case, you know, most cameras can't get to ground but I kept them floating. And so it was possible for me to red wire, connect this little wire here, which is the motor power to three volts. I just made a little jumper pin on this camera breakout. And so I got the, so then I was able to use the example code from the app note to do auto focusing because you basically have to connect the motor power and then you have to load firmware onto the, there's a little basically a micro controller inside of your DSP chip and you load autofocus firmware on it because autofocus isn't built in. Why? I mean, whatever it's kind of an add-on. It's an extra, maybe by default it wasn't included or maybe you want to put different algorithms in for how autofocus works. Either way, you know, I found firmware around on the internet. It is a binary blob, but you basically, it's 4K kilobytes long. You slowly feed it into iSquared C and then you can request an autofocus command over iSquared C from the camera sensor and it'll do that little like, you know, attempt to like focus in and out until it's no longer blurry. So in the computer, this is the, can you give it a try? Oh yeah, sure. On the computer, this is the Python code. So there's a file that, you know, called autofocus.bin and it's just like binary. There's no, you know, there's no idea what it is. It's just some firmware format. And in the code, you init the firmware by opening the file and you load all that code into address 0x80, like one byte at a time over iSquared C. Slow, but it's effective. Although I might try, you know, I wonder if you can write 32 bytes at a time or more bytes at a time, because that would be, of course, preferable than writing like one address at a time. And then you can read the status at address 3029. And then there's commands to clear the autofocus and reset it. And that's actually, oops, that's actually from the app note. There's an app note called, you know, the embedded autofocus solution. And they say once you load the firmware, you know, here's how you can trigger autofocus mode and here's how you can request autofocus status. So it's actually quite simple. It's like the hardest part is just, you have to make sure like you've downloaded the firmware properly. But all this is closed source and you have to make some open source software to get it to do all this. Yeah, I mean, like the firmware that runs on the camera, I mean, it's like, I don't even know what it is, right? It's just a binary blob and they'll never get to release it and so you can't design your own firmware. But that's, you know, that's not that unusual and I don't feel like that's a reason not to use it. You know, cameras, normally the binary blob would just be built into the chip and you wouldn't even have access to it. So, I didn't remember. Yeah, these are one of those things like we're coming out with an open source camera, but there's always like weird guts inside of a camera just like there's BIOS on a computer. It's always something that we can't get everything, but we'll be able to have open source software for you to interact with this firmware blob, right? That's the... Yeah, I mean, you can still use the camera. I mean, again, like normally, like I was actually expecting that the autofocus firmware would already be loaded in and then you would still just send the commands. It's like they just, I think they just want to make it so you can try different for more blobs. But like, yeah, if somebody ever figures out what chip is inside here, you could probably work and hear it. Do you compile the binary? Let us know. Yeah. Yeah. Okay. So given that, so this is... Besides you use Windows. So you'll never be open source, Lady Aida. Yeah, it's true. You have, you know, there's closed source firmware on the way up to your desk. Yeah. At work. Yeah. So you will never be open source. Well, the camera you're using to film this is also close as my eyes. Yeah. So when you autofocus in it, you know, here I load that firmware file in and it's it. And then you basically just call autofocus, you know, and that performs autofocus mode. And of course you can, you could ask for status. So here I've got, you know, in my main loop, this is a main loop that reads, that captures a bitmap and then sends the bitmap to the display. So it's like a basic, you know, blitter and every 10 frames, I'm going to run the autofocus. So let's try this. Oh, I mean, even the file. Okay. So now it can go to the overhead. So you can kind of see how I'm like pulsing in and out a little bit. That's the autofocus mode that I'm trying to autofocus. And if I put, that's kind of dark here. Let me see if I can, you know, I can try to put some text in front of it and it will, it'll autofocus onto the text. The thing that's, you know, and this is like continuously autofocusing. And then you can actually hear it click sometimes too. So it does work. There's also a special capability. There's a special mode where you can draw like a square showing where the autofocus zone is because I think the different firmwares have different ways of like determining, like where, you know, where does it want to autofocus? Does it, does it want to autofocus in the center? Does it want to like do like a square like four signals? So there's like this one special capability where it kind of can like draw over the frame with the autofocus mode. So I might look at that next, but I just got this working. So that, that's good so far. And it means that I can start, you know, knowing that and knowing the pin out is, it means that I can take this design that I, oh, can you go to the computer? This design that was originally for the OV2640, which like doesn't have strobe and it doesn't have autofocus mode. And I'm going to redesign it for, you know, the 5640 as well. Like let's still work for the 2640, but what I'll do is I'll connect the two pins here, which are usually data zero and data one. I'm going to have it so you can connect those to the three volt and ground line. And that way, if you'd like to use it with autofocus mode, you can just like set a jumper. While I'm at it, I think I'm going to actually also put all these components on the back because I really think I need a lot more capacitors. Again, notice that the power supplies were like really like a little shaky because like there's actually quite a bit of power being used. In fact, one of the things I noticed is that if I ran the demo for like, you know, if I ran this like streaming image to TFT demo for a really long time, the camera actually like literally gets hot, which is surprising because it's only drawing like 150 milliamps, but it could be just like all that power is concentrated and it's not very well diffused. So the next thing I wanted to do is, in addition to this breakout, I wanted to make sure that this breakout could work with some sort of heat sink capability to add a passive heat sink, not a motorized heat sink or like a fan, but like a small passive heat sink that could maybe draw some of that heat off. You know, I never saw this with the 2640, but the 5640, you know, for whatever reason this camera like uses quite a bit more current. When I looked at the, yes, this is the pinout. So that's the autofocus. And I think this had the, the registry map and at the very bottom, I just missed it. AC characteristics, DC characteristics. So, input high, hold on. Yes, this is like the current draw. And, you know, it can get pretty high. It can get up to like 130 milliamps on the 1.5 volt DC power supply. So, you know, I definitely wanna have a heat sink for that. So I thought we could do that for the great search where I tried to find a little heat sink for my camera. All right, here we go. So just a heads up, we changed the great search music to be more retro-y, robotic sounding. One of our team members who is always doing our music, they just had a kid, so it'll be back soon. But that was courtesy of JP doing that roboticized version from the desk of Lady Aida to great search. I think it's a catchy tune because normally when you're trying to do electronics now, you're like, where in the world is that part I need? And then you think about the great search with DJ key. So that's where that song came from. And that's why we're doing it. And Lady Aida likes go to... A catchy tune you can hum while you're scaring for parts. So the part I'm looking for, just finished up Desk of Lady Aida where I talked about designing a camera breakout and the camera module I'm using draws enough current that it actually starts overheating and that the heat affects the visual quality. So I wanna find a small passive heat sink that I can stick on the back of my camera breakout. And what I'll do is all the camera itself is glued onto the PCB. So maybe you can go to the overhead real fast and I can show. So you've got the camera breakout and then the camera, there's a little bit of a, there's a metal body and then there's this, I don't know if it's thermal but it's like this very thin tape. So you remove this and then I think this might be thermal. You remove this, place it in here and then this PCB is gonna extend a little bit farther but now this is stuck onto the back here and then over on the back of the PCB I'm gonna have a lot of vias through the ground plane and then have a little heat sink on the back. So the heat sink, it's gonna be, I think the largest it can be, it's gonna be basically between like eight millimeters and it looks like I can do like 10 millimeters. That's kind of, yeah, this is 10. So that'll cover it. I don't know if it makes sense to go much larger than 10. And I want something flat, rectangular with fins and I'll try a couple. There's the math behind it. You can calculate how much heat you're gonna disape but because it's going through a PCB with vias really I'm just gonna pick about a bunch of different heat sinks and try them all and just see which one works best. So let's go to the digit key and so it starts for heat sink. Take us to the heat sink category. So there's a lot of heat sinks. This category, it has 100,000 items. So there's a lot of different options. Let's start with just active and maybe normally stocking which is still 40,000 that are available now. The next thing is, there's all sorts of different types but looking, I basically want something like this, right? This is a 17 by 17 millimeter by nine millimeter and this is called a square with fins and then this is like a square with angle fins but I think I just want basically square finned. So looking at this option, I think, rectangular is also fine. I don't want to round this, I don't want round and then rectangular and square. Let's look at those. Okay, so that's like most of them to be honest. So yeah, so like lots of things. These are the clip on type which I don't want. These go on to like a TO220 or something. They're really cool but I can't use a clip on type. So I want maybe one that isn't a clip type but we can also do length and width instead. So remember I wanted something between like eight and 10 millimeters and then this is between eight and maybe I'll go up to 11-ish millimeters and that really cuts down the numbers. There's not that many small heat sinks. Like again, most heat sinks are for large chips but all these are really good. So like this heat sink, you can see it's, this is 10 millimeters I think. Sorry, this one is 10 by 10. This one is eight and a half by eight and a half. So I might try like one of these and one of these of course the larger the heat sink, the more heat you're gonna dissipate. There's also like these kind of the mega longs. This I don't think it's gonna work out. Of course it'll dissipate a ton of heat but people are just gonna knock this off of the back of the board. It has to be pretty compact so it doesn't like get in the way of things that are behind it. So I think what I'm gonna do, especially since this one, you know there's 50,000 in stock and they're like 55 cents a piece. Think this one is a good option. This is 10 by 10 millimeters, seven millimeters high, black anodized aluminum. It doesn't come with the thermal tape attached to it almost certainly so that's something that has to be done separately. We stock in the shop like you can just get 3M thermal tape and you cut a little square out and you put it on the back and then that gives you a good attachment. You definitely want to use a thermal tape and not just double sided tape because you want the adhesive to pass. You don't want to be an insulator, right? Because the one thing you don't want is it to insulate thermally. So this one is the one I want. This is the Asman WSW Components V2017B. We have a lot in stock. So that's kind of like a good sign because I could actually like ship this with the camera breakout board and not have to worry about it going out of stock anytime soon. And that's the very search? That's it. That's my heat sink. So we'll see everybody during the week Tuesday, J.P. Product Pick Wednesday. We have 3D Hangouts, Show and Tell, Ask an Engineer, Thursday J.P.'s Workshop and Friday Deep Dive. What's got in addition to Colin's labs that come out on Monday, Tuesday, Thursday and Friday. And- There's something every day. There's something every day. And then just today we posted up some of this camera stuff too on all the socials and more. So stay tuned for a big exciting week here on Moretronics. Channel Adafruit. Beep beep beep beep beep. Okay, bye everybody. Bye everybody.