KISS-E: Kentucky's Interchangeable-lens Small Sensor E-mount Camera
by ProfHankD in Circuits > Cameras
49 Views, 0 Favorites, 0 Comments
KISS-E: Kentucky's Interchangeable-lens Small Sensor E-mount Camera
Ever wish you had a tiny-sensor camera that could mount all the cool manual lenses you use on your Sony E-mount mirrorless cameras? Well, you can make this one for under $50. Before you get too excited about this camera, you should know that there is now an alternative design in the "KISS family" called KISS Viewer, and odds are that you'd rather make it than KISS-E. Anyway, that's up to you.
If KISS-E looks vaguely familiar, that's probably because the body shape and size echo that of the Hasselblad 907X body with CFV 100C back. Even the tilt-up rear display echoes the H product. Both cameras also accept interchangeable lenses. Unfortunately, that's about all they have in common, and nobody is going to mistake one for the other.
Why would one want to make any of the KISS cameras? For the record, even the worst Sony mirrorless camera offers stunningly better image quality than this does. However, there are some reasons to build this beyond wanting to impress your friends and scare your enemies:
- KISS-E is able to use any manual lens that can be adapted to E-mount, which is pretty close to being any manual lens ever made. Adapters from other mounts to E-mount are commonly under $10. However, there are no electrical contacts, so lenses that require them will not work. The 3D-printed E-mount used by KISS-E is also a simplified non-locking design, so be aware that lenses can be dismounted simply by turning them counter-clockwise.
- The small sensor gives a 9.7X crop factor. More precisely, a 50mm lens gives the view angle of a 491mm on a full-frame body. This "extra reach" with small, fast lenses can be useful. For example, a 200mm lens gives a view that tightly fits the moon.
- Although the sensor supports RGB color, in this configuration, it doesn't have an NIR (near-infrared) blocking filter; thus, it can be used to capture both color and NIR images.
- Unlike other mirrorless cameras, this one is FULLY USER PROGRAMMABLE using the Arduino IDE. That means you can make it do pretty much whatever you want, and it's cheap enough to dedicate to tasks that you wouldn't want to use a typical mirrorless body for. That gives lots of options, including:
- You can use KISS-E stand-alone, capturing to a TF card and framing and focusing using the OLED live view -- so it can behave like a very no-frills camera able to use any manual lens that can be adapted to E-mount, while being a lot cheaper than a typical mirrorless body.
- You can also use KISS-E as an IoT camera, wirelessly operated using a browser interface via 802.11 wireless Ethernet (WiFi).
- You can also use KISS-E as a USB webcam. Unfortunately, it cannot (yet) support the driverless UVC protocol, so you're not going to use it as your primary video feed with Zoom, etc.
To build this, you will need to be somewhat comfortable with 3D printing and basic use of the Arduino IDE. However, it isn't even necessary to do any soldering and, aside from 3D print time, it's literally buildable in well under 1 hour.
Still interested?
Supplies
Ok, so it's easy to build... but what tools do you need? Nothing exotic, but the tools will cost a lot more than the parts for KISS-E if you don't already have them or have a friend to borrow them from:
- A 3D printer. The largest printed part is approximately 86x83x48mm, so any print bed that can fit 86x83mm is big enough. Although some resin printers can handle a part that size, an extrusion-based (FDM) 3D printer using PLA is probably the best choice. The camera shown was printed on a sub-$200 printer.
- Wire-wrap tool and wire. For this type of project, 30AWG wire is fine, and it's very easy to work with. I used to hate wire-wrap because all the thin wires can act like antennas, resulting in lots of signal noise... however, that was mostly because tons of wires were in a very small space. I've had no issues at all with noise for the kind of project we're doing here. It's about $15 for the tool and less than $10 for lots of wire.
- A hot glue gun. Used to lock parts in place in their 3D-printed holders... you already have one somewhere that you used in middle school. A new one will be less than $10.
- Black paint & brush. Not really needed, but this is why the "leather" texture looks like leather. It's also how to ensure you don't get reflections from the surfaces behind the lens. Any paint that will stick to the 3D-printed plastic is ok, and most will.
The parts are pretty cheap and readily available online. They are:
- AI Thinker ESP32-CAM. This IoT development board really does all the work; it is a fairly fast dual-core 32-bit processor with all sorts of goodies on board, including a TF card slot, 802.11 WiFi, and a 2MP camera. The camera it's usually packaged with is the Omnivision OV2640, and that's the one you want. We don't care about the lens it comes with (so don't pay extra for a fisheye), but you do want to make sure you get a fairly recent one -- the older one works fine, except for some reason the sensor is rotated 90 degrees, which isn't the orientation KISS-E's OLED display expects. The version you want has the long dimension of the sensor in the same direction the flex connector runs in. An AI Thinker ESP32-CAM with an OV2640 camera typically costs between $5-$10; mine have averaged $7 each.
- FT232RL USB adapter. Despite having lots of I/O interfaces, the AI Thinker ESP32-CAM doesn't have USB, so you need a USB/TTL converter. There are various choices, but this is the one the KISS-E case is designed to mount. Strictly speaking, you only need it for initially programming the ESP32, but it's typically less than $3, and having the USB interface always available is worth that; we also use it as a USB power connector.
- SSD1306 128x64 OLED board with I2C interface. There are lots of variations, including some with an SPI interface, but you just want either white or blue color and I2C. These generally cost less than $5.
- 12mm Momentary SPST push-button switch. This is used as the shutter button. Ones that have a nice, soft, springy action cost less than $1. You need two such buttons for versions from 210412.
Later on, perhaps we'll also have a version of KISS-E that runs off an internal battery... there is sufficient space inside. However, that's for a later alternative version that will not have a USB connector.
Wiring the Electronics
Well, to begin with, you need to learn to use a wire-wrap tool. That's easy, but it helps to see step-by-step instructions. A good overview is How to Use a Wire Wrap Tool from SparkFun. The one catch is that you will not be using pins that were designed for wire wrap. That's not a problem; typical pins on these components will work great. However, these pins are shorter, which means you can't stack too many wires on one pin, and the length of stripped wire you wrap also might need to be a little shorter than the recommended 1". In any case, don't strip less than 1/2". You can solder over the wire wrap connection, but that's not necessary except maybe if the pins are cylindrical -- with no corners. Cylindrical pins work too, but the corners of a pin actually bite into the wire very slightly, making an oxidation-free contact, so you get a better bond on pins that have corners.
The wiring pattern is shown in the diagram above. Of course, in real life it will not look like that, but more like the photo. The two unconnected brown wires would be connected together during boot to place the ESP32-CAM into programming mode; they are not needed once the system has been programmed. You can test that it all works with everything wired up this way... once you've installed the appropriate software on the ESP32-CAM.
The 3D-Printed Parts
There are just three or four 3D-printed parts, which should be printed in the orientation shown.
- The front. This part (which says "KISS-E") has some unsupported spans for the cavity that holds the ESP32-CAM, so it needs to be printed with supports. One might imagine that the cavity accuracy is critical, because it essentially determines the camera position behind the E-mount, but the truth is that there is substantial extra space left. Thus, the critical alignment will actually be done when you use hot glue to set the ESP32-CAM into place.
- The back. This is actually two parts that print assembled: the back and a hinged door that mounts the OLED display. The hinge is the same spanless type used in my HingeBox Printable As An Assembled Unit Without Supports; you don't need or want supports for printing this. The hinged door serves two purposes. First, it allows access to the internals, especially the TF card, without disassembling the unit. Second, it allows the OLED panel to swing into a top-viewing position. The door moves freely; it doesn't even have a latch. I slide my thumb under the door to hold it at any desired angle for shooting, and gravity naturally tends to close it. There is technically an unsupported span for the hole in the side where the USB connector will be mounted, but in practice this doesn't need any supports -- if there are any hanging threads, they can easily be removed after printing using a file.
- The screw. This part, not present in the 2103?? versions, is used to help hold the front and back together.
- The TF card tool. KISS-E can use a TF card to store captured images, and an access path is left for it in the design of the front, but the TF card slot is essentially right under the OV2640 camera. That places it inconveniently under the center of the E-mount. I could have made an access door or panel on the side of KISS-E, but instead left an access path through the back door. Removing a TF card isn't hard; simply press it in to have it pop out, and then nudge it backward to drop out. However, it can be awkward to insert a TF card -- so that's what this tool is for. Insert the TF card with the contacts pointing up into the tool slot, then use the tool to insert the card into the ESP32-CAM TF card slot. Once the card is partially in, remove the tool and press the TF card fully into the slot. Without this tool, you'd probably need tweezers to put the card in. This is an utterly trivial print that needs no supports.
The STL files for the above three pieces, and for all three plated together, are posted at https://www.printables.com/model/1855957-kiss-e-camera.
There's really not much to do to these pieces after printing. The front and back should friction-fit together nicely; once the electronics have been mounted, you could even glue (or weld) the two pieces together permanently, but I didn't find that necessary.
The first prototype (version 20210308) was printed in black PLA at a layer height of 0.25mm; it looked and worked fine, although there were a few tweaks made. The second prototype (version 20210310), which is pictured in this Instructable, is fully functional and was printed using silver PLA to give a metallic look. Two coats of black latex paint were applied to the leather-grained panels on the front and back to enhance the appearance. In addition, the rear wall of the E-mount cavity was painted with Black 2.0 to absorb any reflections. However, there are significant variations in the precise positioning of the camera on the ESP32-CAM board and of the OLED on the SSD1306 board; thus, the design included here (version 20210314) actually has slightly oversized pockets to allow fine adjustment of the positions of those two boards.
Normally, cameras need to be light-tight, so the choice of PLA filament can be touchy. However, here the only portion that we need to be relatively light-tight is the area behind the E-mount. Thus, PLA color is a free choice, and even translucent PLA could be used, provided that the area behind the mount is light-sealed by painting it black.
Programming KISS-E
At some level, programming KISS-E is as simple as loading one of the standard ESP32-CAM example applications, such as the CameraWebServer that is listed in the pull-down menu under File > Examples > ESP32 > Camera in the Arduino IDE. That program is intended to run generically on ESP32-CAM, but doesn't mind that KISS-E is configured a little strangely. It makes KISS-E into an 802.11 wireless remote-controlled interchangeable-lens E-mount camera. The program implements a nice web server interface that allows capturing stills, streaming live video, and playing with a multitude of camera settings -- and any browser can be used to control the camera. However, that program doesn't use the shutter button or the OLED display on the back of KISS-E.
At this writing, the only software using the OLED display and shutter button is kisse.ino. You can get the latest version from https://aggregate.org/DIT/KISS/#kisse. The plan is to make this OLED live view and status rendering into a library easily used in other applications, in which case the current KISS-E software becomes just one example in that library... but that hasn't happened yet.
KISS-E Live View
The CameraWebServer program makes KISS-E into a 802.11 wireless remote-controlled camera providing a nice web server interface that allows capturing stills, streaming live video, and playing with a multitude of camera settings. You can see an example of that in the attached screen grab. However, that program doesn't use the shutter button nor OLED display on the back of KISS-E; the OLED display will remain blank and presses of the shutter button will do nothing.
The KISSE program is very different, making KISS-E completely self-contained. It ignores the wireless and USB connections and simply shows a live view on the OLED until the shutter button is pressed, at which time the live view is briefly interrupted as a "high quality" 1600x1200 pixel resolution color image is captured and written to the TF (microSD) card. The current version of the software has no other options nor controls. The images can be read from the card by removing the TF card from KISS-E and placing it is a TF-card reader.
The tiny 0.96" OLED display is appealing because it is very cheap, bright enough to see in daylight despite not drawing much power, the 1-bit-per-pixel memory map of the 128x64 pixel display is pleasantly small, and the I2C interface (which only needs two ESP32-CAM pins) doesn't interfere too much with the other ESP32-CAM features we're using in KISS-E. The catch is that it is very difficult to recognizably render a scene on such a low-resolution display. Well, we can't perform the miracle of making the display pretty, but we have a developed a new halftoning algorithm that at least makes the OLED display usable for framing your shot... and some other things too.
For KISS-E, the OLED display is divided into 4 separate areas:
- The largest region, at 80x60 pixels, is the live view display which is flush against the top right corner. The live view feed is normally captured as a sequence of 160x120 resolution JPEGs, so it is a simple matter to scale that down to 80x60... but that really isn't enough strictly on/off pixels to produce a good rendering of the live view's 24-bit color pixel values. The algorithm we developed for this first converts the image to 80x60 monochrome, then detects edges, and performs a normalization of the image tones. The 1-bit pixel values are then selected using an error-diffusion scheme to better approximate the gray shades, but the edge pixels have values forced to maintain edge integrity. As you can see in the yellow-blue-green figure, although the OLED images don't look very good, this processing does surprisingly well at maintaining enough scene features to allow aiming the camera using the OLED.
- In preserving scene features, the image processing can dramatically alter the appearance of the scene in terms of both brightness and contrast. Thus, the 80x60 live view really isn't effective to judge tonality. The second display region is thus a live histogram shown flush against the lower left corner of the OLED display. This is a conventional automatically-scaled histogram plotting how many pixels have each tone, ranging from left-darkest to right-brightest. The yellow-blue-green figure also shows the histogram for each image.
- Another problem with the 80x60 image is that it is very difficult to use it to judge focus. Many mirrorless cameras use focus peaking as a focus aid: however, our display processing is already highlighting edges just to keep scene features recogniziable. Thus, the third region of the display is a horizontal bar under the live view. Before scaling the image to 80x60, our software measures peak contrast around the center of the image, and that measurement is used to draw a simple graphic. At 0% peak contrast, there are just two short bars at the left and right edges of the peaking display. As contrast increases, the bars grow toward the center, touching at 100% contrast. Thus, manually changing focus will cause the bars to grow together or shrink away from each other, and optimum focus is achieved when the bars are as close to each other as adjusting the focus can make them. Think of the dark gap between the bars as being like a magnified view of the thickness of a line in the scene blurred by defocus: a bigger gap is a blurrier line.
- The fourth region of the display is a text message region starting in the upper left corner. There is really only space for about 6 lines of 7 characters maximum each, but that's enough to be useful. The first line is used to display "KISS-E", the second the software version number as "YYMMDD", then percentage used and GB capacity of the TF card (or "no TF" if none is inserted), then a blank line, and next the current mode and any information pertinent to that. For example, during live view, the mode will be "live". When the shutter is pressed, the mode will first become "shoot" and then "write", returning to "live" after the 1600x1200 pixel JPEG has been written to the TF card.
The third figure here shows the (simulated, without text) OLED view of the same scene: surrounded by red for out-of-focus and surrounded by green for in-focus.
The plan is to make this OLED live view and status rendering into a library easily used in other applications. However, at this writing it is built-into the KISS-E application.
Using KISS-E
Here are a few photos taken with KISS-E.
KISS-E actually handles surprisingly well -- not that there is a lot to handle.
The big problem is that hand-holding it with typical lenses is nearly impossible because of the 9.7X crop factor. KISS-E works well on a tripod, or consider building KISS Viewer instead. KISS Viewer provides an easily aimed, stable mount, and you control the camera and capture images via a web browser talking to KISS Viewer via an 802.11 WiFi connection -- which doesn't cause vibration.