ESP32 Tutorial 42 - Taking Photo with Camera save on Micro SD CAM-1 | SunFounder's ESP32 kit

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hi. in this lesson we are going to use esp32  and esp32 extension board from SunFounder and   using the camera to take photo and store it in the  memory card connected the battery this is outside   on the street esp32 starter kit from Sounder this  is the best esp32 learning kit from SunFounder it   has this esp32 microcontroller which has built in  Wi-Fi and Bluetooth this board can do everything   Arduino Uno can do or many other Arduinos can do  plus extra more features because we have Wi-Fi and   Bluetooth the possibilities are endless you can  get connected to the cloud or do the control or   read information or values via your mobile device  or your desktop or over the cloud from a for location it comes with a camera extension  kit where you can stream the video over   Wi-Fi either through the cloud or to your  network and also it comes with micro SD   card where you can save images on the micro  SD card or you can write from the device any   information log the information on the device  and read it back you can power the board using   this included 18650 lithium battery and it has  built-in charger where you can connect micro USB   and charge the battery the kit comes with 320  pieces of component that you can learn tons of projects take photos by powering it up with this  uh battery and take it like a photo camera even   though the quality might not be as satisfying  as as your uh mobile phone but this is very   cheap camera uh with this kit it's uh acceptable I  believe now first let's invert this into the cord   so we are just pulling this we're just pulling  this up like this and because the metal connectors   are at the bottom this these shiny wires should  be facing down and the camera will be facing up so we just just insert it make sure it's  aligned up to this portion you see here it   should be almost equal to this and then press  it now the camera is facing up if I hold it the   camera is facing that way and then for the memory  Cur as I've explained it in previous lessons the   maximum capacity cannot exceed 32 gab so you can  use 32 or less and the all of these components   are included in the esp32 learning kit the  link to purchase is below this video in the description come to this page docs.sunFounder.com  scroll down until you see e32 then click on esp32   starter Main on the left side click on Arduino  user and then scroll down to 7.6 take photo SD   this is the documentation page where it where  it talks that we are going to take photo using   esp32 camera to take photo and store it on the  micro SD card we just need the esp32 and esp32   extension board like this and we are going  to insert the camera and Power It Up upload   the code which I'm going to explain it fully  and there are some settings which I'm going to   explain it step by step and then after taking  photo we will uh we will see the photos on the   uh on our computer and here are the explanation  for the code which I'm going to explain it in   the code section when we are saving photos the  photos will be numbered like this in in the root   and they will go from zero to 255 the reason  for that is that EEPROM is set to one bite and   that is 8 bit so 2 to the power 8 is 255 if  you want the photo numbers to increase just   change this to two or three which is within  the code and I'm going to show you camera   resolution depends on the model the model that  we have is ov2640 and the resolution is 1,600   by 1200 pixels and this is the length one of  over 4 in or quarter inch and there are other   versions as you can see even lower version  but it seems the highest resolution is this one over 5640 I'm opening Arduino IDE and let's  open our project by clicking on file open   on the left side click on downloads then  esp32 Starter kit main on the right side   double click to open it double click on C  double click on codes and scroll down to 7.6 here 7.6 take photo folder  double click to open it select   7.6 six take photo SD and click open to open it here we have included es32 camera Arduino file  system this is for SD card and this is also for   SD card uh this is for disable Browner problem  this three and then we have eome and here the   size is one so this one means the maximum number  goes to 255 and these are the pen definition for   camera AI thinker we are not going to change  them and all of these up to here and picture   number this is the initial value inside the setup  we set the right pre-registration this is for   brown out disabling and then we initialize  the serial monitor with 115,200 and we have   we have this variable called config camera  config and we are setting values and this has   uh these following properties so confect do LC  Channel Channel Zero LC timer and then all the   pens these are the defined pens the constant  that we are assigning so we are not going to   change it this is the clock frequency for the  microcontroller and this is the format for the   photo that we are taking and here is the document  documentation page where we set this value the   values could be uh y uv422 gray scale RGB or jpg  so we are setting it to this value these are all uppercase so this is a frame size  and we can have any of these that   we want so this is this is a compression of the JPEG and here we are setting the frame buffer  count to two so it says if PS Ram is found these   are the setting else these are the values that  are set initializing the camera so ESP camera   in it or initialize with a configuration which we  set and here all the configuration will be passed   and we check and the frame buffer is initially uh  defined as null and then when you take a picture   esp32 frame buffer get the value is here if the  buffer is not uh true or not available then we   get error print the error on the serial monitor  this is initializing the EO so we say eo. begin   and then EO size which we defined it one at  the top of the code and here then e read plus   one we we get the value and we increment it  so that will be our picture number and then   we we have to set the path this is a string plus  string picture number plus gpg so this will make   whatever is the picture name picture for example  2. gpg or whatever it is and this is our path for   the picture and here from SD MMC we are defining  uh this by reference as F so this file system is   created and we print the path as a C string on  the serial Monitor and then if open we create a   new file for the picture as a file and if there  is an issue we print the error otherwise we say   if a file right and then uh uh otherwise we set  the frame buffer and frame buffer length so one   is for the image the other is the length of size  of the image and it will be saved printed on the   screen that's the path so this is taking the  photo and saving it and this is printing it   with actual full path and name and this goes and  writes the picture number to the memory and then   it will say commit so this is taking the care  of the taking picture and closes it and then   esp32 frame buffer return this will return it  back now to uh eliminate the saturated color   the this portion have been added so there is a  for Loop that the picture will be taken starting   from Shoot zero to shoot number four one less  than five and so this four Loop runs up to here   you see this square bracket all the so this is  taking picture but only the fifth one will be saved now let's see how we can select the esp32  board we can click here under the select board and   type here esp32 D as soon as you type Dev you  will see Dev board you can selected and click   okay so the board have been selected now we have  to select the port the other way to select the   board is Click On Tools board esp32 and select  the esp32 dev module now we have to select the   port if I click here it shows two port and I don't  know which one belongs to my device sometimes you   will see you will not see the number properly  so the best way to be sure the right click on   the start menu go to to the device manager and  you will see here the ports if I click on this   Arrow it will show me the ports is USB serial  ch340 one the other is USB serial device and   there now it's connected if I disconnect this one  of them disappear the one that disappeared is my board so six stays and it disappeared if I connect it so it is my comport ch340 now it is my  comport and I can select it or I can click   on tool port and here you will see it you can  select whichever you want ours is com8 now we   have successfully selected the board and the  port and this is very important it must be done first and here's a demonstration I remove the  micro SD card and click to upload the code here so it's completed let's insert this and now let's let's take photo I am  facing it to the door side just pay attention here that was one photo and then let's do one more maybe facing this way let's remove this insert it to my computer and show you so picture 26 this was a picture and 27 let me show you the resolution I'm  right clicking selecting Properties or   Alt Enter and here you go to details  and you will see the resolution 1,600   by 1200 pixels and the depth B is 24  bits connected the battery let me go   outside and take some photos and let's  have a look at the photos that I've taken this was the previous  one this is outside on the street this seems saturated and as you can see when the   camera is shaking it will be  blurred so it should be very stable so these are photos
Info
Channel: Robojax
Views: 805
Rating: undefined out of 5
Keywords: robojax, sun, founder, sunfounder, course, tutorial, kit, learn, learning, step by step, esp32, arduino, iot, camera, esp32-cam, micro, sd, card, microSD, save, take, photo, picture, view, esp_camera, FS.h, SD_MMC.h, EEPROM.h
Id: 1Sjx9tDOF-k
Channel Id: undefined
Length: 15min 47sec (947 seconds)
Published: Wed Jan 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.