ESP32 cam watcher
This project helps me to observe my pot with pine's twig. I use an ESP32 controller with a camera to take pictures and post it to Telegram channel.
You can find the source code for this watcher here.
Assembling
First versions of the watcher:
version 1 | version 2 |
---|---|
![]() |
![]() |
Although the first versions worked pretty well they had several flaws:
- They didn't have indicators of power and state
- I couldn't switch states without uploading new code to the controller
- I couldn't change the camera position freely
To improve these flaws I decided to add LEDs and buttons.
First I assembled all the components with a plastic breadboard to test the idea:
Then I soldered all the components:
Schema of LEDs, buttons, and pins:
Now the watcher has:
- three LEDs to show power supply and state
- one button to switch between states
- several pins to power supply (VCC,GND) and debug controller (IO0,RX,TX)
States
The watcher has 2 states:
-
setup
-
watcher
In the setup
state you can connect to a local HTTP server and get a picture from the camera online. In order to set up the camera position.
I bought a special stand to change the camera position freely:
front | side |
---|---|
![]() |
![]() |
In the watcher
state the camera gets an actual timestamp by NTP protocol from pool.ntp.org
, takes a picture, and sends it to "hourly" and
"daily" Telegram channels.
The controller stores the last sent time in a persistent memory. As a result there are no problems with sending schedule even after power outage.
Debug
You can connect to the controller with debug pins and read logs. There are logs in the setup
state:
-> Controller enabled
-> Camera initializing
-> Camera initialized
-> WiFi connecting
-> .
-> WiFi connected: 192.168.0.8
-> Controller initialized
-> State: setup
-> HTTP client connected
-> HTTP request GET /
-> HTTP response sended
-> HTTP client disconnected
-> HTTP client connected
-> HTTP request GET /picture
-> HTTP response sended
-> HTTP client disconnected
There are logs in the watcher
state:
-> State: watcher
-> Sending a photo to an hourly channel
-> Current: timestamp:1735989368 hours:28933156
-> Last sended: hours:28933148
-> Connecting to api.telegram.org
-> Connection successful
-> Sending HTTP request
-> ....
-> Sending HTTP request done
-> HTTP Response: {"ok":true,"result":{...}}
Conclusion
Currently, the camera is installed on the balcony and works pretty well.
Growing a pine from a seed is very hard for me. It's my the 3rd attempt for now. You can watch the video I assembled from my hourly channel's photos.