ESP32 Cam LED Blink

by Ramatronics Laboratory in Circuits > Microcontrollers

6448 Views, 9 Favorites, 0 Comments

ESP32 Cam LED Blink

WhatsApp Image 2023-04-03 at 10.17.33 PM.jpeg
WhatsApp Image 2023-04-04 at 10.18.46 AM (1).jpeg
WhatsApp Image 2023-04-04 at 10.18.45 AM.jpeg
WhatsApp Image 2023-04-04 at 10.18.00 AM.jpeg

INTRODUCTION:


Hello everyone!. Today I am going to introduce you about ESP32 Cam board which is an ESP32 board with on board camera(OV2640). This board is the best choice for making Face scanner, QR code scanner, web security camera and video streaming etc. There is an on board LED Flash light, so we can also take pictures if there is no light. The board also have a micro SD card slot, so we can store the captured pictures in the micro SD card. So I think that this cam board is really an awesome one to make lots of IOT, AI projects. But here I am going to make an LED Blink project with it because this is a basic introduction of ESP32 Cam module. The only think that we need to care about is that the ESP32 Cam board does not have any USB connector or USB to UART converter chip, So we also need an USB to UART converter to upload the the firmware and programs.

Supplies

WhatsApp Image 2023-04-04 at 10.18.46 AM (2).jpeg
WhatsApp Image 2023-04-03 at 10.17.32 PM (1).jpeg
WhatsApp Image 2023-04-03 at 10.17.33 PM (1).jpeg

List of Necessary Hardware:


https://quartzcomponents.com?sca_ref=3671286.DzEptz4I3w

ESP32 Camera board

https://quartzcomponents.com/products/esp32-camera-development-board-wifi-bluetooth-with-ov2640-camera-module?_pos=1&_sid=6fe191208&_ss=r

Bread Board

https://quartzcomponents.com/products/small-breadboard-mini-solderless-board?_pos=1&_sid=99de09b75&_ss=r

Jumper Wires

https://quartzcomponents.com/products/65pcs-breadboard-jumper-cable?_pos=9&_sid=7ef602f2e&_ss=r

FT232RL USB to UART Converter

https://quartzcomponents.com/products/ft232rl-usb-to-ttl-3-3v-5-5v-serial-adapter-module?_pos=1&_sid=aab1f797f&_ss=r

Micro-B USB Cable

https://quartzcomponents.com/products/arduino-nano-cable?_pos=3&_sid=1771b5758&_ss=r


https://www.amazon.in/?

ESP32 Cam Board

https://www.amazon.in/Electronics-ESP32-CAM-Bluetooth-Development-Camera/dp/B09PJKNCCD/ref=sr_1_4?crid=1JVMCFUVRWFK2&keywords=esp32+cam&qid=1680807775&sprefix=esp32%2Caps%2C380&sr=8-4

Bread Board

https://www.amazon.in/OLatus-Ol-Breadboard-Gl-Points-Solderless-Circuit/dp/B06XZ54VTN/ref=sr_1_14?crid=2XBBNXHFR94AM&keywords=bread+board&qid=1680807811&sprefix=bread+board%2Caps%2C364&sr=8-14

Jumper Wires (male to male)

https://www.amazon.in/REES52-75pcs-Jumper-wires-Solderless/dp/B01IMZ5VK8/ref=sr_1_9?crid=2RQR32JPGR86V&keywords=jum%5Ber+wires&qid=1680807845&sprefix=jumper+wire%2Caps%2C282&sr=8-9

FT232RL USB to UART Converter

https://www.amazon.in/Easy-Electroncis-FT232RL-Converter-Adapter/dp/B07F2FW34D/ref=sr_1_4?crid=3NSNB7LHTWGV0&keywords=ft232rl&qid=1680807878&sprefix=FT232%2Caps%2C266&sr=8-4

Micro-B USB Cable

https://www.amazon.in/Unbreakable-Charging-Transfer-Devices-MX-2107/dp/B08XW18D4P/ref=sr_1_22_sspa?crid=33MS76WJQM89Z&keywords=micro%2Bb%2Busb%2Bcable&qid=1680808012&sprefix=micro%2Bb%2Bus%2Caps%2C270&sr=8-22-spons&sp_csd=d2lkZ2V0TmFtZT1zcF9idGY&smid=A9ZK7QI498R39&th=1


SOFTWARE:

IDE needed to Uploading the sketch and firmware on ESP32 Cam board.

Download link is given below:

https://thonny.org/

Downloading the Firmware of ESP32 Cam Board

Before running the program we need to upload the new ESP32 Cam firmware on the board. You can download the firmware for ESP32 Cam using the link given below:

https://github.com/ramjipatel041/ESP32-Camera-module.git

Downloading the Driver for FT232RL Module

When we connect the FT232RL module to our laptop then if there is to driver installed on the compute then the computer does not recognize the USB port. We can also check it by opening the device manager on the computer. If our connected USB device(FT232RL) does not show then we need to download the driver for FT232 module. You can download the required driver by the link given below:

https://ftdichip.com/drivers/d2xx-drivers/

Making a Prototype Circuit on Bread Board

ESP32 Camera.jpg
WhatsApp Image 2023-04-03 at 10.15.24 PM.jpeg
WhatsApp Image 2023-04-03 at 10.17.32 PM.jpeg
WhatsApp Image 2023-04-03 at 10.17.33 PM.jpeg

Fix the camera module and and FT232 module on the breadboard as shown in my picture. Now connect the following pins with male to male jumper wires using the given wiring scheme:

3V3----------->VCC (Connect the 3V3 pin of camera module to VCC Pin of FT232 Board)

IO0---------->GND (Connect the IO0 pin of the camera module to GND pin of the camera module itself)

UOR---------->Tx (Connect the UOR pin of the camera module to Tx pin of the FT232 module)

UOT----------->Rx (Connect the UOT pin of the camera module to Rx pin of the FT232 module)

GND----------->GND (Connect the GND pin of the camera module to GND pi of the FT232 module)


Installing the Firmware on Camera Module

firmware.png
esp32.png
install firmware.png

After making the prototype circuit on the bread board we are ready to install the firmware, For that open the Thonny IDE on your laptop. click on 'tools' option and then select 'options...'. Again click on interpreter tab and now first we have to choose the interpreter. Since our camera module is an ESP32 board so we shall select the 'MicroPython(ESP32)'. In the last option we have to choose the comport of our FT232 module. After choosing the right comport.

Click on 'Install or update MicroPython' option and then again choose the right com port and the choose the location of the downloaded firmware and then click on 'install'. Now our firmware starts installing.

After completion of the installation process, remove the jumper wire connected between IO0 and GND pins so that our camera module will in normal mode.

Now you will be able to see MicroPython v1.14-122-g9fef1c0bd-dirty on 2021-03-30; Camera Module (i2s) with ESP32

Type "help()" for more information. in your shell area.

Type print('hello world!') in the shell are and then hit enter and then you just see the 'hello word!' replied by the ESP32. Perfect!. Now we are confirm that every thing is working.

Writing and Running a Blink Script

WhatsApp Image 2023-04-04 at 10.28.28 AM.jpeg
Micro python Blink script.

from machine import Pin
import utime

flash_led = Pin(4, Pin.OUT) # on board flash led is connected to GPIO-4 pin

while True:
  flash_led.off() #turns on the flash led
  utime.sleep(1)  #wait(delay) for one second
  flash_led.on()  #turns off the flash led
  utime.sleep(1)  #wait(delay) for one second


  

After running the above python program, the flash LED of the camera module starts blinking.