# Documentation MOOREV-Timer-Camera ScFo

**Information:**

Groupe de projet: L1 - Science Formelles Maths-Info - (février - avril 2023)

\- CHU Amélie <amelie.chu@etu.sorbonne-universite.fr>

\- SAE LIM Thierry thierry.sae\_lim@etu.sorbonne-universite.fr

\- PERRIN DE BRICHAMBAUT Jules [jules.perrin\_de\_brichambaut@etu.sorbonne-universite.fr](mailto:jules.perrin_de_brichambaut@etu.sorbonne-universite.fr)

**Contexte:**

Dans le cadre de notre projet d'ARE, nous nous focalisons sur la récolte de données images et vidéos d'espèces marines à l'aide de caméras et de capteurs.

**Objectif:**

Notre objectif est de concevoir un système autonome qui permet d'enregistrer ces données en profondeur sur une longue durée (plusieurs semaines à plusieurs mois), à faible coût et à faible consommation d'énergie.

Le but de ce tuto est de mettre en place un système autonome sous marin qui permet de prendre des données photos et vidéos d’espèces aquatiques sur une durée déterminée. Notre objectif est donc de finaliser un prototype peu coûteux et ayant une consommation d’énergie minimale.

**<u>Matériel:</u>**

<span style="font-weight: 400;">- GoPro Hero 3+S</span>

<span style="font-weight: 400;">- Adafruit ESP32 Feather \[0\]</span>

<span style="font-weight: 400;">- Arduino NANO</span>

<span style="font-weight: 400;">- Breadboard</span>

<span style="font-weight: 400;">- connecteur arrière de la caméra (connecteur herobus) modèle </span><span style="font-weight: 400;">DD1P030MA1</span>

<span style="font-weight: 400;">- Carte SD 64 Go (ou 32 Go)</span>

<span style="font-weight: 400;">- ESP32-Cam</span>

<span style="font-weight: 400;">- Multimètre (modèle utilisé TENMA 72-14620)</span>

**Le tuto se découpera en plusieurs parties:**

1. <span style="font-weight: 400;">IDE et programmation des microcontrôleurs</span>
2. <span style="font-weight: 400;">Réalisation de tests de consommations</span>
3. <span style="font-weight: 400;">Script de la GoPro</span>
4. <span style="font-weight: 400;">Assemblage du prototype</span>
5. <span style="font-weight: 400;">Alternative: ESP32-Cam</span>
6. <span style="font-weight: 400;">Références</span>

**Machines utilisées:**

**-** fer à souder

##### **1.TUTO: IDE et programmation des microcontrôleurs**

**Etape 1 :**

<span style="font-weight: 400;">On installe tout d’abord l’IDE Arduino (Integrated Development Environment) pour pouvoir programmer les scripts des deux cartes: </span>[<span style="font-weight: 400;">https://www.arduino.cc/en/software</span>](https://www.arduino.cc/en/software)<span style="font-weight: 400;"> \[1\] (lien pour le téléchargement).</span>

[![image-1684429458385.png](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/scaled-1680-/image-1684429458385.png)](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/image-1684429458385.png)

*Interface du logiciel en question*

<span style="font-weight: 400;">Une fois téléchargé, lancez l’application. En haut à gauche, choisir le microcontrôleur adapté (dans notre cas, il s’agit d’un Adrafruit ESP32 Feather, d’un ESP32-CAM ou d’un Arduino Nano). Sur la gauche, cliquer sur la deuxième icône ‘BOARDS MANAGER’ et rechercher ‘esp32’. Installer la plus récente version de la librairie ‘esp32’ par Expressif Systems. Cela permettra d’avoir la gestion pour programmer les ESP32.</span>

**Etape 2:**

<span style="font-weight: 400;"> </span><span style="font-weight: 400;">Nous allons maintenant écrire les scripts pour les deux cartes. Notre script va simuler une séquence où la carte allume une LED toutes les minutes pendant 5 secondes.</span>

<span style="font-weight: 400;">Le lien vers notre GitHub contient les scripts des deux cartes dans les deux fichiers ESP32 et Arduino \[2\] :</span>

[<span style="font-weight: 400;">https://github.com/ursusnocte/ARE\_Curious\_Info-Moorev-Timer-Camera</span>](https://github.com/ursusnocte/ARE_Curious_Info-Moorev-Timer-Camera)<span style="font-weight: 400;"> \[3\]</span>

<span style="font-weight: 400;">Pour transmettre les fichiers, relier la carte à l’ordinateur, sélectionner le port COM de la carte, et cliquer en haut à gauche sur le bouton flèche ‘upload’. Pour chaque modification du script, il faudra réitérer cette opération.</span>

#####  

##### **2.TUTO: Réalisation de tests de consommations**

#####   


<span style="font-weight: 400;">On réalise maintenant les tests de consommations. Pour cela, nous allons utiliser le multimètre. Nous souhaitons récolter les données.</span>

**Etape 1: installation du logiciel**

 <span style="font-weight: 400;">En fonction du multimètre utilisé, la fonctionnalité peut ne pas être disponible. Il faudra alors noter manuellement les données. Dans le cas contraire, installer le logiciel associé. Dans notre cas avec ce modèle, installer le logiciel à l’aide du CD fourni avec le manuel d’utilisation. Lancer le logiciel puis brancher l’ordinateur au multimètre.</span>

<span style="font-weight: 400;">Modèle du multimètre utilisé dans notre cas : TENMA 72-14620</span>

<span style="font-weight: 400;">- Installer sur l’ordinateur le modèle du multimètre correspondant au modèle</span>

<span style="font-weight: 400;">- Connecter l’ordinateur et l’appareil grâce au câble fourni avec l‘appareil</span>

<span style="font-weight: 400;">- Régler le logiciel sur la connexion via USB, l’enregistrement est prêt à démarrer avec le bouton «Démarrer».</span>

<span style="font-weight: 400;">- Différentes options sont disponibles une fois l'enregistrement terminé: enregistrer les données dans un fichier ou les imprimer.</span>

[![image-1684429581795.png](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/scaled-1680-/image-1684429581795.png)](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/image-1684429581795.png)

[<span style="color: #000000;">*Inteface du logiciel*</span>](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/image-1684429581795.png)

**Etape 2: Branchement**

 <span style="font-weight: 400;">Nous allons réaliser un branchement pour alimenter les cartes et mesurer les consommations. On enfiche les cartes sur une breadboard, puis on les alimente avec un générateur réglé sur 5V. On n’oublie pas le multimètre dans le branchement.</span>

<span style="font-weight: 400;">On alimente les cartes et on récolte les données sur une durée de 3 séquences, soit environ 3 minutes afin d’avoir une moyenne à la fin. On enregistre le fichier sous forme Excel (ou autre format).</span>

<span style="font-weight: 400;">Afin de d’alimenter les cartes pour réaliser les mesures de l’intensité utilisé, on connecte une source en +5V sur le pin 5V et la masse sur le pin GND de l’arduino Nano \[4\].</span>

<span style="font-weight: 400;">Pour l’ESP32 (avec une carte Adafruit HUZZAH32 - ESP32 Feather), connecter la broche USB au 5V et la masse à la broche GND \[5\].</span>

<span style="font-weight: 400;">Ne pas oublier de brancher le multimètre en série du microcontrôleur et de ne pas utiliser le port USB des cartes arduino ou ESP32 lors des mesures (sous risques d'endommager l'appareil branché en USB) !</span>

 [![arduinof.jpg](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-03/scaled-1680-/hR7arduinof.jpg) ](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-03/hR7arduinof.jpg) [![branchement.jpg](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-03/scaled-1680-/Zg3branchement.jpg)](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-03/Zg3branchement.jpg)

*<span style="font-weight: 400;">Branchements et circuit réalisés</span>*

On récolte les données de consommation pour les deux cartes à l'aide du logiciel sur ordinateur.

**Etape 3: analyse des données**

 <span style="font-weight: 400;">Nous analysons ensuite les données en utilisant les bibliothèques python Pandas et Matplotlib avec Python. </span>

<span style="font-weight: 400;">Pour pouvoir exploiter le fichier Excel sous Python, il ne faut pas oublier de remplacer les «,»</span>

<span style="font-weight: 400;"> par des «.».</span>

<span style="font-weight: 400;">Le fichier qui nous a permis de faire le graphique est disponible sur le GitHub sous le nom de «plot\_conso» \[3\].</span>

[![graphe.png](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-03/scaled-1680-/4FIgraphe.png)](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-03/4FIgraphe.png)

On observe que l'Arduino Nano consomme moins que l'ESP32. Les pics de chaque lignes correspondent à l'allumage de la LED de chaque carte, et l'espace entre chaque pic correspond au mode veille. L'Arduino semble le mieux adapté en terme de consommation.

<table border="1" id="bkmrk-%C2%A0-arduino-esp32-mean" style="border-collapse: collapse; width: 103.086%; height: 270.729px;"><tbody><tr style="height: 29.4583px;"><td style="width: 27.1829%; height: 29.4583px;">  
</td><td style="width: 40.2801%; height: 29.4583px;">**Arduino**  
</td><td style="width: 32.4959%; height: 29.4583px;">**ESP32**</td></tr><tr style="height: 29.4583px;"><td style="width: 27.1829%; height: 29.4583px;">**mean**</td><td style="width: 40.2801%; height: 29.4583px;"><span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">6.1727 mA</span></td><td style="width: 32.4959%; height: 29.4583px;"><span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">10.5101 mA</span></td></tr><tr style="height: 29.4583px;"><td style="width: 27.1829%; height: 29.4583px;">**standard deviation**</td><td style="width: 40.2801%; height: 29.4583px;">4.6997<span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">  
</span></td><td style="width: 32.4959%; height: 29.4583px;">11.8473 <span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">  
</span></td></tr><tr style="height: 29.4583px;"><td style="width: 27.1829%; height: 29.4583px;">**total time**</td><td style="width: 40.2801%; height: 29.4583px;"><span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">5.0 min 18.0 s</span></td><td style="width: 32.4959%; height: 29.4583px;"><span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">5.0 min 0.0 s</span></td></tr><tr style="height: 35.0625px;"><td style="width: 27.1829%; height: 35.0625px;">**total time consumption**</td><td style="width: 40.2801%; height: 35.0625px;">2981.44 mA

</td><td style="width: 32.4959%; height: 35.0625px;"><span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">4792.6 mA</span></td></tr><tr style="height: 29.4583px;"><td style="width: 27.1829%; height: 29.4583px;">**average consumption**</td><td style="width: 40.2801%; height: 29.4583px;"><span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">22.2219 mW/h</span></td><td style="width: 32.4959%; height: 29.4583px;"><span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">37.8363 mW/h</span></td></tr></tbody></table>

**Etape 4: soudure des fils**

<span style="font-size: 11pt; font-family: Calibri,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Nous avons choisi de contrôler la caméra via le connecteur arrière \[6\] qui permet d’avoir accès à une grande partie des fonctionnalités. Pour utiliser notre connecteur, il nous faut souder des fils dessus.</span>

**[![image-1684430450355.jpg](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/scaled-1680-/image-1684430450355.jpg) ](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/image-1684430450355.jpg)** [![image-1684430506024.jpg](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/scaled-1680-/image-1684430506024.jpg)](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/image-1684430506024.jpg)

<span style="font-size: 11pt; font-family: Calibri,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Les 30 fils de couleurs différentes</span><span style="font-size: 11pt; font-family: Calibri,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-size: 11pt; font-family: Calibri,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-size: 11pt; font-family: Calibri,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Les pins du connecteur</span>

<span style="font-size: 11pt; font-family: Calibri,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">afin que l’on puisse distinguer les pins</span>

<span style="font-size: 11pt; font-family: Calibri,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-size: 11pt; font-family: Calibri,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">adjacentes </span>

 <span style="font-weight: 400;">Nous allons souder les 30 pins. Il est possible pour plus de facilité de ne souder que les pins concernés, mais le tuto se reposera sur les 30 pins \[7\]. </span>

<span style="font-weight: 400;">- Couper et dénuder 30 fils</span>

<span style="font-weight: 400;">- Chauffer les fers à souder à 350° (pas trop sinon l’étain fond mal)</span>

<span style="font-weight: 400;">- Prendre le fer à souder et plaquer fermement le fil au pin, puis approcher l’étain pour le faire fondre grâce au flux.</span>

[ ](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-04/fils.jpg)[ ![soudage.jpg](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-04/scaled-1680-/soudage.jpg)](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-04/soudage.jpg)

*Brasure de deux pins adjacentes*

##### **3.TUTO: Script de la GoPro**

<span style="font-weight: 400;"> </span><span style="font-weight: 400;">La GoPro Hero 3+S a pour avantage de pouvoir lancer un script présent sur la carte SD dès son allumage. Nous allons configurer la caméra et écrire le script.</span>

<span style="font-weight: 400;">[![GoPro.jpg](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/scaled-1680-/gopro.jpg)](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/gopro.jpg)</span>

**Etape 1:**

 <span style="font-weight: 400;">Allumer la caméra et se rendre dans les paramètres. Chercher l’option «One Button» et la configurer sur OFF. </span>

<span style="font-weight: 400;">Configurer au passage la résolution souhaitée pour les photos et vidéos</span>

**Etape 2:**

<span style="font-weight: 400;">Pour le script de la GoPro, il faut enregistrer le fichier sous extension “.ash” . Il est disponible sur notre GitHub \[4\]. Le script que nous avons écrit permet de prendre une vidéo et trois photos avant de redémarrer. Disposer de ce script dans la racine de la carte SD/créer un dossier AUTOEXEC qui contiendra le fichier \[8\]. Enregistrer le fichier sous le nom «autoexec.ash»</span>

<table id="bkmrk-commandes-utilisatio" style="width: 100%; height: 242.5px;"><tbody><tr style="height: 35.0625px;"><td style="width: 20.6179%; height: 35.0625px;"><span style="font-weight: 400;">Commandes</span>

</td><td style="width: 79.2792%; height: 35.0625px;"><span style="font-weight: 400;">Utilisation</span>

</td></tr><tr style="height: 35.0625px;"><td style="width: 20.6179%; height: 35.0625px;"><span style="font-weight: 400;">sleep x</span>

</td><td style="width: 79.2792%; height: 35.0625px;"><span style="font-weight: 400;">Rendre la caméra inactive pendant x secondes. Temps d’attente</span>

</td></tr><tr style="height: 57.4583px;"><td style="width: 20.6179%; height: 57.4583px;"><span style="font-weight: 400;">t app appmode video</span>

</td><td style="width: 79.2792%; height: 57.4583px;"><span style="font-weight: 400;">Passage en mode vidéo de la caméra</span>

</td></tr><tr style="height: 57.4583px;"><td style="width: 20.6179%; height: 57.4583px;"><span style="font-weight: 400;">t app appmode photo</span>

</td><td style="width: 79.2792%; height: 57.4583px;"><span style="font-weight: 400;">Passage en mode photo</span>

</td></tr><tr style="height: 57.4583px;"><td style="width: 20.6179%; height: 57.4583px;"><span style="font-weight: 400;">t app button shutter PR</span>

</td><td style="width: 79.2792%; height: 57.4583px;"><span style="font-weight: 400;">Enclenchement du bouton déclencheur pour prendre une photo, prendre une vidéo/arrêter une vidéo</span>

</td></tr></tbody></table>

<span style="font-weight: 400;">Il est intéressant de programmer les séquences en tenant en compte de la batterie et de la capacité de stockage de la carte SD. Pour la GoPro Hero3+S, nous disposons de 64G et d’une batterie d’environ 10 000A. En prenant en compte la taille d’une photo (12MPX) et d’une seconde de vidéo (en 1080p), on peut calculer combien de temps peut tenir notre prototype.</span>

<table border="1" id="bkmrk-taille-en-ko-1-photo" style="border-collapse: collapse; width: 100%; height: 58.9166px;"><tbody><tr style="height: 29.4583px;"><td style="width: 33.3051%; height: 29.4583px;">Taille en ko</td><td style="width: 33.3051%; height: 29.4583px;">1 photo </td><td style="width: 33.3077%; height: 29.4583px;">vidéo (1 sec)</td></tr><tr style="height: 29.4583px;"><td style="width: 33.3051%; height: 29.4583px;">GoPro Hero 3+S</td><td style="width: 33.3051%; height: 29.4583px;">4000</td><td style="width: 33.3077%; height: 29.4583px;">5000</td></tr></tbody></table>

<span style="font-weight: 400;">On calcule ainsi par approximation le nombre de jour que nous pouvons tenir sous l’eau tout en enregistrant des données avec la formule:</span>

<span style="font-weight: 400;">(Capacité de la carte SD) / ( (nombre de photos par jour)\*(taille d’une photo) + (temps de vidéo en seconde par jour)\*(taille d’une seconde de vidéo) )</span>

<span style="font-weight: 400;">Le calcul peut se faire sur une durée d’un mois ou bien d’un an.</span>

<span style="font-weight: 400;">Par exemple, pour 10 secondes de vidéos et 24 photos par jour, cela nous fait:</span>

<span style="font-weight: 400;">64000000/(24\*40000 + 10\*5000) = 438,36 soit environ 438 jours, équivalent à environ 14 mois.</span>

<span style="font-weight: 400;">Il est aussi possible de calculer la durée en fonction de la consommation de la caméra \[9\].</span>

##### **4.TUTO: Assemblage du prototype**

 <span style="font-weight: 400;">Maintenant que nous disposons de tous les éléments dont nous avons besoin, nous pouvons brancher le tout. On branche à l’Arduino NANO sur le pin A0 et le pin GND aux pins de la masse et du bouton d’alimentation (respectivement le pin 30 et le pin 19) \[10\].</span>

<span style="font-weight: 400;">Grâce au programme écrit pour l’Arduino NANO, nous avons programmé des séquences d’allumage de la caméra. Nous avons maintenant une caméra qui prend trois photos toutes les 30 secondes dix fois de suite.</span>

[![branchementfinal.jpg](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-04/scaled-1680-/branchementfinal.jpg)](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-04/branchementfinal.jpg)

*Montage de la Gopro relié à l'Arduino Nano*

##### **5. Alternative: ESP32-Cam** 

**[![esp32cam.jpg](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/scaled-1680-/esp32cam.jpg)](https://wiki.fablab.sorbonne-universite.fr/BookStack/uploads/images/gallery/2023-05/esp32cam.jpg)**

 *ESP32-Cam*

<span style="font-weight: 400;">Pour utiliser une carte SD avec un ESP32-CAM, il est nécessaire de la formater en FAT32 (Attention, même si la carte SD fait plus de 4Go, l’ESP32-CAM ne sait pas gérer plus avec le port intégré)</span>

<span style="font-weight: 400;">Programmation d’une séquence de test pour l’ESP32-CAM : </span>

<span style="font-weight: 400;">- Connexion de l’ESP32-CAM avec une cable usb-ttl à l’ordinateur :</span>

<span style="font-weight: 400;">o Broche rx sur u0t</span>

<span style="font-weight: 400;">o Broche tx sur u0r</span>

<span style="font-weight: 400;">o GND sur GND</span>

<span style="font-weight: 400;">o 5v sur 5v</span>

<span style="font-weight: 400;">o Relier les broches IO0 et GND</span>

<span style="font-weight: 400;">Dans le menu de sélection de la carte, choisir la carte “AI-Thinker ESP32-CAM” et le </span><span style="font-weight: 400;">port COM sur lequel est connecté l’ESP32.</span>

<span style="font-weight: 400;">Récupérer le code disponible pour prendre une photo:</span>

[<span style="font-weight: 400;">https://github.com/ursusnocte/ARE\_Curious\_Info-Moorev-Timer-Camera/blob/main/ESP32/ESP32\_CAM\_test\_photo/ESP32\_CAM\_test\_photo.ino</span>](https://github.com/ursusnocte/ARE_Curious_Info-Moorev-Timer-Camera/blob/main/ESP32/ESP32_CAM_test_photo/ESP32_CAM_test_photo.ino)<span style="font-weight: 400;"> </span>

<span style="font-weight: 400;">ou un équivalent de vidéo, en réalité plusieurs photos par secondes:</span>

[<span style="font-weight: 400;">https://github.com/ursusnocte/ARE\_Curious\_Info-Moorev-Timer-Camera/blob/main/ESP32/ESP32\_CAM\_test\_video/ESP32\_CAM\_test\_video.ino</span>](https://github.com/ursusnocte/ARE_Curious_Info-Moorev-Timer-Camera/blob/main/ESP32/ESP32_CAM_test_video/ESP32_CAM_test_video.ino)<span style="font-weight: 400;"> </span>

<span style="font-weight: 400;">Après cela, il ne reste plus qu’à téléverser le code sur l’ESP32-CAM, si la connexion ne s’effectue pas directement, appuyer sur le bouton de reset du microcontrôleur.</span>

<span style="font-weight: 400;">Afin d’afficher les messages envoyées par la carte en débug, ouvrir la console série intégrée de l’IDE et choisir une vitesse de transfert de 115200. </span>

<span style="font-weight: 400;">Le code pour photo réalise une photo à chaque allumage ou redémarrage de la carte et celui-ci pour la “vidéo” prend 10 images par secondes dans la configuration actuelle jusqu’au débranchement de la carte.</span>

<span style="font-weight: 400;">Pour comprendre plus en détail le fonctionnement des scripts, je vous conseille l’article sur l’ESP32-CAM en référence \[11\]. </span>

##### **6. Références:**

<span style="font-weight: 400;">Référence de l’ESP32:</span>

<span style="font-weight: 400;">\[0\] </span>[<span style="font-weight: 400;">https://www.adafruit.com/product/3405</span>](https://www.adafruit.com/product/3405)

<span style="font-weight: 400;">Téléchargement de l’IDE:</span>

<span style="font-weight: 400;">\[1\] </span>[<span style="font-weight: 400;">https://www.arduino.cc/en/software</span>](https://www.arduino.cc/en/software)

<span style="font-weight: 400;">Référence sur les modes de l’ESP32 pour le code:</span>

<span style="font-weight: 400;">\[2\] </span>[<span style="font-weight: 400;">https://letmeknow.fr/fr/blog/142-tutoriel-les-sleep-modes-de-lesp32</span>](https://letmeknow.fr/fr/blog/142-tutoriel-les-sleep-modes-de-lesp32)

<span style="font-weight: 400;">Lien vers notre GitHub:</span>

<span style="font-weight: 400;">\[3\] </span>[<span style="font-weight: 400;">https://github.com/ursusnocte/ARE\_Curious\_Info-Moorev-Timer-Camera</span>](https://github.com/ursusnocte/ARE_Curious_Info-Moorev-Timer-Camera)<span style="font-weight: 400;"> </span>

<span style="font-weight: 400;">Lien pour alimentation de l’Arduino:</span>

<span style="font-weight: 400;">\[4\]</span>[<span style="font-weight: 400;">https://idehack.com/alimenter-larduino-nano/</span>](https://idehack.com/alimenter-larduino-nano/)

<span style="font-weight: 400;">Lien pour branchement ESP32:</span>

<span style="font-weight: 400;">\[5\] </span>[<span style="font-weight: 400;">https://learn.adafruit.com/adafruit-huzzah32-esp32-feather/power-management</span>](https://learn.adafruit.com/adafruit-huzzah32-esp32-feather/power-management)

<span style="font-weight: 400;">Lien vers le modèle du connecteur Herobus:</span>

<span style="font-weight: 400;">\[6\] </span>[<span style="font-weight: 400;">https://www.digikey.fr/en/products/detail/jae-electronics/DD1P030MA1/1283154</span>](https://www.digikey.fr/en/products/detail/jae-electronics/DD1P030MA1/1283154)

<span style="font-weight: 400;">Lien vers les descriptions des pins du connecteur arrière de la caméra:</span>

<span style="font-weight: 400;">\[7\] </span>[<span style="font-weight: 400;">https://mewpro.cc/en/2014/10/14/herobus-pinout-of-gopro-hero-3-black/</span>](https://mewpro.cc/en/2014/10/14/herobus-pinout-of-gopro-hero-3-black/)

<span style="font-weight: 400;">Référence autoexec scripts:</span>

<span style="font-weight: 400;">\[8\] </span>[<span style="font-weight: 400;">https://github.com/KonradIT/autoexechack</span>](https://github.com/KonradIT/autoexechack)

<span style="font-weight: 400;">Lien vers les informations concernant le connecteur herobus:</span>

<span style="font-weight: 400;">\[10\] </span>[<span style="font-weight: 400;">https://github.com/KonradIT/gopro-herobus-sdk/blob/master/diyprojects.md</span>](https://github.com/KonradIT/gopro-herobus-sdk/blob/master/diyprojects.md)

<span style="font-weight: 400;">Lien vers le site de Camdo sur la batterie des caméras:</span>

<span style="font-weight: 400;">\[9\] </span>[<span style="font-weight: 400;">https://cam-do.com/pages/power-consumption-by-gopro-camera-model</span>](https://cam-do.com/pages/power-consumption-by-gopro-camera-model)

<span style="font-weight: 400;">Lien vers l’article sur l’ESP32-Cam :</span>

**<span style="font-weight: 400;">\[11\] </span>[<span style="font-weight: 400;">https://randomnerdtutorials.com/esp32-cam-take-photo-save-microsd-card/</span>](https://randomnerdtutorials.com/esp32-cam-take-photo-save-microsd-card/))**