Tag Archives: camera

Building a Kodak Brownie digital camera

The Kodak Brownie was the first camera to really bring photography to the masses with a low purchase price. The simplicity of its design meant anyone could figure out how to use it with little difficulty – even by comparison with today’s cameras it is still easy to use, since it has essentially no controls to learn – just a shutter button, view finder and film winder. Millions of Kodak Brownies were made over the course of its 60 year lifespan, from 1900 onwards and the build quality & simplicity means many survive in good working order. The upshot is that a Kodak Brownie is a good option for custom modifications – easily available on ebay or in car boot sales, simple to hack and cheap enough that it doesn’t matter if things go wrong.

The original plan was to build a variant on my previous raspberry pi & webcam based pinhole digital camera, since I already had a second raspberry pi zero needing a purpose. A previous trip to the local carboot sale had yielded a Kodak Brownie Hawkeye for less than £5, which is the variant from the 1950’s with a case made out of bakelite instead of wood / cardboard. So the only key missing piece was a webcam. Since both the raspberry pi zero and kodak brownie had cost less than £5, that was set as the upper limit for obtaining a webcam. Trawling eBay listings found a number of sellers offering a variety of 50 megapixel cameras at this price point. These technical specs were clearly complete & utter lies – it was never going to be a 50 MP sensor for that price – but at the same time it was worth a punt to discover just what the cameras did offer. I first one I obtained turned out to provide 640×480, or a mere 0.3 MP with raw video only, no mjpeg, thus limiting the framerate too. IOW pretty awful, but only marginally more awful than expected. The plus side was that the case was easy to remove exposing a very compact circuit board which would be an ideal size for embedding.

The “50 megapixel” eBay webcam, which turned out to be 0.3 megapixels, prior to removing the case

Upon testing the webcam with an improvised pinhole plate, it was clear that the sensor had unacceptably poor low-light performance. While it could serve as a pinhole camera, it would only be usable outside in bright conditions. I wanted to build a camera that was more versatile, so the plan was changed to build a “normal” digital camera instead of pinhole digital camera.

With the key parts obtained, design and assembly could begin. An initial approach was to keep the Brownie’s original lens and position the bare webcam sensor behind it. To achieve sharp focus, the sensor would have to be placed at the same position that the film would be relative to the lens. Each film negative, however, was 60x60mm in size, while the webcam sensor was less than 5x5mm. Testing confirmed that the webcam would have an incredibly narrow field of view, making it near impossible to compose shots with the crude viewfinder mirror.

The alternative was to disassemble the Brownie and remove its own plastic lens. The webcam circuit board could then be positioned such that its own lens was would be right behind the shutter. The circuit board was just a few mm to large to fit into the required position, so a dremmel tool was used to carve a slot in the inside of the case, allowing the circuit board to slip into place.

The interior of the Kodak Brownie, showing the circuit board in place immediately behind the lens. The circuit protrudes through a slot cut in the wall and held in place with bluetak.

This allowed the webcam to have a field of view similar to that of the original Brownie. In fact the field of view was wide enough that it covered the entire shutter aperture so the resulting images showed a circular vignette.

Still image captured by the webcam when behind the Kodak Brownie lens. The sensor field of view expands beyond the maximum size of the shutter aperture

The second task was deciding how to position to Raspberry Pi Zero in the case. As luck would have it, the width of the Pi Zero is exactly the same as the length of a 620 film spool, so the film holders were able to grip the Pi Zero circuit board. In common with the previous pinhole webcam, two LEDs were to be used, one illuminating when the power is on and one illuminating when the webcam is capturing an image. Two small holes were drilled in the top of the Brownie case next ot the shutter button, through which the LEDs could poke. A spot of superglue held the LEDs in the correct position.

Inside of Brownie case showing the Raspberry Pi Zero board, USB power cable and LED status indicators

One of the key goals for the camera design was that the shutter button on the Kodak Brownie should be used to trigger image capture on the webcam. Ideally a single press of the shutter button would capture a single image. To achieve this, the mechanical shutter button needed to interface with the Raspberry Pi GPIO pins in some manner. After thinking about this tricky problem for a while, a solution involving a pair of bare wires and some conductive paint was conceived. One wire would connect to a programmable GPIO pin configured as an input in pull-up mode. The second wire would connect to a GPIO ground pin. A hole was drilled through the case coming out immediately below the shutter button, through which the wires could pass. Insulation was stripped off the wires and they were superglued in position below the shutter button. Finally a blob of conductive paint was applied to the underside of the shutter button. The result is that when the shutter button is pressed, the conductive paint shorts out the two wires, pulling the GPIO pin to ground. This change can be detected by the Pi Zero and used to trigger the shutter.

Shutter button on the Kodak Brownie, showing a blob of conductive paint, used to short circuit wires used to trigger webcam capture

The Brownie shutter mechanism is designed for film with a fixed shutter speed. It was not practical to synchronize image capture with the precise fraction of a second that the shutter was open. Fortunately the Brownie has a long exposure mode where the shutter remains open for as long as the shutter button is pressed. Normally this long exposure mode is activated by raising a second button on the Brownie, but this is somewhat tedious. A little bit of electrical tape applied to the shutter mechanism was able to hook it into permanent long exposure mode.

The Brownie shutter mechanism with spot of electrical tape used to fix it in long exposure mode permanently.

Testing of the shutter mechanism was revealed a small problem – the webcam takes  a second or two to automatically measure & adjust exposure to suit the lighting conditions. The result was that if an image was captured immediately after pressing the shutter button, it would often be totally underexposed. This prompted another slight change in design. Rather than capturing a single image immediately as the shutter is pressed, the software was written to wait a second after shutter press and then capture images continuously thereafter, one per second, until the shutter was released. IOW, it would be a timelapse capture device.

The only remaining task was power. The Pi Zero and webcam combination has very low power requirements, at most 200 milliamps, and it was already known that a USB lithium ion powerpack provides an excellent power source that lasts a really long time. The problem is that for most powerpacks on sale today, physical size is not a hugely important factor. To date it has been impossible to find one that is small enough to fit inside the Brownie case – it would need to have a longest dimension of 6cm to stand a chance of fitting once the USB cable is plugged in – 5cm would be even better. Having the battery inside the case also adds a requirement to put a physical power switch between the Pi Zero and the battery, unless you want to open the camera to turn it on/off every time. The simple solution was thus to just drill a hole in the case for the USB cable, leaving the battery on the outside.

Finished Kodak Brownie digital camera showing cable to external battery pack

With the hardware construction complete, attention turned to the software to control it. Rather than start from scratch, the previous code used for the pinhole webcam Arcturus, was used extended. First it was discovered that the cheap webcam didn’t provide MJPEG capture, which meant pulling in libjpeg to do encoding of the raw frames into JPEG still image files. Capturing images in raw format means the USB device has to transfer far larger quantities of data. While this wasn’t a problem on the laptop used for development, the raspberry pi was continually getting dropped / incomplete frames from the webcam. After countless hours debugging, the problem was discovered to be the driver for the USB controller in Linux mainline, used by Pignus (the Fedora fork for the Raspberry Pi arm6 borads). The Raspbian kernel by comparison has an out of tree driver for the USB controller which turned out to work fine. The remaining software changes involved wiring up support for using the shutter button to trigger capture via a GPIO pin. The end result was that upon pressing the shutter button it would capture still images continuously, 1 per second. After a sufficiently long series of stills had been captured, they could be turned into a timelapse video sequence.