Skip to content

micheledinelli/cam-ino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cam-ino

Components:

How It Works

Object Detection

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

$$ d = \frac{(v \times duration)}{2} $$

where $v$ is the speed of sound in cm/$\mu\text{s}$ and $duration$ is the duration of the sonic burst in $\mu\text{s}$. All divided by two because it's a round trip. To better approximate the real distance of an object Arduino Uno manages a DHT sensor that can measure ambient humidity and temperature. While the humidity is not quite negligible for the speed of sound calculation, the temperature is quite relevant. One can adjust the speed of sound calculation (in m/s) in the air parametrizing it with temperature and humidity:

$$ v = 331.4 + (0.6 _ t) + (0.0124 _ h) $$

where $t$ and $v$ are temperature and humidity respectively.

Trigger Photo Shoot

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.

Wirings

wirings

3D Model Case

v1

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.

v2

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.

Energy Consumption

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:

$$ 36,98 \ \text{mA} + 180 \ \text{mA} + 15 \ \text{mA} + 2,1 \ \text{mA} \approx 234 \ \text{mA} $$

With a power supply of $5\text{V}$ the $\text{Wh}$ usage is:

$$ 5\text{V} \times 0,234 \ \text{A} \times 1 \text{h} = 1,17 \ \text{Wh} $$

Considering a power supply of 2 Ah @5V (10 Wh) cam-ino should last

$$ \frac{10 \ \text{Wh}}{1,17 \ \text{Wh}} \approx 8\text{h} \ 30\text{m} $$

How I Power It

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 $\approx 20\text{h} \ 30\text{m}$.

Some Photos

About

Hunter camera using Arduino UNO R4 Minima, HC-SR04 ultrasonic sensor and a ESP32-CAM

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Contributors