Time Lapse Camera Using The ESP32-CAM

Time Lapse Camera Using The ESP32-CAM
This project builds upon the previous digital image camera project and we build a time-lapse camera using the ESP32-CAM board. All the images are saved to the microSD card in sequence and the board goes to sleep after taking an image to help save power. This is handy if you power it using a battery.

The video above covers everything you need to know and also explains how the sketch is put together.

Step 1: Gather the Parts

We Need A Suitable microSD CardWe Need A Suitable microSD Card

The ESP32-CAM board already contains the camera module, and microSD card slot that we need for this sketch. In addition to this, you will need a microSD card, a 5V power source and also a USB to serial converter to upload the sketch.

Step 2: Wire Up the Board

Wiring For Sketch UploadWiring For Sketch Upload

The ESP32-CAM board does not have an onboard USB connector so you need to use an external USB to serial converter to upload the sketch. You can use the wiring connections shown above but make sure that the USB to serial converter is connected in the 3.3V mode.

It is recommended to use an external 5V supply to power the board, particularly if you are using an FTDI breakout board. For the external 5V supply, a simple USB breakout board will do just fine. There has been some success in powering the board directly from the CP2102 breakout board so you can try that first. The board also has a 3.3V power pin if needed.

Serial Output In Download ModeSerial Output In Download Mode

The jumper is needed to put the board in the download mode. Once you have everything connected, power up the board, open a serial terminal (Tools->Serial Monitor) with a baud rate of 115,200 and press the reset button. You should obtain an output as shown in the image and this will indicate that everything is working as expected.

Step 3: Download the Sketch & Format SD Card

Download the sketch using the link at the end of this post and open it using the Arduino IDE.

Overview Of SketchOverview Of Sketch

EEPROM Image Numbering LogicEEPROM Image Numbering Logic

The sketch requires that the microSD card be formatted in the FAT32 file format which is usually the default file system. In windows, you can do this by right-clicking the microSD card, selecting format, then the correct settings and hitting start. Once this is done, insert the microSD card into the ESP32-CAM board.

Step 4: Upload & Test

Serial Output When In OperationSerial Output When In Operation

Power up the board in the sketch upload mode and hit the upload button. Wait for it to complete. Once done, remove the boot jumper and press the reset button. The board will take an image, save it to the microSD card and go to sleep. The serial terminal will give you the board status along with any errors or warnings. Wait for sufficient time to lapse and the board will wake up again to repeat the cycle.

Statement That's Responsible For Sleep TimeStatement That’s Responsible For Sleep Time

Adjust The Sleep Time By Changing ThisAdjust The Sleep Time By Changing This

The second last line in the setup() function specifies the time-lapse and you can update this by changing the pre-processor directive located at the top of the sketch.

Images Saved To The microSD CardImages Saved To The microSD Card

The images will be stored in the microSD card and can be used as needed.

Step 5: Print the Enclosure

An enclosure greatly helps in taking steady images and I found a nice little enclosure the works great for this build.

3D Printed Enclosure3D Printed Enclosure

Link to 3D model: https://www.thingiverse.com/thing:3652452

Wiring The 5V Power PinsWiring The 5V Power Pins

Back Cover In Place With The StandBack Cover In Place With The Stand

You can add a microUSB breakout board to power the ESP32-CAM board but since I only had one board with me, I decided to solder wires to the 5V and ground pin and use an external breakout board. The back cover was flipped to support this. The 3D model also contains several stands that allow for versatile mounting.

It’s amazing what this little board can do and the images produce some interesting results once color corrected. Do check out the video for a sample clip.

Digital Still Image Camera – ESP32-CAM

Digital Still Image Camera Using The ESP32-CAM
In this post, we will learn how to build a digital still image camera using the ESP32-CAM board. When the reset button is pressed, the board will take an image, store it to the microSD card and it will then go back to deep sleep. We use the EEPROM to store and obtain the image number.

The video above covers everything you need to know and also explains how the sketch is put together.

Step 1: Gather the Parts

Gather The Parts Gather The Parts

The ESP32-CAM board already contains the camera module, reset switch and microSD card slot that we need for this sketch. In addition to this, you will need a microSD card, a 5V power source and also a USB to serial converter to upload the sketch.

Step 2: Wire Up the Board

Wiring For Sketch Upload Wiring For Sketch Upload

The ESP32-CAM board does not have an onboard USB connector so you need to use an external USB to serial converter to upload the sketch. You can use the wiring connections shown above but make sure that the USB to serial converter is connected in the 3.3V mode.

It is recommended to use an external 5V supply to power the board, particularly if you are using an FTDI breakout board. For the external 5V supply, a simple USB breakout board will do just fine. There has been some success in powering the board directly from the CP2102 breakout board so you can try that first. The board also has a 3.3V power pin if needed.

Serial Output When In Download Mode Serial Output When In Download Mode

The jumper is needed to put the board in the download mode. Once you have everything connected, power up the board, open a serial terminal (Tools->Serial Monitor) with a baud rate of 115,200 and press the reset button. You should obtain an output as shown in the image and this will indicate that everything is working as expected.

Step 3: Download the Sketch & Format SD Card

Overview Of The Sketch Overview Of The Sketch

Download the sketch using the link at the end of this post and open it using the Arduino IDE.

The sketch requires that the microSD card be formatted in the FAT32 file format which is usually the default file system. In windows, you can do this by right-clicking the microSD card, selecting format, then the correct settings and hitting start. Once this is done, insert the microSD card into the ESP32-CAM board.

Step 4: Upload & Test

Serial Output During Operation Serial Output During Operation

Power up the board in the sketch upload mode and hit the upload button. Wait for it to complete. Once done, remove the boot jumper and press the reset button. The board will take an image, save it to the microSD card and go to sleep. The serial terminal will give you the board status along with any errors or warnings. Press the reset button and the board will boot, capture and image and go to sleep again.

Step 5: Obtain & Share the Images

Sample Image 1 (Original) Sample Image 1 (Original)
Sample Image 1 (Corrected) Sample Image 1 (Corrected)
Sample Image 2 (Original) Sample Image 1 (Original)
Sample Image 2 (Corrected) Sample Image 2 (Corrected)

Once you are done taking images, you can remove the microSD card, and connect it into your computer. All the images should be visible for you to use. This is a simple way by which you can create a digital camera using the ESP32-CAM board. The image quality is not that great but that should change once they release better quality cameras for this board. The images also seem to have a greenish tint to them which can be corrected using image editing software, examples have been included above.

ESP32-CAM IP Camera With Face Detection

ESP32-CAM IP Camera With Face Detection & Recognition
This post is different compared to the others and we take a look at the very interesting ESP32-CAM board that is surprisingly cheap (less than $9) and easy to use. We create a simple IP camera that can be used to stream a live video feed using the 2MP camera module. We also try out the face detection and face recognition feature.

The video above covers everything you need in under 4 minutes.

Step 1: Configure The Arduino IDE

Board Settings Board Settings

We start by adding the ESP32 board support ofpackage to the Arduino IDE. The following links contain a detailed overview on what needs to be done:

In summary, you need to add the following link to the boards manager URL from the File menu.

https://dl.espressif.com/dl/package_esp32_index.json

Then, open up the boards manager, search for ESP32 and install the package. Wait for it to complete and close the window. Make sure you have selected the right board settings from the tools menu, as seen in the image. The COM port will not be available until you carry out the next step.

Step 2: Wire Up The Board

Board Board Wiring

Serial Output When In Download Mode Serial Output When In Download Mode

The ESP32-CAM board does not have an onboard USB connector so you need to use an external USB to serial converter to upload the sketch. You can use the wiring connections shown above but make sure that the USB to serial converter is connected in the 3.3V mode.

It is recommended to use an external 5V supply to power the board, particularly if you are using an FTDI breakout board. For the external 5V supply, a simple USB breakout board will do just fine. There has been some success in powering the board directly from the CP2102 breakout board so you can try that first. The board also has a 3.3V power pin if needed.

The jumper is needed to put the board in the download mode. Once you have everything connected, power up the board, open a serial terminal (Tools->Serial Monitor) with a baud rate of 115, 200 and press the reset button. You should obtain an output as shown in the image and this will indicate that everything is working as expected.

Step 3: Prepare The Sketch

Open Up The CameraWebServer Example Sketch Open Up The CameraWebServer Example Sketch

Add The Network SSID And Password Add The Network SSID And Password

Uncomment The Correct Camera Model Uncomment The Correct Camera Model

Serial Output With IP Address Serial Output With IP Address

Open up the CameraWebServer example sketch as shown in the image above. Make sure you add your WiFi network name and password as the board will have to connect to it. Also, be sure to select the AI_THINKER camera model as seen in the image. One this is done. Upload the sketch and then open the serial monitor again.

Give the board a few seconds to connect to the WiFi network and you will then see the connection status along with the IP address. Keep a note of this as we move to the next step.

Step 4: View Camera Stream

IP Camera Main Page IP Camera Main Page

Video Stream Video Stream

Open up a web browser and enter the IP address that was obtained in the previous step. You should obtain a page like the one in the image. Click the “START STREAM” button and you should be able to view the live stream. You change the resolution to something higher, depending on your needs. There are also a few settings and effects that you can play around with.

If you do get horizontal lines in the video feed, then this is an indication of insufficient power. Try using a shorter USB cable or an alternate power source in that case.

You can also obtain a still image, but since this is not stored anywhere, you will have to right-click and save it if required.

Step 5: Face Detection & Recognition

Face Detection Face Detection

Face Recognition (Unregistered) Face Recognition (Unregistered)

Face Recognition (Registered) Face Recognition (Registered)

In order for face detection to work, you would need to select a CIF or lower resolution. The board will process the video feed to detect a face and highlight it on screen. If you enable face recognition, then it will check to see if the face that is detected is known or enrolled, if not, it will tag it as an intruder. If you want to save a face then you can hit the enrol face button to register multiple samples that it will use as a reference.

That’s how easy it is to build a simple IP camera using the ESP32-CAM. The video quality is not excellent but they have really simplified the whole process of working with camera modules like this.

USB Power Hub for DIY Projects

This USB power hub that can be used to power passive devices like DIY projects and provides up to 3A of current.

Step 1: Watch The Video

This is a very simple DIY build but the video above talks about the choice of the voltage regulator (linear vs switching) used for this project and it also goes over the enclosure details. I’d recommend watching it to get a better understanding of how it all comes together.

Step 2: Gather The Electronics

Components/Modules Required Components/Modules Required

We need the following electronics to build this project:

  • 1x LM2596 DC-DC power module
  • 4x USB Type A breakout boards
  • 1x DC power connector
  • 1x DC power adaptor – 9V or above
Step 3: Connect & Adjust The Output Voltage

Ensure Output Voltage Is Set to 5V Ensure Output Voltage Is Set to 5V

We start by wiring the DC connector to the input of the LM2596 module. Keep a note of the polarity and then connect the power adaptor. The blue light should start glowing. Use a screwdriver to adjust the trim-pot and set the voltage to 5V.

Step 4: Decide On The Enclosure

Check Component Placement Check Component Placement

We then need to wire the USB breakout boards to the power module but before we do this, decide on the enclosure so that you can use the correct wire lengths. I designed a custom enclosure that holds all the electronics in a tight space, which is what I was going for.

Here’s the link to the model: https://www.thingiverse.com/thing:3971771

Step 5: Complete The Wiring & Test

Wire All USB Boards Wire All USB Boards

Wire The Power Module Wire The Power Module

Check Voltage Output At All Ports Check Voltage Output At All Ports

Then, wire up all the USB boards with the correct wire lengths. Then, power on the module and make sure you have 5V across all the USB ports with the correct polarity.

Step 6: Add The Electronics To The Enclosure & Seal

Glue All The Electronics In Place Glue All The Electronics In Place

Check That There Are No Shorts Check That There Are No Shorts

The next step is to add the electronics to the enclosure and seal it. I used hot glue to hold all the electronics in position. I then used the top half to close it. The enclosure should fit snugly as it has a lip and groove feature if not, you can also apply some glue before closing it.

Step 7: Use It & Share

Final Build Final Build

Split USB Cables Split USB Cables

Project Cost Project Cost

This is a handy power hub that I will be using frequently. I’ve added the approximate cost breakdown in case you need it. You can also add the split USB cables as seen above to power a total of 8 USB devices.

Online Weather Display Using OpenWeatherMap

Online Weather Display Online Weather Display
As a follow up to the room thermometer project, we write a sketch that communicates with an online weather service and displays the weather.

Step 1: Watch The Video

Since this project requires you to set up and obtain an API key along with other tasks, I would recommend you watch the video to get an understanding of how it all flows together. The video also breaks down the sketch to make it easier to understand.

Step 2: Download & Update The Sketch

Sketch Module Sketch Modules

The video covers this topic step-by-step but you need to obtain the API key from the OpenWeatherMap website in order to access the weather information. Once that is done, download the sketch and update it and don’t forget to update your city details.

Link To Sketch: https://www.bitsnblobs.com/wp-content/media/fw/diy/diy-e4.zip

Relevant Links:

Step 3: Wire Up The OLED Module & Upload

OLED Connections OLED Connections

Simply wire up the OLED module to the Nano 33 IoT board and upload the sketch.

Step 4: Share It with the World

Don’t forget to share this with us and the world by tagging us on social media. Also, don’t forget to subscribe to our channel to watch more videos and leave future build ideas while you’re at it

A Modular, USB Powered, Bluetooth Speaker System

A modular, UBS powered, bluetooth speaker system

We learn how to build a simple, yet very useful USB powered, Bluetooth speaker system that uses a modular enclosure.

Step 1: Watch the Video To Get An Overview Of The Build Process

This video will give you an overview of the entire build process, details about the enclosure and electronics involved. It would be advisable to watch it before you set out to build this speaker system.

Step 2: Gather All The Electronics

Electronics Layout Electronics Layout

I would strongly recommend you purchase the Bluetooth module and the amplifier as a combo like the one shown in the video as that will simplify the wiring for you. If you have previously purchased a BBox2 unit then you can use the electronics and speakers from there.

We will be using commonly available 2″ (51mm) full-range speaker drivers along with a microUSB breakout board for the input power. We also build a small filtering board consisting of a 100nF capacitor for filtering along with a 1000uF electrolytic capacitor which acts as a reservoir capacitor. The combo amplifier module that is available online works from a single, 5V supply so you do not need to add any more electronics to the filtering board. However, if you use the amplifier module from BBox2 then you will need to create a 3.3V power supply as well and we will be using the LD1117 linear regulator as the Bluetooth module does not draw a lot of power.

Step 3: Build The Filtering Board

5V Filtering Board Wiring 5V Filtering Board Wiring

5V Filtering Board 5V Filtering Board

5V & 3.3V Filtering Board Wiring 5V & 3.3V Filtering Board Wiring

5V & 3.3V Filtering Board 5V & 3.3V Filtering Board

The filtering board is optional but I recommend adding it as not all USB power supplies can deliver the frequent current bursts that are needed when playing low-frequency beats at high volumes. Once again, if you are using the off-the-shelf combo module then you only need the 5V section. If you are using the module from BBox2, then you will need to create the 3.3V section as well. Refer to the wiring images shown. Once the filtering section has been built, solder the USB breakout board to the input.

You can also add a switch to control the power to the system and there’s more information about this in the step about the enclosure.

Step 4: Wire It Together & Test

Combo Module Wiring Combo Module Wiring

BBox2 Module Wiring BBox2 Module Wiring

Testing The Setup Testing The Setup

Once you’ve created the power supply section, solder some wires to the speakers and start wiring it all together. When you first power on the system, the two LEDs will blink rapidly, indicating that it needs to be paired. Use a smartphone or computer to scan nearby devices and the Bluetooth module should show up as either the CSR8645 or the F-3188 module depending on the firmware loaded onto the actual Bluetooth module. Simply tap the name to pair and once paired, using the speakers is as simple as playing some audio. You can use the volume buttons from the phone to control the speaker volume but do keep in mind that you can also control the volume from the physical buttons themselves. If for some reason the speakers don’t sound loud enough then you can adjust the volume manually using the buttons.

Make sure everything works before moving on to the enclosure. Don’t worry about the sound quality as the enclosure plays a huge role in enhancing this as you will see later.

Step 5: Build An Enclosure

Example Cardboard Enclosure Example Cardboard Enclosure

Example Enclosure That Uses A Can Example Enclosure That Uses A Can

Making A Hole For The USB Board Making A Hole For The USB Board

Gluing The USB Board Gluing The USB Board

Final Left Speaker Section Final Left Speaker Section

I strongly recommend using an enclosure for this build as it enhances the final audio quality – both in terms of loudness and the actual tone. You do not have to 3D print an enclosure and you can also use a cardboard box or can as shown in the images.

If you decide to 3D print an enclosure, then here’s a link to a very nice one that I will be using: https://www.thingiverse.com/thing:2446587

I used an old soldering iron to make a hole in the amplifier enclosure and this is where I planned to mount the USB board. I used hot glue to support and hold it in place. Mounting the speakers was easy enough and I used version 1 of the speaker fascia as these were perfect for the speakers I had. I used 6×1/2″ or 3.5x13mm self-tapping screws to hold everything in place. The 3D model also had a small hole on the amplifier cover for a power switch and so I decided to add one. The switch sits in series, between the USB board and filtering board.

Step 6: Wire & Place The PCB Inside the Enclosure

Final Left Speaker Section Final Test

Final Build Final Build

Next, we need to wire it all again and then place the PCBs into the enclosure. I used double-sided tape to hold them in place. Once this is complete, you can power it up to make sure it works and then attach the amplifier cover using 4 more screws.

Step 7: Play Some Beats & Share It With All of Us!

Final Build Final Build

I don’t know about you but I was very excited when I built the first prototype using the Bluetooth module and that was even before I created this 3D printed version. In my opinion, this is definitely a very exciting build for anyone who wants to learn more about electronics. I hope everything worked together wonderfully and that you will continue building DIY projects like these.

Don’t forget to share this with us and the world by tagging us on social media. Also, don’t forget to subscribe to our channel to watch more videos and leave future build ideas while you’re at it 🙂

DIY Room Thermometer Using An OLED Module

DIY Room Thermometer Using An OLED Module
We learn how to build a room thermometer using the DS18B20 sensor and an OLED module.

Step 1: Watch The Video

The video contains all the information you need about the build and I highly recommend watching it first to give you an understanding of how it all comes together.

Step 2: Gather All The Components

This is a relatively simple build and you will need the following components:

  • An Arduino board – The Uno, Nano work fine and we will be using the Piksey Pico
  • A DS18B20 or DS18B20+ temperature sensor
  • 0.96″ OLED module
  • Logic level shifter module
Step 3: Program The Board & Test

Next, we need to upload the sketch to the board. You can also change thetime to icon being displayed if you want to do this. Now is also a good time to wire everything together, preferably on a breadboard to make sure it all works as expected. You can use the wiring diagram as a reference.

Wiring Layout Wiring Layout

Breadboard Testing Breadboard Testing

Link to final sketch: https://www.bitsnblobs.com/wp-content/media/fw/diy/diy-e1.zip

Step 4: 3D Print The Model

3D Printed Enclosure 3D Printed Enclosure

NOTE: This model was originally designed to only house the OLED module. I’ve managed to pack all the electronics within the same space by making some modifications to the Piksey Pico. Please watch the video for more information. If you are using an Arduino Nano or UNO then you will only be able to use this model to house the display and the electronics will have to be placed outside.

You can also print the stand if you will be using it. Keep in mind that it appears to be a bit delicate so you would need to be careful when handling it.

Link to 3D model: https://www.thingiverse.com/thing:2850845

Step 5: Wire It Up & Test

Mounting The microUSB Connector Mounting The microUSB Connector

Wiring The DS18B20 & Pull-Up Resistor Wiring The DS18B20 & Pull-Up Resistor

Making Sure It All Fits Making Sure It All Fits

Connecting The Two Halves Connecting The Two Halves

Final Test Before Assembly Final Test Before Assembly

Use your preferred method of wiring all the electronics in place. I’ve used multi-strand wire as that seems to work best. Please note that your final setup will look very different from mine depending on the modules you are using.

Make sure you carry out a final test to ensure that everything works as expected before you assemble it, which is the next step.

Step 6: Assemble It In Place

Final Build Final Build

Final Build With Stand Final Build With Stand

Finally, it’s time to assemble the two halves in place. Be careful not to apply excessive pressure to the OLED module as they are easy to crack and damage.

Step 7: Show It To The World By Sharing Your Build

Hopefully, everything worked like a charm in which case, congratulations as you’ve just made a room thermometer that you can be proud of!

Don’t forget to share this with us and the world by tagging us on social media. Also, don’t forget to subscribe to our channel to watch more videos and leave future build ideas while you’re at it 🙂

ESP32-CAM Getting Started – Mac

ESP32-CAM getting started - mac
Before you can start using the ESP32-CAM board (or similar ESP32 boards) with the Arduino IDE, you need to install the board support package which will enable the Arduino IDE to compile the sketches and upload them to the ESP32-CAM board. Doing this is very simple and we will cover that in this post.

Step 1: Install the latest Arduino IDE for your system. I’ll be using v1.8.10 for this post.

Visit the following link to download the latest version: https://www.arduino.cc/en/main/software

Step 2: Add the ESP32 URL to the boards manager.

To do this, open up the preferences window from the Arduino menu:

Open up the additional URLs window by clicking the icon shown below:

Add the following URL to the window. If you already have an existing URL, then simply add this to a new line, like below:
https://dl.espressif.com/dl/package_esp32_index.json

Step 3: Install the ESP32 Package

To do this, you need to open up the boards manager from the Tools menu and then search for “ESP32”.


Click the install button and wait for it to complete.


Once completed, you can then close the window and move to the next step.

Step 4: Wire up the board

You will need an external USB to serial converter to download code to the ESP32-CAM board. Please make sure you supply a steady 5V supply to the board and it is recommended to use a separate USB breakout board to supply the power. Using power from the FTDI (or similar) USB breakout board is known to cause issues depending on the setup.
ESP32-CAM Wiring For Sketch Upload

Step 5: Select the right board and settings

Use the following image as a reference. These are the options for the ESP32-CAM board and your port will vary depending on your computer system.

Step 6: Test the board

First, open up the WiFiScan example sketch which will simply scan available WiFi networks and display this on the serial port.

Make sure you have the boot jumper in place, then power up the board and press the reset button. This will put the board in the sketch upload mode. Hit the upload button and once this is complete, remove the jumper and press the reset button again. Finally, open up the serial monitor from the Tools menu. If everything works well, then you should be able to obtain an output similar to the one shown below. The WiFi network names will be different for you.

That’s it. You’ve successfully installed the ESP32 board and you can now start working with ESP32-CAM projects.

ESP32-CAM Getting Started – Windows

ESP32-CAM getting started - windows
Before you can start using the ESP32-CAM board (or similar ESP32 boards) with the Arduino IDE, you need to install the board support package which will enable the Arduino IDE to compile the sketches and upload them to the ESP32-CAM board. Doing this is very simple and we will cover that in this post.

Step 1: Install the latest Arduino IDE for your system. I’ll be using v1.8.8 for this post.

Visit the following link to download the latest version: https://www.arduino.cc/en/main/software

Step 2: Add the ESP32 URL to the boards manager.

To do this, open up the preferences window from the File menu:

Open up the additional URLs window by clicking the icon shown below:

Add the following URL to the window. If you already have an existing URL, then simply add this to a new line, like below:
https://dl.espressif.com/dl/package_esp32_index.json

Step 3: Install the ESP32 Package

To do this, you need to open up the boards manager from the Tools menu and then search for “ESP32”.


Click the install button and wait for it to complete.


Once completed, you can then close the window and move to the next step.

Step 4: Wire up the board

You will need an external USB to serial converter to download code to the ESP32-CAM board. Please make sure you supply a steady 5V supply to the board and it is recommended to use a separate USB breakout board to supply the power. Using power from the FTDI (or similar) USB breakout board is known to cause issues depending on the setup.
ESP32-CAM Wiring For Sketch Upload

Step 5: Select the right board and settings

Use the following image as a reference. These are the options for the ESP32-CAM board and your COM port will vary depending on your computer system.

Step 6: Test the board

First, open up the WiFiScan example sketch which will simply scan available WiFi networks and display this on the serial port.

Make sure you have the boot jumper in place, then power up the board and press the reset button. This will put the board in the sketch upload mode. Hit the upload button and once this is complete, remove the jumper and press the reset button again. Finally, open up the serial monitor.

If everything works well, then you should be able to obtain an output similar to the one shown below. The WiFi network names will be different for you.

That’s it. You’ve successfully installed the ESP32 board and you can now start working with ESP32-CAM projects.

ESP32-CAM

ESP32 Troubleshooting Guide

ESP32 troubleshooting guide
This post is dedicated to troubleshooting the common ESP32 errors that we will come across as we work with it.

1: “An error occurred while uploading the sketch. A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header”

This is the first error we encountered and it took us a while to figure out what was going wrong. We followed the wiring instructions online but most of the common ones that were available were incorrect and not reliable for some of the ESP32 boards, particularly the ESP32-CAM board.

If you get the error shown above then this is most likely due to incorrect wiring or insufficient power being applied to the board which is causing it to boot-loop or not power at all. If you are using the ESP32-CAM board, then please make sure that you wire the board as shown below and do not forget to connect the 5V power source to the 5V pin.

ESP32-CAM Wiring For Sketch UploadESP32-CAM Wiring For Sketch Upload

If the error persists then measure the voltage at the 5V pin as it has to be close to 5V, we noticed inconsistent operation when the supply voltage drops to even 4.7V. So make sure you have a good 5V power source or use a USB breakout board to obtain it. Using the power from the FTDI (FT232 or other USB-serial) breakout board also leads to the error shown above, on some boards. If you are sure about the 5V power then make sure you have wired the Tx and Rx pins correctly, try swapping them to check.

How To Check If The ESP32-CAM Is Working Correctly

The simplest way to make sure that you have the wiring and power required to upload code to the ESP32 board (ESP32-CAM in this case) is to wire it as following, in the boot mode and then open up the serial monitor with a baud rate of 115200.

ESP32-CAM Wiring For Sketch UploadESP32-CAM Wiring For Sketch Upload

Then, press the reset button and make sure you get output similar to the one shown below:

ESP32 Serial Output Sketch Upload Boot ModeESP32 Serial Output Sketch Upload Boot Mode

If you receive an output like this, then you can be sure that the Tx, Rx pins are connected correctly and that the board is safely powered ON. Once you upload the sketch and remove the boot-mode jumper, the output will change and it is recommended to keep the serial monitor open to view any errors or resets. If sufficient power is not available then the board will reset itself and throw a “Brownout detector was triggered” error to the serial terminal.