Arduino Uno manages the HC-SR04 ultrasonic sensor and the DHT sensor. The HC-SR04 sensor works by sending sound waves from the transmitter, which then bounce off of an object and then return to the receiver. One can determine how far away something is by measuring time it takes for the sound waves to get back to the sensor. The speed of sound in the air is approximately 331 m/s at 20˚C (0,331 cm/$\mu\text{s}$) so in order to calculate the distance of an object one can use
where
where
When an object is quite near (~100cm) Arduino Uno sends a 5v signal to ESP32-CAM using one of its digital pin. Since the ESP32-CAM works with 3.3v the two are connected using a voltage divider circuit that lowers the input for the ESP32-CAM at 3.3v. Once the ESP32-CAM receives the trigger signal it starts the capturing process. The photo is taken using a OV2640 camera that shoots at SVGA (800x600) resolution. ESP32-CAM generates random names for the pictures and stores them on a SanDisk Ultra 32GB microSDHC.
The components are "organized" inside a cool 3D printed box with its own cover. The two .stl filese are available in this repository and can be 3D printed in a couple of hours.
The two holes at the top are for the HC-SR04 sensor, while the hole at the bottom is for the camera. Originally the camera was meant to be a OV7670 or a TTL Serial JPEG Camera but for many reasons that was not the case.
A second version of the case that fits the ESP32CAM is available at 3d-case/hunter-case.stl. It's compatible with the v1's cover.
| Component | Typ (mA) | Max (mA) |
|---|---|---|
| Arduino Uno R4 Minima | 33.30 | 36.98 |
| ESP32-CAM | 180 | 310 |
| HC-SR04 | 15 | 15 |
| DHT21 | 1.5 | 2.1 |
Considering max current draw for each component (except for the ESP32CAM where average is considerd) the total power consumption is:
With a power supply of
Considering a power supply of 2 Ah @5V (10 Wh) cam-ino should last
I use a Milwaukee M12 2.0Ah battery @12V. I supply power to the Arduino Uno R4 Minima's VIN pin and distribute voltage using 5V pin. With this battery cam-ino should last











