ESP32 Cam LED Blink
by Ramatronics Laboratory in Circuits > Microcontrollers
6783 Views, 9 Favorites, 0 Comments
ESP32 Cam LED Blink
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
List of Necessary Hardware:
https://quartzcomponents.com?sca_ref=3671286.DzEptz4I3w
ESP32 Camera board
Bread Board
Jumper Wires
https://quartzcomponents.com/products/65pcs-breadboard-jumper-cable?_pos=9&_sid=7ef602f2e&_ss=r
FT232RL USB to UART Converter
Micro-B USB Cable
https://quartzcomponents.com/products/arduino-nano-cable?_pos=3&_sid=1771b5758&_ss=r
ESP32 Cam Board
Bread Board
Jumper Wires (male to male)
FT232RL USB to UART Converter
Micro-B USB Cable
SOFTWARE:
IDE needed to Uploading the sketch and firmware on ESP32 Cam board.
Download link is given below:
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:
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:
Making a Prototype Circuit on Bread Board
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
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
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.