ESP32 CAM Project Questions

Hello,

I am in the process of building an ESP32 Cam Project for my home security system. As my driveway is long, I would like to see who is approaching my property through my monitor/lcd screen at home.

ESP32 CAM Board+Camera → Wireless → LCD Monitor

I have very little electronics background so thought of doing something fun and practical to get my way into this exciting maker world…

I have so far ordered these parts:

SEEED STUDIO XIAO ESP32S3 SENSE
POLYMER LITHIUM ION BATTERY (LIPO) 18650 CELL (3.7V 2600MAH)
1-WAY 18650 BATTERY HOLDER

I know I have to order at least two more parts:

  • Camera Module - OV2640 or OV5640
  • Wireless receiver of sort?
  • Small solar charger to supplement the lipo battery?

Questions:

  • Can someone give recommendations where it would be a good place to purchase the OV5640 from? The internet is full of these things but not sure which one’s reputable? Anyone has experience with any websites/vendors etc.?
    I am particularly after one with this camera type/head, made for ESP and not for Pi [Zero Spy Camera for Raspberry Pi Zero : ID 3508 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits]

  • My understanding is that to find the right lipo battery, you add the ESP32 power and the camera power so in other words - say a combined power in mA might be 260mA so if the lipo is at 2600mAH, it will give you 10hrs of life, right?

  • What sort of wireless receiver and display do i need for this project? Prob no more than 7" would be ideal.

  • Is connecting a solar panel to this a difficult task? What would I need hardware wise for this?

Thanks in advance.
Pundit

1 Like

Welcome Phil

Not Quite. It does not work like that. You will probably have to do some voltage conversion to 3.3V or 5V. This will be dictated by exactly which hardware you use.

If converted to 5V the results could be called disappointing. First convert to mWhr. 2600mAhr equates to 9620mWhr. now this is at the nominal 3.7V (Lithium cell). At 5V this becomes 1924mAhr. Now there will be conversion efficiency to consider which could be as low as 85% (some converters are better I think but this seems to be a reason number). When you factor this in your 2600mAhr now becomes 1635mAhr. This is the capacity you will finish up with.

If the requirement is 3.3V the result is much better. You may be able to power the hardware directly if it has on board regulators to get to 3.3V. There will be some losses but not as great as the 5V scenario but on the other hand you will not be able to run the battery below the 3.3V plus the on board regulator head room. I don’ know what that is. So the capacity will be reduced as you will not be able to run the battery down to 3V or so.

The same losses will apply to any charging system. There will be charger and any conversion losses.

Your best bet is to lay out a plan of action for your project. Select all the bits you need. Could be convenient to have them all needing the same operating voltages. Get the whole thing working using some other power supply THEN worry about your battery requirements. this will save a lot of anguish and hair pulling when you find the battery you selected at this early stage is no where near big enough and you can’t get anything to work. I would suggest get the whole thing up and running then actually measure the current requirements, add 50% (or more) for a bit of fudge factor then work from there.

I have had no experience with what you are trying to do but plenty of others have. I can’t see where the idea would not work so I will let more experience suggest the bits.
Cheers Bob

4 Likes

I started to answer your questions and soon realised I had some of my own.

How long is the driveway ?
How clear do you want the picture to be ?
Will the camera be remote to the display ? ie close to the driveway entrance or near the house.
How much do you want to spend ?

There are commercial weather proof surveillance cameras with WiFi that may be best for your situation.

some display options. Raspberry Pi WiFi connection to camera above.

The smart Pi case I have working with a 7" touch screen and Pi 4B 4GB.

The commercial camera connected to a tablet of phone via Wifi may be a better option than building something and most likely cheaper. Also easiest to get going. What you have bought could be set up as a second project, inside camera surveillance

Can be difficult. Depends on the equipment power requirements, battery and available sunlight. A solar panel to power the TP Link Camera would be large. I know the camera spec says mains powered (and this would be the better way) but it could be modified to work with a battery (which would also be large). Modifying it would void the warrenty.
.

Regards
Jim

2 Likes

Welcome Phil!

Quite a first project!

From the looks of it the sense ought to include the Camera:

This is a good way of getting a rough estimate, using the peak power will over-estimate but leave you suprised that your battery lasts that bit longer.
To get a good reading you’d want something like a Otii Arc or Power profiler (more specialised than a multimeter and oscilloscope):

The ESP32 has Wifi and there are some projects around that offer streaming:

(I’m not certain that this will work for the S3 variant)

2 Likes

Hi Liam

If converting to 5V “rough” is the operative word. Refer my scenario above. converting to 5V will leave you with about 1635mAhr. A bit (read a lot) short of your original 2600mAhr.

Had a look at that “Otii Arc” device. Looks good and OK if you have a spare $1500 or more to splash on what could be a one off use.Nothing wrong with a multimeter but you MUST use the 10A range or the meter voltage burden will give erroneous results.

Oscilloscope for current measurements?? Requires a special current probe or measure across a very low value (0.1Ω) resistor. Most home hobbyists would not even have the oscilloscope.

If the power source is 5V with a USB connector I use a Ruideng AT34 USB monitoring and measurement device which is good up to 4A. Voltage measurement range is 3.7 to 30V.

I also have a UNI-T model UT210E clamp meter. This is a small inexpensive non invasive current (and DMM functions) meter which has a resolution of 1mA and has proven to be remarkably accurate even at fairly low currents. Scales are 2A, 20A and 100A C and DC. Plenty good enough for this sort of application where absolute accuracy is not essential.

But Like I suggested. Finalising the power source should be the last task on the list. Decide what you need first. Saves headache later.
Cheers Bob

3 Likes

Hi Phil,

As Liam mentioned, the ESP32 module you purchased comes with an OV2640 already. The good news is that this is the same as the ESP-CAM module in guides like this, but a different ESP32 chip:

As for the battery use, you’ll need to solder it onto the pad on the bottom of the board (might be tricky), but there is a charge IC on the board so you could charge over USB from a USB solar panel or the like:

Provided you keep the current usage down.

For a display on the other end, you’ll probably need a Pi and display as mentioned by Jim.

1 Like

G’day Robert,

Thank you so much for the msg on the forum. Most of the stuff is alien to me, starting this new life in this area is interesting.

Would appreciate all your help. You mentioned about getting an multi-meter rated to 10A would give accurate reading. So will try and purchase one of this. I have a multi-meter I bought long time ago, so will get that out of the cupboard and look at its rating.

Naturally, I have many questions…

  1. “If converted to 5v…” ← what does this mean, who converts it, is it a natural process as in the ESP regulates that? If it determines it requires more current it will step up from 3.7V to 5V?

  2. how do you convert to mWhr and why?

  3. I guess we will come to the question on how to connect a multi-meter to which parts of the setup when I get all the parts and the setup is put together…

Thanks Robert.
Pundit.

Thanks to all who replied so far. Waiting for initial parts to arrive. Will keep the updates happening.

G’day Jim,

Answering your questions…

How long is the driveway ? about 200m away
How clear do you want the picture to be ? 1080p would be ideal, might even settle for 720p with higher frame rate.
Will the camera be remote to the display ? ie close to the driveway entrance or near the house. - Close to the entrance and not the house
How much do you want to spend ? - I want the project with ESP32 and OV cameras; not commercial grade or large ones.

Thanks.

Hi Phil.
I am not trying to be funny here but to understand all this you need to get your head around some basics like Volts, Amps, Resistance and Power (Watts)

It is not a Multimeter “rated” to 10A, this is a range on the meter and should be the one used. On mA ranges the internal resistance of the meter will be high enough to alter the circuit under test and result in incorrect or untrue results.

It means if you start with a 3.7V cell and the device requires 5V this 3.3V has to be upconverted to 5V to be of any use. done with a boost converter.

Refer to above about basics. Watts = Volts multiplied by Amps or mW = V * mA.

Power (watts) is all important regardless of the actual volts and amps. You get nothing for nothing. If you put X watts into something without amplification and a donation of some watts from somewhere else you cannot get more than X watts out. Hence even if there were no conversion losses the watts put into a converter will be the same as the watts out. So if you do some math you will see that for x watts at 3.7V there will be more current that the same X watts at 5V.
So 2600mA @ 3.7V is 3.7 * 2600 = 9620mW but the same 9620mW @ 5V is only 9620/5 = 1924mA. To this you have to apply conversion efficiency which is usually published with a boost converter and could be around 85% so the 1924 becomes 1924 * 0.85 = 1635mA. This is how and why I arrived at the above figure. Of course a particular converter may be better than 85% in which case there would be some improvement.

So I suppose the answer to your question

is you have to to get a meaningful result.

As for comment 3. Please, please do some research and reading to save massive disappointment. There is a plethora of information available. Core have some good tutorials on their web site. please use them. By getting a hand on some basics you could finish a very satisfied person at the end of the day or if you try to short cut this you can be very disappointed. If you are keen to get your head around this subject have a go and don’t give up but be prepared for a bit of the magic smoke along the way.
Cheers and good reading Bob

@Phil259706

Standard WiFi antennas will struggle with this distance, you may need a dedicated antenna on both the sender and receiver and attempt to get line of sight as much as possible. There are ways of sending video over a long distances but not as easy and cheap as ESP32 WiFi devices.

The camera and ESP32 will need some weather protection. Probably mounted on a tall mast to avoid being tampered with, especially if a solar panel will keep a battery charged. Battery would need to be shielded from the sun with adequate ventilation. The type and capacity of the battery and the solar panel size would be determined by the power requirements of the camera and ESP32.
From the placement of the camera the design of the system will be a sending unit with camera and a receiving unit at the house.

Suggest you get the parts to send and receive and get that working first. This will give you a better understanding of how it works and what is possible.

The SEEED STUDIO XIAO ESP32S3 SENSE is a very good starting point with the external antenna and good resolution camera (1600x1200). The battery is a good size to start with but will discharge quickly due to the current drain of the ESP32 in video mode and WiFi transmission. You would be lucky to get more than a few hours out of it, if streaming video continuously. This brings up the point of charging the battery.

Some 18650 LiPo cells do not have over/under charge protection. The charger on the ESP32 can only provide 100mA, therefore the 2600mAH LiPo would take about 26 hours to charge. A seperate charger may be needed as the LiPo can be charged at higher than 100mA. Keeping in mind charging lithium batteries can be dangerous.

Power requirements of the ESP32 camera could be reduced by only streaming video when movement is detected along the driveway. Best way.

Night time detection could be a problem, you would need a IR camera and IR light source.

The more I look into this the better the TP link camera I linked above looks, it is cheap enough with a lot of features you need and is weather proof. The WiFi distance is a problem but mounted on a mast and using an outside antenna at the house it might be ok.

Sorry for the disjointed way this has been presented. What you are attempting is rather complex as a
first project. Thought of stuff as I was going along.

Hope all this makes sense.
Regards
Jim

Story so far…

On Thursday, I received the hardware. Saturday, I managed to open the package and tried to start the set up process, keeping in mind that all of this is new for me.

My first task as I am breaking these into smaller chunks, is to test the camera is actually working with the ESP32 cam board.

Found a tutorial online:
https://dronebotworkshop.com/xiao-esp32s3-sense/

By following it I managed to:

  1. Download and install Arduino IDE 2.2.1
  2. Using the link provided able to identify the camera as XIAO_ESP32S3
  3. Loaded the CameraWebServer.ino and setup wireless details
  4. Uploaded the modified code back to the ESP32 Sense. It said uploaded successfully
  5. Then the tutorial says, “Start it up, and look in your Serial Monitor for a URL, which consists of an IP address assigned by your wireless router.”

I am stuck here, where do I find the Serial Monitor for a URL? I understand how the streaming server works through an IP address etc. but not sure where the author above is mentioning the Serial monitor.

Can anyone help out here please?

Thank you.

The serial monitor referred to here is the monitor that is part of the Arduino IDE. While the MCU is connected with the IDE the serial interface can be used for both uploading the sketch and for receiving data from the sketch when it runs. The serial monitor is accessed with the magnifiying glass icon in the top right, or through the Tools \ Serial Monitor menu item. Check the sketch for a Serial.begin() statement to find the baud rate to use.

2 Likes

On the Arduino IDE, on the top right, click Icon.
Opens a window to show serial monitor.

Baud rate can be selected on bottom of window.

In CameraWebServer.ino there will be a line Serial.begin(9600);
Set the baud rate to whatever the number is, in this case 9600.

Cheers
Jim

PS what @Jeff105671 said, I am too wordy sometimes, LOL

1 Like

Thank you to you both. Will look at this week and hopefully will get an IP through that which I can then use to monitor the cam functionality.

I cannot seem to locate this,
“Once you have it loaded, give it a try. Start it up, and look in your Serial Monitor for a URL, which consists of an IP address assigned by your wireless router. Then, go to a computer or tablet connected to
that same wireless network and type in that address.”

I looked in the serial monitor; all I get is “Message (Enter to send message to XIAO_ESP32S3 on COM3”

Found the baud rate through serial.begin(115200)

Not sure where to look to get the ip address so that I can use that on the browser to look at the cam.

Any help would be appreciated. Thank you.

What sketch are you running?

The relevant code from CameraWebServer.ino is;

  Serial.println("");
  Serial.println("WiFi connected");

  startCameraServer();

  Serial.print("Camera Ready! Use 'http://");
  Serial.print(WiFi.localIP());
  Serial.println("' to connect");

That should print the local IP address assigned when the WiFi object was instantiated and connected to your local WiFi network. That’s the address you need. I can’t find the text you quote anywhere in that sketch so it might be coming from the upload procedure, not the sketch. Did you try resetting the MCU?

Hi Jeff,

I am following this write-up as mentioned in the above posts as reference as I have nothing else to follow: https://dronebotworkshop.com/xiao-esp32s3-sense/

My arduino IDE is ver 2.2.1

A silly question; is there a power button on the ESP32 module that i need to manually push? The cam module itself is hot so I took it that it is already powered on.

The section of the tutorial you have quoted is marked “CameraWebServer Demo” so I wanted to confirm that was the part you had got up to.

The important bit is:
The camera model is set correctly
The password and SSID are set correctly
The sketch has been uploaded successfully
The sketch is running

It’s that last step I was querying - it is possible that the upload does not automatically start the sketch.

There is no power button on the module but there is a reset button. See the part of the tutorial marked “XIAO ESP32S3 Sense Pinouts”.

Jeff,

I do not have a memory card in the board; i dont think this was necessary as per that page…

To answer your questions

The important bit is:
The camera model is set correctly - #define CAMERA_MODEL_XIAO_ESP32S3 // Has PSRAM

The password and SSID are set correctly - Yes, double-checked

The sketch has been uploaded successfully - Yes, shows it is writing and i re-did it just in case

The sketch is running - Not sure how to check this?

It’s that last step I was querying - it is possible that the upload does not automatically start the sketch.

The below output from the serial monitor output:

…E (519) esp_core_dump_flash: No core dump partition found!

.ESP-ROM:esp32s3-20210327

Build:Mar 27 2021

rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)

Saved PC:0x4210ef2a

SPIWP:0xee

mode:DIO, clock div:1

load:0x3fce3808,len:0x44c

load:0x403c9700,len:0xbd8

load:0x403cc700,len:0x2a80

entry 0x403c98d0

E (518) esp_core_dump_flash: No core dump partition found!

E (518) esp_core_dump_flash: No core dump partition found!
…E (519) esp_core_dump_flash: No core dump partition found!