Wireless cameras are extremely useful for a wide range of maker projects. A Raspberry Pi with a USB webcam or Pi camera can make a good, inexpensive wireless camera. The ESP32-Cam board offers an even lower cost option for projects that don’t require much processing power for the camera with just as many uses.
With its built-in camera, SD card reader, and wireless networking, the ESP32-Cam is a great option for a low-cost wireless camera.
The ESP32-Cam is based around an ESP32-s microcontroller. The ESP32-s microcontroller has WiFi, Bluetooth 4.2, and BLE built-in. The ESP32-Cam adds a small camera, Micro SD card reader, and breaks out several of the ESP32-s’s GPIO pins to convenient headers. The headers are spaced .1” apart, meaning they’re compatible with most breadboards and perma-proto boards.
It features 16 PWM channels, which can be mapped to any GPIO pin. Peripherals can be connected via the hardware serial port on pins 1 and 3, or software serial on any pair of pins. There’s 2 mappable hardware I2C ports, one is used by the internal hardware, the other is available for adding sensors, output modules, or GPIO expanders. Softi2c can be used to add additional I2C ports if necessary. Pin 4 is connected to a bright white LED that can be used as a flash. There’s a built-in red LED on pin 33. This LED can be used to indicate something is happening or used as a “heartbeat” to show the module is powered on and running. I like to use it to indicate whether or not the module is connected to WiFi.
Power can be provided via the ground and 3.3v or 5v pins, though many have found powering the ESP32-Cam with 3.3v leads to instability. I like to use a regulated 5v power supply, or a LiPo battery combined with a Power Boost 500 to provide power. The ESP32-Cam can be programmed via the Arduino IDE. It doesn’t have a USB port for programming, so you’ll need an FTDI adapter to upload your code to the microcontroller. I like this one from Inland.
Inland’s FTDI adapter allows you to upload code from the Arduino IDE to your ESP32-Cam
The ESP32-s has limited processing power. It can handle basic IO tasks and some light computing. For projects that involve processor-intensive operations like object detection, it's usually best to offload the image processing to a more powerful computer such as a Raspberry Pi. Full specs can be found in the table below.
The camera, SD card slot, and flash are on the top of the module
The ESP32-Cam has a wide range of uses. Using a home automation program like Home Assistant you can easily build a low-cost home surveillance system based on these camera modules. The code needed for this project is included in the examples of the Arduino-esp32 library and is titled “CameraWebServer”. The arduino-esp32 library can be found on GitHub. You just need to add your WiFi network’s SSID and password to the code, upload the code via your FTDI programmer, and power on the module. Its small size makes it easy to hide the module, and the low power consumption eliminates the need for bulky batteries or power supplies.
Thanks to its small size the ESP32-Cam can easily be integrated into a doorbell. Thingiverse user hoeby designed a 3D printable case that houses the camera module, a button, and has interchangeable backplates to angle the camera for framing. The .stl files and a link to the code can be found on the project’s Thingiverse page.
With a little more work the ESP32 module can be set up to act as an access point. This allows you to connect your phone, tablet, or computer directly to the ESP32-Cam, and stream video to your device in areas where WiFi is not available. I’ve used this to set up remote cameras for field observations when WiFi is not available. I’m able to stream video straight to my computer and record it, or monitor the camera stream in real time.
When programming the module you’ll need to connect pin 0 to ground. After setting your FTDI programmer to 5v, connect the 5v and ground pins from the programmer to the 5v and ground pins on the module. Connect the RX pin on the programmer to GPOI 1, and the TX pin to GPIO 3. The diagram below shows the proper connections when using the Inland programmer. Select the proper COM port in the Arduino IDE and upload your code.
One of the major limitations of the ESP32-s is range. There’s an antenna built into the printed circuit board that offers about 25 yards of range. An external antenna can extend the range up to 100 yards depending on the terrain. Attaching an external antenna requires a little bit of surface mount soldering, but with a pair of tweezers and a fine point soldering iron, it’s an easy process. It’s not strictly necessary to use the resistor, so if you damage or lose the resistor you can simply short the pads with a solder bridge.
A resistor or solder bridge is used to select the antenna. On the left, I have circled the default location of the resistor, which enables the internal antenna. On the right, I have circled the pads used to enable the external antenna. To the left of the pads is the antenna connector.
While the ESP32-Cam is designed to be used as a wireless camera, it can also be used as a general-purpose microcontroller. Other ESP32 based development boards offer more GPIO pins, but most have a larger footprint than the ESP32-Cam. This makes the ESP32-Cam an excellent choice for any project where space is at a premium and you don’t need many inputs or outputs, whether you need the camera or not. The built-in Micro SD card slot makes it excellent for data logging.
The ESP32-Cam is a great way to add wireless cameras to your projects. For the cost of a Raspberry Pi compatible camera, you can get a camera module with built-in WiFi, Bluetooth, BLE, and a microcontroller. If you need a small ESP32 based microcontroller without a camera, you might find the ESP32-Cam is a good choice thanks to its small footprint. It’s easy to program, and with a little networking know how they can be used for a wide variety of projects. The ESP32-Cam is available in a 2 pack at your local Micro Center.
More from the Micro Center Community:
Looking for more information about micro controllers? We’ve got a Hobby Board section of the community, as well as Hobby Board guides like How to Set Up a Raspberry Pi Media Server, Raspberry Pi Basics, and How to Create a Retro Game Console With Raspberry Pi. And if you can’t find what you’re looking for, don’t hesitate to post a new discussion and the Community will be happy to help!
Looks like an interesting add-on to a Pi project!
Submit photos and a description of your PC to our build showcase
See other custom PC builds and get some ideas for what can be done
Services starting at $149.99