How to setup and use ESP32 Cam with Micro USB WiFi Camera

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome to a video tutorial from  Robojax my name is Ahmad Shamshiri   in this video I’m going to show you how to use  esp32 webcam over your wi-fi and show you how to   see the video on your mobile device I’m going  to show you how to enable also face detection I have a separate video introduced this esp32  camera which did not have uart or usb connectivity   so I showed so many methods and ways how  to upload your code to that camera module   but this module has everything combined  in it I’m going to show you step by step   how to use it this esp32 camera module sold on  AliExpress and amazon and many other websites   as ready with this package like this micro usb  connectivity with the chip so you can upload   your code without needing of any other external  source or power or usb so the module has the ch340   usb to UART connectivity module and then we have  five volts to 3.3 volts converter with these   two buttons and this is the actual camera module  some most of the sellers will allow you to select   wide or 15 degrees angle I did not select  the wide because it will distort the video   but also it comes with a micro SD card slot  where you can insert your micro z memory card   when you select a camera with  a different cameras you can so you can simply just pull  this with a small screwdriver   this black piece and once this is  opened you can remove the camera   easily and replace it with a different  camera a different angle if you prefer   this is a flash or led light that can be  used as flash on this side again we have this   power module 3.3 volts this is a extra memory  that is needed for this and that is the esp-32   module is the model is esp-32-l you might see  different models but this is sold like that   and you don't need any setting any connectivity  soldering or anything just put this on top of this   module and connect it to your usb if you have  windows 11 will recognize the driver for the   for this chip if it is not I will provide you  the link so you can install it below the video   but for windows 10 you might need to install the  driver I’m not sure depending on how updated your   computer so once you connect it this light will  turn on and usb is now connected and it's ready   here is the main repository from  the manufacturer of the chip the supported system on chip or soc these are  the chip esp32 esp32 s2 and s3 this provides   additional a few tools such as bmp and jpeg format  or one of them that it will allow for example this   model v6 2640 will have maximum resolution of  1600 by 1200 with this different type of lens and I will provide you the page that's the length  for this so you if you want to have a look at this   once you program this module then you don't  need this you can use it for other purpose   and you can connect five volts directly to this  five volts and ground pen I’ve already uploaded   the flash program so let me demonstrate it  to show you that this is 5 volts from a usb this is 5 volts that's ground and the flash is  running the program is turning it on and off   so it's fully functional and you can use the  pen for other purpose that you want most pens   are available if you want to use it for other  purpose but pen 21 and 22 which was needed for   c or I square c are not available and the same  with some other pens so they have randomly   selected certain pens based on the number you  can see which one is suitable for your need now let me show you some of the  components of this under the   magnifier this is the bottom  piece I’m going to show you this ch340c this is the usb driver where  you connect where you connect it to usb and this is the 6206a chip there is a data sheet for 6.206 this is a  positive voltage regulator maximum current   is 200 milliampere and it is 3.3 volts this  3 means 3 3 is for 3.3 volts for this module this is the memory of memory this is the 3.3 volts  regulator and that's the actual chip and here this   is for antenna you see this this is connecting  it to the antenna if you want to use external   antenna and if you want to use this external  antenna make sure to disconnect that piece this   this resistor use a soldering iron and remove this  this is just zero ohm resistor that is connecting   this piece to this piece to this side so just  remove it and use your external antenna here as   I’m preparing this make sure to hit the subscribe  button and also thumb up the video thank you first let's prepare this is Arduino ide  software that you get it from Arduino dot cc   this is a free software but we have to prepare  it to work with esp32 so this is the website I’ll   provide you the link we will grab this link here  if we click it will be copied come to Arduino ide   go to file preferences and here in this URL  area you can open it and then ctrl v paste it   now we have this line that is getting  the driver click and click ok now now that's done then we can go to tools  board and then go to board manager   wait for this until you can  type and here type esp32 it will bring you Espressif  system that's a cspst2 driver   for the board once we click it will install  the boards with all the required drivers and here it's installed and closed have  windows 11 and this is connected via usb   if I right click on the  start menu go device manager and under the com port you will see ch340  serial usb serial then this portion is done   to get started with a camera  click file examples come to esp32   and then camera web server  click and open it this is a file scroll down until you see camera  model ai thinker and make sure it's   not commented it might be like this so uncommented  and make sure everything else in this line   they have this forward slash so this means these  lines are not working only this line is active so   we are using the camera then we scroll down here  we set our ssid for your wi-fi make sure to type   it exactly as it is for example small or with  capital or is different and you will get error   and then type the password these quotations are  required so your password is inside the double   quotation if for some reason if you have double  quotation in your password and your password make   sure to put forward flash before it now we can  have double quotation in case if that happens   the rest we don't do anything here if I disconnect  it pay attention that this will disappear so the port the comport that we have now  no more available so if I connect it again   you will see the com ports and come on the  port number five is available for this purpose click on tools port and make sure  the same port that you saw there   is selected tools boards and go  to asp32 Arduino and scroll down until you see ai thinker esp32 cam so that's very important then this  is by default this value works   this 80 megahertz works this qio works I have not  changed them this make sure it is huge by default   it will be this value then the rest is exactly  the same and make sure the com port is the port   that you saw in the device manager once these are  all okay click on this button to upload now the   code is being uploaded and I’m increasing I’ve  increased the size so you can see what happens I’m not doing anything with the device just  holding it and the code is being uploaded until it reaches 100 percent so the code is completed wait for this hard  resetting via reset pen so now it has reseted the   device now we have to find out the ip address that  this one is acting now as a web server to do that   if you pay attention here the setup has hundreds  fifteen thousand two hundred so we are opening the we are opening now the serial monitor either  click on tools serial monitor or press ctrl   shift m or click on this icon and here this  will restore the web server for the camera now once the serial monitor is open  just press this reset button and see   we are reading this value and it says  wi-fi connected and that's the number   if you don't see the number for example if you set  it for some other value here at 9600 if I reset it wait it gets connected but you will not be able  to see the numbers make sure to select 115 000 200 and then reset it now it is connected so that is the ip 192168.0.1 this is important that you are your  laptop or computer that you are using is connected   to the same wi-fi as the device as you can see  here I’m connected to the wi-fi called ruby jacks   at the bottom so and my uh my camera is also  connected now because now I know the ip address   let's copy it I’m pressing ctrl c and let's  open a browser and then paste it and enter so   now when you see this screen it means everything  works properly and these are the settings   for the camera let me show you I’m  pressing ctrl plus to increase the size so xcl clock I’ve not changed anything   and this is the resolution we can change it later  to different value brightness and this is white   balance automatic white balance automatic white  balance gain these are the effects saturation   so all the values that you see have not changed  anything so far now I’m pressing ctrl 0 and   the rest of the settings so to see the video  just press start streaming and that's the video the video has started and it's showing me and as you can see the camera is  working so we can change the resolution to huge it will be much slower  but it will work and you will see   much better image with details  or even like that 800 by 600 so 240 this is for face detection and  let me show you the face detection so here face detection just  enable it once you enabled it   if you look at the camera it detects the face on computer also we can just click to toggle it and then we have face recognition face recognition  did not work with the options that I have   because the code was not  working but when you enable it   you could enroll a face and look  at this until it saves the face I’m just holding to see if it works which   is not working because I have glasses let  me remove the glasses and see if it can identifies as you can see it did not identify not work in my case and here we can click on save  to save as you can see it offers and a pop-up on   the screen so you can either open it that's the  image that's the resolution or you could save   it somewhere because that was so if I go to  for higher resolution 1600 and then save open hmm that was a portion of the screen for face detection it  recommends to use this format so when I use this then pixel  format one of them should be active   not the other one even if you leave  the first one the second one will be   replacing the first one so that's  the quality and let's upload this let's just open it and refresh I hope  that it will connect back to the same ip start streaming so this is working  now and let's enable face detection okay face detection worked listen  enable face recognition and let's enroll once that get enough you can see when I select different resolution  it doesn't work the reason for that is this   format that I’ve selected I’ve selected this format so let's reboot start streaming  now I can select larger frame size now let's stream it to the mobile device  doesn't matter which phone you have first   let's go to the settings go to the wi-fi  and make sure to connect to the same wi-fi   that you set within that code so mine is Robojax  I want to make sure that I’m connected to Robojax so this is connected and I know the ip address  already if you don't know it again just   open this serial monitor press  this reset button to see the ip let's open a browser and then create  new tab and then type this ip address 0 192.168.0.101 0 1 0 1 and press go or enter as you  can see now we see the streaming screen   and I’m not gonna change anything just select   start stream and the video will be below this  because the screen doesn't fit and here uh so I’m rotating the camera so  you can see me that's the video we can toggle this menu by clicking  on the toggle option at the top and if I go horizontal I can increase the  video size let's change it to 800 this was 320 now the picture is huge I can make it smaller to fit the screen and here this is the code that will turn on  and off the flash that is on the module so   we are defining a pen pin number four that's  the pen that is connected to the flash so we   are defining it as a variable and then in this  line which says this pen we set it as an output   after that we are when you turn it on we just send  height to that pen to this pen send high now flash   is on waits on for two seconds and then flash is  low which is turned off and keeps it off for two   seconds and because this is loop continuously  turns it on and off and that module is already   connected let me upload the code and here this  code is turning on and off the flash like this now I’m inserting the microSD card here  and let's open a program for microSD card   go to file examples and SD  MMC and this is for the test click and open it you don't need to do anything  everything is ready and upload the code   let me explain the code what it does so this this is a function  that does the list of the directory   create directory remove directory it  has all these read file write file append file this is when you append a text into  the already existing file rename file delete file   test file and out so and then inside the setup is  initial it checks if microSD card is not available   it will just stay car type so it checks it checks  the type of the car based on the type it detects so all the functions will run once at List  directory it creates a directory called mydir   and then less the directory so  it shows us that there is more   and then it removes the directory again  lists the directory and writes a file   called hello.txt inside it will be hello and  this appends this world into hello and then   reads the file transit on the screen deletes the  file foo rename the file so all these will be done make sure pay attention when this reaches 100 the  flash will blink and if I open the serial monitor you will see this and then let's open it just  reset it again so it showed all the files on   the microSD card because this is part of the  program it goes to every folder and less for us let's open it in my computer so here these are the two files foo it has  created hello world and then test which is empty   thank you for watching this was how to use  this esp32 camera if you learned something and   found this useful please thumb up and also make  sure to subscribe to my channel I appreciate it program set up the connectivity so the camera  can work and display the video over the wi-fi I’m   going to show you to use this URL to usb different  modules including ftdi or you can use your
Info
Channel: Robojax
Views: 170,966
Rating: undefined out of 5
Keywords: tutorial, training, video, robojax, download, driver, step by step, esp32, cam, camera, wifi, usb, how to, OV2640, bluetooth
Id: RCtVxZnjPmY
Channel Id: undefined
Length: 27min 6sec (1626 seconds)
Published: Wed Jul 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.