How to program ESP32cam with an Arduino UNO?
I recently bought an ESP32cam model from Banggood for a very low price at just $4. Well, that was an exiting deal and I knew it was certainly calling me to buy it. I have always wanted a portable streaming module with fewer wires and compact. Using OV7650 module is a mess with Arduino and damn! those wires look like they are inviting a spider within its mesh.
Here, have a gaze at the beautiful ESP32cam with Wifi and a low-quality camera.
Now run to your hobby store and grab an Arduino Uno. Yes, I didn't want to spend extra bucks for FTDI programmer. Better buy the Uno version with swappable IC as we have to remove the Atmel IC from it or else our programming will be a mess.
Open Arduino IDE. Click File and go to Preferences option. Then in the text are on the lower side of dialogue box where it says> Additional Board Managers URL, paste the following:https://dl.espressif.com/dl/package_esp32_index.json
Here is a screenshot of that.
Once done, click Tools> Boards> Board Manager and search for "esp32". Click on the latest version to install and wait for an eternity if your connection is poor. My version of ESP32 for this post was 1.0.2.
Once completed with the above installation, we can move ahead with the circuit section. Follow the below circuit "strictly". I'll explain the reason of being strict here. Remember to remove your Atmel IC from Arduino UNO.
After completing the circuit, head to Files> Examples> ESP32> Camera> CameraWebServer. Everybody's ESP32 can be different. I chose the model of AI Thinker. To know your model, check back on the metal casing of ESP32 to know your model.
In the code, add the SSID of the wifi you use with its password. ESP will connect with this wifi to stream video. Now connect your Arduino with the cable and check for the following settings.
- Board: ESP32 Wrover Module
- Flash Mode: QIO
- Flash Frequency: 40MHz
- Partition Scheme: Huge App (3MB No OTA)
- Upload Speed: 115200
- Core Debug Level: None
- Port: <Select the port connected to Arduino>
- Programmer: AVR ISP
Now HIT it!!! and upload the program. The window will show the program burning onto ESP as per below screenshot
Keep scrolling until you see 100%. A message will get printed on the console saying "Leaving Hard Resetting via RTS pin...". (In the circle in the above image). At this moment, remove the IO-0 pin from the ESP32cam and then open the serial monitor with baud rate at 115200. After opening the serial monitor click on the RESET button of your ESP32cam. A message will appear as per below image.
You will get the IP address of your WebStream. Copy the IP address and paste it on the address bar of any browser.
After resetting, you are getting a series of dots and the message "Wifi connected" is not getting displayed. In this case, change your wifi router with which ESP wants to connect. This is majorly because of the security issue. I use my mobiles HotSpot. Avoid iPhones here.
Brownout detector issue.
In the setup of your code, paste the following:
At the top include the below code:
If successful, you would get a window with the IP address like this below.
Enjoy your stream !!.