amc:ss2023:group-y:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
amc:ss2023:group-y:start [2023/07/24 10:19] – [4.Results and Discussion] hoi-fung.sam | amc:ss2023:group-y:start [2023/07/24 14:49] (current) – [2.1.3 Adafruit Universal USB / DC / Solar Lithium Ion/Polymer charger - bq24074] hoi-fung.sam | ||
---|---|---|---|
Line 4: | Line 4: | ||
=====1.Introduction ===== | =====1.Introduction ===== | ||
====Aim of the project: | ====Aim of the project: | ||
- | In this project, we are going to make a house for chickens in order for scientists to study their living habits. The basic idea of this chickens’ house is to first, capture motion of the chicken by PIR motion sensor. Second, | + | In this project, we are going to make a house for chickens in order for scientists to study their living habits. The basic idea of this chickens’ house is to first, capture motion of the chicken by PIR motion sensor. Second, |
=====2.Methods and Materials===== | =====2.Methods and Materials===== | ||
====2.1 Materials: | ====2.1 Materials: | ||
- | - breadboard | + | - Breadboard |
- | - female jumper wires | + | - Jumper |
- | - male to female jumper | + | |
- HC-SR501 PIR Sensor | - HC-SR501 PIR Sensor | ||
- ESP32-camera | - ESP32-camera | ||
- | - FTDI programmer | + | - UartSBee V5 (FTDI programmer) |
- solar panel | - solar panel | ||
- battery | - battery | ||
Line 47: | Line 46: | ||
The ESP32-CAM is a popular development board designed for applications requiring a camera module. It includes multiple data pins, a combined Wi-Fi and camera module, and a microSD card slot for easy storage. In this project we mainly use the Wi-Fi function and following pins: Power Pins (5V, 3.3V and GND), general purpose input/ | The ESP32-CAM is a popular development board designed for applications requiring a camera module. It includes multiple data pins, a combined Wi-Fi and camera module, and a microSD card slot for easy storage. In this project we mainly use the Wi-Fi function and following pins: Power Pins (5V, 3.3V and GND), general purpose input/ | ||
====2.1.3 Adafruit Universal USB / DC / Solar Lithium Ion/Polymer charger - bq24074==== | ====2.1.3 Adafruit Universal USB / DC / Solar Lithium Ion/Polymer charger - bq24074==== | ||
+ | The micro lipo charger is designed to charge Lithium Polymer or Lithium Ion (LiPoly/ | ||
+ | The Micro-Lipo charger is charged in three stages. Firstly, pretreatment charging, then constant current fast charging, and finally constant voltage trickle charging. The charger has a 0.1-inch connector, D+ and D- data lines, 100mA charging current, which can be adjusted to 500mA by soldering off the jumper. | ||
+ | |||
====2.2 Method:==== | ====2.2 Method:==== | ||
====2.2.1 Wire connection to upload the code==== | ====2.2.1 Wire connection to upload the code==== | ||
Line 83: | Line 85: | ||
====2.2.4 Wire connection in operation==== | ====2.2.4 Wire connection in operation==== | ||
+ | **ESP32CAM - Breadboard**\\ | ||
+ | 5V - positive rail of the breadboard\\ | ||
+ | GND - negative rail of the breadboard\\ | ||
+ | |||
+ | **ESP32CAM - PIR**\\ | ||
+ | GPIO12 - OUT\\ | ||
+ | |||
+ | **PIR - Breadboard**\\ | ||
+ | VCC - positive rail of the breadboard\\ | ||
+ | GND - negative rail of the breadboard\\ | ||
+ | |||
+ | **Lithium Ion/Polymer charger - Breadboard**\\ | ||
+ | LiPo - positive rail of the breadboard\\ | ||
+ | GND - negative rail of the breadboard\\ | ||
+ | {{: | ||
=====3.Code===== | =====3.Code===== | ||
References for this project are from:\\ | References for this project are from:\\ | ||
Line 121: | Line 138: | ||
| | ||
*/ | */ | ||
- | #define emailSenderAccount | + | #define emailSenderAccount |
#define emailSenderAppPassword | #define emailSenderAppPassword | ||
#define smtpServer | #define smtpServer | ||
Line 448: | Line 465: | ||
===Import the libraires=== | ===Import the libraires=== | ||
A library is a collection of pre-written code and functions that provide additional functionality to the Arduino sketches.\\ | A library is a collection of pre-written code and functions that provide additional functionality to the Arduino sketches.\\ | ||
- | **ESP32_MailClient.h** allows ESP32 to send emails with attachments via [[https:// | + | **ESP32_MailClient.h** allows ESP32 to send emails with attachments via [[https:// |
**WiFi.h** allows ESP32 to connect to the local WiFi network which is useful for projects needed to connect Arduiono to the internet to send and receive data.\\ | **WiFi.h** allows ESP32 to connect to the local WiFi network which is useful for projects needed to connect Arduiono to the internet to send and receive data.\\ | ||
- | **< | + | **< |
**FS.h** allows to read, write, and manage files on different types of storage, such as SPIFFS, SD cards, and internal EEPROM.\\ | **FS.h** allows to read, write, and manage files on different types of storage, such as SPIFFS, SD cards, and internal EEPROM.\\ | ||
<code C++> | <code C++> | ||
Line 462: | Line 479: | ||
</ | </ | ||
- | ===Define email=== | ||
Define the email account and password that the ESP32-CAM would login as well as the recipient' | Define the email account and password that the ESP32-CAM would login as well as the recipient' | ||
<code C++> | <code C++> | ||
Line 524: | Line 540: | ||
=====4.Results and Discussion===== | =====4.Results and Discussion===== | ||
- | ====4.1 Real-Time Clock(RTC) | + | ====4.1 Real-Time Clock(RTC)==== |
{{: | {{: | ||
{{: | {{: | ||
Line 738: | Line 754: | ||
As shown in the result photo, the name of the photo is now changed to the format " | As shown in the result photo, the name of the photo is now changed to the format " | ||
===While the code is not sufficiently developed, it only modifies the file name, some more improvement on the code has to be done.=== | ===While the code is not sufficiently developed, it only modifies the file name, some more improvement on the code has to be done.=== | ||
+ | ====4.2 Deep Sleep Mode==== | ||
+ | We put our ESP32-Cam in [[https:// | ||
+ | The original concept of this project is using GPIO12 as an external wake up pin, which when the pir sensor detects motion, it sends a digital output signal high (logical 1) to the wake up pin to trigger esp32-cam to wake up.\\ While finally we found that it is not suitable to do it in this project. The reason is that when the ESP32 is in deep sleep mode, it effectively "shuts down" the processor, and the code execution stops. It does not maintain the previous state or continue running the code where it left off. Instead, it will restart the entire program from the beginning and start execution from the ’setup()’ function again, as if you pressed the reset button. This means it counts down to stabilize, connect to WiFi, mount SPIFFS, initialize the camera and take photos every time when it detects motion. Which will not take photos efficiently.\\ While without using the deep sleep mode, it counts down to stabilize, connect to WiFi, mount SPIFFS and initialize the camera once, and take photos whenever it detects motion. | ||
+ | =====5.Reference===== | ||
+ | [[https:// | ||
+ | Lithium Ion/Polymer charger - bq24074]]\\ | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | [[https:// |
amc/ss2023/group-y/start.1690186796.txt.gz · Last modified: 2023/07/24 10:19 by hoi-fung.sam