Esp32 Cam
Esp32 Cam
ISS-232
This work is licensed under the Creative Commons Attribution 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
Abstract
Experimenting with custom-programming of cameras can be
difficult. Most consumer cameras are protected to prevent users
from reprogramming them. Industrial cameras can be flexibly
controlled by an external computer, but are generally not stand-
alone programmable devices. However, various inexpensive cam-
era modules, designed largely to be used for building IoT (Inter-
net of Things) devices, combine extensive programmability with
a camera in a compact, low-power, module. One of the smallest
and least expensive, the ESP32-CAM module, combines a 2MP
Omnivision OV2640 camera with a dual-core 32-bit processor,
Figure 1. ESP32-CAM actual size: front and rear views
802.11 WiFi and BlueTooth as well as wired I/O interfaces, a mi-
croSD slot, low power modes, etc., all supported by the Arduino
programming environment and a rich collection of open source
libraries. Why not use it for programmable camera research? fer excellent programmable camera support via either Android or
This paper describes how the ESP32-CAM had to be adapted IOS, very similar to the API developed for the research platform
to enable use in a variety of experimental cameras. For exam- Frankencamera[3][4], but the cost is high for the image quality de-
ple, some of these cameras do not use the lens screwed and glued livered, and the cameras are essentially unalterable sealed subsys-
onto the OV2640, and replacing this lens revealed a number of is- tems. Compact cameras are much cheaper while offering some-
sues ranging from spectral response to adjustment of lens correc- what better image quality, but only the reverse-engineered open
tions. There are numerous strange interactions between different source Canon Hack Development Kit (CHDK)[5] offers the de-
functions that end-up sharing the same I/O pins, so work-arounds sired level of programmability. At this writing, CHDK supports
were needed. It also was necessary to devise ways to handle vari- 160 different low-end Canons, including most PowerShot mod-
ous higher-level issues such as implementation of a live view and els and a few EOS M series mirrorless bodies; for more than a
synchronization across cameras. However, the key problems have decade, CHDK has been one of the most viable approaches for
been resolved with open source software and hardware designs experiments involving reprogramming of cameras.
described here. Cameras designed to be tethered to a computer do not offer
programmability directly, but can be intelligently controlled by
Introduction a host computer program. Although various interfaces are avail-
A wide range of digital cameras are readily available, but able, most such cameras use USB, often leveraging the driverless
very few make it easy to conduct experimental camera research UVC (USB video class) protocol[6]. Consumer-oriented teth-
requiring custom programming. ered cameras are generally marketed as webcams, whereas those
The most obvious options would be high-end consumer cam- marketed as industrial or machine vision cameras tend to have
eras, especially mirrorless interchangeable-lens cameras using more robust physical construction, accept C-mount interchange-
MFT, APS-C, or full-frame sensors. Although most consumer able lenses, and may offer additional features. Due to the limited
cameras employ a variety of mechanisms to discourage users from market for industrial cameras, cost tends to be higher than for
reprogramming them, some open-source efforts have managed to consumer cameras with similar specifications.
reverse-engineer ways to support 3rd-party programming. Magic There have been a few commercial cameras designed for
Lantern[1] was successful in adding programmability and various programmability, but they tend to be relatively expensive. The
features to several Canon EOS DSLRs and the original EOS M DevCAM[7] is a very promising open source design incorporat-
mirrorless, but porting to new models is difficult, and none of the ing an FPGA to support research use of up to six MIPI sensor
latest models are supported. The OpenMemories[2] project en- modules, but it also is relatively expensive per camera.
ables 3rd-party software to run in the protected Android camera The alternative explored in the current work leverages the
app environment that Sony created for their PlayMemories apps. large market that has developed for inexpensive camera mod-
Sony supported that app environment in a wide range of models, ules intended to be used for building IoT (Internet of Things) de-
from digital video cameras to the high-end full-frame 42MP A7r vices. These camera modules often are paired with fairly substan-
II, but discontinued support of Android apps in all new cameras tial microcontrollers, and supported as platforms for both hob-
immediately after OpenMemories became viable. byist/experimenter use and IoT product development. On the
Cell phones and compact consumer cameras also would be hobbyist/experimenter-oriented high end are boards providing a
obvious alternatives using smaller sensors. Most cell phones of- full Linux environment, such as NVIDIA’s Jetson[8] and various