Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2025:abirlica:macedoniu.pacuraru [2025/05/29 19:58]
macedoniu.pacuraru [Hardware Design]
pm:prj2025:abirlica:macedoniu.pacuraru [2025/05/29 22:20] (current)
macedoniu.pacuraru [Bibliography/Resources]
Line 34: Line 34:
 {{:​pm:​prj2025:​abirlica:​schematicdefoc.png?​500|}} {{:​pm:​prj2025:​abirlica:​schematicdefoc.png?​500|}}
  
-===Conexiuni între piese===+Schematic made in Fusion 360. The ESP8266 was made manually because there seems to be no schematic for it on the internet.
  
-- **Senzorul de temperatură DHT11**+===Connections Between Components===
  
-  ​Date (OUT) → pin D2 (GPIO4) al placuței ESP8266 +**Temperature Sensor DHT11**
-  ​VCC → 3.3V +
-  ​GND → GND+
  
-**Butonul ​(Reset Alarmă)**+  ​Data (OUT) → pin D2 (GPIO4of the ESP8266 board   
 +  ​VCC → 3.3V   
 +  ​GND → GND  ​
  
-  ​Un pin → pin D1 (GPIO5al ESP8266 +**Button ​(Reset Alarm)**
-  ​Celălalt pin → GND +
-  * Configurare software: se activează rezistența internă de pull-up cu pinMode(D1, INPUT_PULLUP);​ +
-  ​Rol: Oprește alarma temporar și resetează starea de alertă.+
  
-**Buzzer-ul pasiv**+  ​First pin → pin D1 (GPIO5) of the ESP8266 ​  
 +  ​Second pin → 3.3V  
 +  ​Third pin → GND 
 +  ​Software configuration:​ internal pull-up resistor is enabled with pinMode(D1, INPUT_PULLUP);​
  
-  ​Pin de semnal ​→ pin D0 (GPIO16)+**Passive Buzzer** 
 + 
 +  * Signal pin → pin D0 (GPIO16) ​ 
   * GND → GND   * GND → GND
-  * Rol: Emite un sunet de avertizare când temperatura depășește pragul. Controlat cu tone() și noTone(). 
  
-- **Modulul GSM SIM800L**+- **SIM800L ​GSM Module**
  
-  * TX (ieșire ​SIM800L) → pin D7 (RX ESP8266) +  * TX (SIM800L ​output) → pin D7 (ESP8266 ​RX  
-  * RX (intrare ​SIM800L) → pin D8 (TX ESP8266) +  * RX (SIM800L ​input) → pin D8 (ESP8266 ​TX)   
-  * Notă: Se recomandă un divizor de tensiune pe TX ESP8266 → RX SIM800L, deoarece ESP dă 3.3V iar SIM800L este sensibil. +  * VCC → separate ​3.7V power source ​(Li-ion ​batteryor stabilized ​step-down ​converter  ​ 
-  * VCC → sursă separată de 3.7V (baterie ​Li-ion) ​sau prin convertor ​step-down ​stabilizat +  * GND → Common ​GND with ESP8266 
-  * GND → GND comun cu ESP8266 +<​note>​ 
-  * RolTrimite un SMS de alertă o singură dată la fiecare declanșare de alarmă.+ 
 +  * NoteA voltage divider is recommended on ESP8266 TX → SIM800L RX, as the ESP outputs 3.3V and the SIM800L is sensitive. ​  
 +</​note>​
  
 - **ESP8266 (NodeMCU)** - **ESP8266 (NodeMCU)**
  
-  * USB → PC (pentru alimentare și comunicare ​serială+  * USB → PC (for power and serial ​communication
-  * Rol: Este centrul de control al sistemului. Primește datele de la senzor, decide dacă activează alarma și comunică prin GSM.+
  
 ===== Software Design ===== ===== Software Design =====
  
-The firmware is developed in the Arduino IDE targeting the ESP8266 platform. ​It follows these steps:+The firmware is developed in the Arduino IDE targeting the ESP8266 platform. ​ 
 + 
 +===Purpose of the Code=== 
 + 
 +- **DHT11 Temperature Sensor** 
 +  * Reads the ambient temperature through digital pin D2 (GPIO4). 
 +  * If the temperature exceeds 26.1°C, an alarm state is triggered. 
 +  * The reading is done using the `Adafruit_Sensor`,​ `DHT`, and `DHT_U` libraries. 
 +  * Temperature is read periodically (every ~0.5 seconds) and logged to the serial monitor. 
 + 
 +- **Alarm System (Passive Buzzer and Button)** 
 +  * The buzzer is connected to pin D0 (GPIO16) and activated using the `tone()` function when an alarm is triggered. 
 +  * A push button connected to D1 (GPIO5) is configured with an internal pull-up resistor (`INPUT_PULLUP`). 
 +  * When the button is pressed, the alarm is silenced, and the system enters a cooldown period of 1 minute to prevent retriggering. 
 +  * `alarmActive` and `smsSent` boolean flags are used to manage system state. 
 + 
 +- **SIM800L GSM Module** 
 +  * Communicates with the ESP8266 via `SoftwareSerial` on pins D7 (RX) and D8 (TX). 
 +  * During setup, AT commands are used to initialize the module and verify signal/SIM status. 
 +  * Sends an SMS alert **once** per alarm event using the `sendSMS()` function. 
 +  * The SMS content is*"​ALERTA:​ Temperatura depaseste 26.1C!"​* 
 + 
 +===Flow Overview=== 
 + 
 +  * Upon startup: 
 +    - Serial communication is initialized. 
 +    - The DHT11 and SIM800L modules are set up. 
 +    - AT commands check SIM status, signal quality, and configure SMS mode. 
 +  * In the main loop: 
 +    - The system reads temperature from the DHT11 sensor. 
 +    - If temperature > 26.1°C and no alarm is active: 
 +      - The buzzer is activated. 
 +      - An SMS is sent (only once per event). 
 +    - If the user presses the button: 
 +      - The alarm stops. 
 +      - A 60-second cooldown prevents immediate retriggering. 
 +  * Messages and debug information are printed to the serial monitor for monitoring and troubleshooting. 
 + 
 +**Libraries Used** 
 + 
 +- `Adafruit_Sensor.h`,​ `DHT.h`, `DHT_U.h`: For interfacing with the DHT11 temperature sensor. 
 +- `SoftwareSerial.h`:​ Enables serial communication between the ESP8266 and the SIM800L GSM module.
  
-  1. Initialize the DHT11 sensor, buzzer pin, and UART communication with the SIM800L. 
-  2. Enter a loop where temperature is read every two seconds. 
-  3. If the temperature reading exceeds 50 °C, activate the buzzer and transmit an SMS alert via the GSM module using standard AT commands. 
-  4. Otherwise, keep the buzzer silent and continue monitoring. 
  
 ===== Results ===== ===== Results =====
  
 +{{:​pm:​prj2025:​abirlica:​pozaresults.jpeg?​500|}}
 ===== Conclusions ===== ===== Conclusions =====
  
 +Working on this project was both challenging and fun. At first, I wasn’t sure if everything would work together, especially the SIM800L module, which needed a lot of trial and error to set up properly. I also had to be careful with wiring and power, since I didn’t want to damage any components.
 +
 +I learned a lot about how to use interrupts, how UART communication works, and how to read data from the DHT11 sensor. I also got some practice debugging both hardware and software issues, which sometimes took a while but felt great once they were solved.
 +
 +In the end, I managed to build a system that detects high temperatures,​ triggers an alarm, and sends an SMS alert. It even has a button to silence the alarm, which works using interrupts.
 +
 +Even though it’s a simple version, I think it’s a good starting point, and I’m happy with how it turned out. With more time, I’d like to improve the design and maybe add more features. Overall, it was a great learning experience.
 ===== Bibliography/​Resources ===== ===== Bibliography/​Resources =====
  
 +[[https://​newbiely.com/​tutorials/​esp8266/​esp8266-dht11|ESP8266 with DHT11 – Newbiely guide]]
 +– A detailed tutorial on how to connect and read temperature from a DHT11 sensor using the ESP8266.
 +
 +[[https://​lastminuteengineers.com/​sim800l-gsm-module-arduino-tutorial/​|SIM800L GSM Module with Arduino – Last Minute Engineers]]
 +– A complete guide for using the SIM800L module to send SMS messages via AT commands.
 +
 +[[https://​arduino-esp8266.readthedocs.io/​en/​latest/​reference.html|ESP8266 Interrupts – Official Documentation]]
 +– Official Arduino documentation on using interrupts.
  
 +[[https://​www.theengineeringprojects.com/​2020/​09/​lm2596-buck-converter-datasheet-pinout-features-applications.html|LM2596 datasheet and guide]]
 +– Technical overview of the LM2596 buck converter module
pm/prj2025/abirlica/macedoniu.pacuraru.1748537925.txt.gz · Last modified: 2025/05/29 19:58 by macedoniu.pacuraru
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0