Solar harvesting Wi-Fi camera

An ESP32-CAM module is a low-cost device based on ESP32-S module, an OV2640 image sensor and Micro SD slot. The module is not designed for low energy consumption, however, after some tweaks, the power consumption can be lowered to a level that is usable for short periods of time, powered by solar energy. The project presented here is a reasonably robust, dust-resistant and waterproof experimentation platform, using commercial off-the-shelf components. Ideal for outdoor usage.

Solar harvesting Wi-Fi camera ready to be placed outside

Key component: ESP 32 CAM

Simplified diagram

Lowering power consumption

ESP32-CAM wasn’t designed to be a low power device. Without modifications, deep sleep current measured was 2.8 mA, it leaves much to be desired.

Deep sleep current measurement without modifications

Some people on the Internet already ventured in the following modifications:

These modifications lowered deep sleep current to 0.8 mA, which is scandalous for a low power device, however, is a substantial advance from the 2.8 mA without modifications.

Modifications and final result, Polyimide tape used to protect fine wir

Bill of materials

Parts used

COMPONENT DATASHEET  -  BUY LINK

PRINTED CIRCUIT BOARD SOURCE FILES REPOSITORY  -  BUY LINK

SOFTWARE REPOSITORY  -  DOWNLOAD LINK

OPTIONAL COMPONENT DATASHEET  -  BUY LINK

Assembly


The basic platform consists of a waterproof enclosure for sport cam and a printed circuit board with the appropriate size to fit inside.

Basic platform components


The proposed enclosure is pretty common, easy to find and inexpensive. Opens and closes without screws and has a mounting point where different mounting accessories can be installed.

The printed circuit board was designed to place ESP32-CAM near the window where the camera lens was to be located. The module can be positioned in two different orientations to maximize area, depending on the selected components.

AAA battery clip added, female connectors to plug/unplug module easily and header pins for programming, because the board does not have such circuitry. Also, a red LED for debugging purposes was added.

Board with all components

Energy harvester

The camera gets its energy from solar panels installed inside the enclosure, which means that the area available is small, so a way to maximize its efficiency is needed. A harvesting module based on BQ25504 chip was used. This device boosts solar panel voltage and is able to do that with voltages down to 130 mV!, is therefore able to supply current for storage in the battery, even without direct light hitting the panel.


Energy harvesting module attached with double sided-tape

The module also works as a battery charger with over voltage and under voltage protection. In order to set voltage values, some resistors must be modified. The module’s manufacturer provides a spreadsheet to make the process easier.

Because the enclosure is transparent, it is possible to put a few solar panels in various places inside, and wire them in parallel or series. Maybe some diodes will be required to not lose a lot of efficiency when some panels are shaded.

Another important function of the energy harvesting module is the ability to output a VOLTAGE OK SIGNAL, so the MCU could be kept in reset state when the battery voltage is too low to operate.

Solar panels and board installed in the interior. Use a piece of EVA foam to keep things in place

Energy budget

Warning: Some data and procedures will be simplified to yield simpler and faster results!

ESP32 draws about 200 mA at 3.3 V to send data over Wi-Fi, which is equivalent to 0.66 W. A 40x40 mm solar panel that fits inside the aforementioned enclosure yields around 65 mA at 2 V at full sun, which is equivalent to 0.13 W.

With this data, it is clear that it is not possible to use ESP32 sending data over Wi-Fi continuously with that panel, even in full sunlight.

To deal with this problem, two things are needed: a storage element, and the use of the ESP32 module in non continuous (duty cycled) mode.

The module in deep sleep mode draws about 0.88 mA at 3.3 V, which is equivalent to 0.003 W. Assuming 12 hours of daylight, it will take an average of 0.006 W average per day, just to keep the module energized up in sleep mode. If the pair panel/harvester can yield an average of 4.6% of the maximum power of the solar panel at full sun, it is enough to keep energized the ESP32 in deep sleep mode for a very long time (until battery degradation!).

Assuming 100.000 Lux as a full sun and 100% of the 40x40 mm solar panel power as 0.13 W, it is estimated that the average irradiance required per day to keep the ESP32 energized in deep sleep is around 4600 Lux.

How much energy is required to take a picture and upload it over the internet?

After waking up from a deep sleep, it takes about 4 seconds for the ESP32 to take a picture, store it in the SD card, and bring it online. The average power consumption of these 4 seconds is 200 mA at 3.3 V. The current to be accumulated for 12 hours to is:

ESP 32 Cycle: 200 mA x 4 S

It is needed: ? mA x 12 H ? ma x 12 (3600) S ? ma x 43200 S (Approximating to 40000 to make calculations easier)

factor = 4 S / 40000 S = 0.0001 200 mA * 0.0001 = 10 uA

It is required an average of 10 uA for 12 hours to take a picture and send it to a server, which is perfectly feasible in the outdoors, even on cloudy days.

Finding the relation between Lux and output power of the 40x40 mm and 0.13 W solar panel.

100.000 Lux => 0.13 W 0.77 Lux => 1 uW

10uA * 3.3V = 33 uW

(0.77 Lux /uW ) 33 uW = 25.4 Lux (Approximating to 26 Lux)

It will take an average of 26 Lux per day to take a photo and send it over Wi-Fi

In short, to take at least one photo a day and send it over Wi-Fi, it will take a daily average of 4600 Lux + 26 Lux = 4626 Lux. For two pictures a day it will take a daily average of 4652 Lux, and so on.

If a smaller panel is used, such as the 30x25 mm in the front of the camera, whose power is about a quarter of that installed on the back, the irradiance should be 4 times stronger.

Solar panel in the front vs. solar panel in the back


To use the camera with such a small panel, a lot of light is required, especially direct light.

Firmware and Software

The firmware released here does the following things: take a picture and store in the Micro SD card, then send it over Wi-Fi to a server doing a multipart HTTP POST request and then, enters deep sleep for X amount of seconds before starting the cycle again. The code could serve as a starting point in the creation of a more robust application adapted to individual needs.

On the server side, there is a small app written in Golang, which listens HTTP POST requests and receives the images sent by the ESP32-CAM and stores them in a local folder. This app should run on a PC, or a Raspberry Pi in the same LAN of the ESP32-CAM. Due to being a basic starter example, there is no authentication method developed, so it is not recommended for deploying in a public server in the Internet.

To program the module, a USB to TTL serial converter is needed, because the module hasn’t an onboard chip for that task. In addition, GPIO0 should be tied to GND during programming.

GPIO33 was freed from the onboard LED and wired externally. The supplied firmware uses it for debugging, but it may be used for other purposes like:

Results

Image quality isn’t great, which was expected due to the cost of the module. Quality could be improved, modifying several parameters of the chip depending on the specific lighting conditions. The image shown below was uploaded automatically by the module through Wi-Fi to a Raspberry Pi where the Golang upload server was running

Test rig and uploaded picture

Possible improvements

Since firmware and upload server are very basic examples, there are some tasks proposed to the reader like: