This shows you the differences between two versions of the page.
|
pm:prj2026:jan.vaduva:calin.marinescu [2026/05/07 16:15] calin.marinescu created |
pm:prj2026:jan.vaduva:calin.marinescu [2026/05/16 01:14] (current) calin.marinescu [Hardware Photos and Evidence] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Smart Drawer Anti-Theft System ====== | ||
| - | ====== Sistem antifurt inteligent pentru sertar ====== | + | ===== Introduction ===== |
| - | ===== Descriere generală ===== | + | The **Smart Drawer Anti-Theft System** is an embedded security system designed to protect a drawer, box, or small storage compartment against unauthorized access. The system uses an ESP32 microcontroller and detects suspicious activity using two complementary methods: motion detection with an I2C accelerometer and light detection using three LDR sensors placed inside the drawer. |
| - | Proiectul constă într‑un **sistem antifurt inteligent** montat în interiorul unui sertar. Sistemul monitorizează dacă sertarul este deschis sau mişcat şi, în cazul unui acces neautorizat, activează o alarmă sonoră şi transmite o notificare prin Bluetooth către un PC sau un telefon. Nu există ecran – controlul se face exclusiv prin comenzi Bluetooth de tip **ARM**, **DISARM**, **STATUS** şi **CHANGE\_PIN** urmate de un cod PIN. | + | The purpose of the project is to build a realistic, low-cost and physically implementable anti-theft system using common components that can be connected on a breadboard. When the system is armed and detects movement, vibration or light inside the drawer, it will activate a passive buzzer and send a notification to a PC application through Bluetooth Low Energy. |
| - | ==== Motivare și utilitate ==== | + | The initial idea came from the fact that a closed drawer is normally dark and still. Sudden light exposure or movement can indicate that someone opened the drawer or moved the protected box. By combining an accelerometer with three LDR sensors, the system can detect multiple types of unauthorized access and reduce false alarms. |
| - | Sertarele cu documente confidenţiale sau obiecte de valoare sunt vulnerabile atunci când rămân nesupravegheate. Un sistem antifurt discret, fără sunete false şi cu control securizat, avertizează proprietarul imediat când cineva încearcă să deschidă sertarul. Utilizarea unei plăci **ESP32** cu Bluetooth asigură cost redus, flexibilitate şi posibilitatea de integrare cu un PC sau cu alte dispozitive mobile. Accelerometrul detectează vibraţiile de deschidere, iar fotorezistorii (LDR) detectează pătrunderea luminii în sertar; combinaţia reduce alarmările false. | + | The project is useful because it demonstrates several embedded systems concepts in a practical application. From the hardware point of view, the current stage focuses on sensor wiring, power distribution, ADC inputs, I2C communication and transistor-based buzzer driving. |
| - | ===== Arhitectură sistem ===== | + | * analog sensor reading using ADC; |
| + | * I2C communication with an accelerometer; | ||
| + | * PWM signal generation for a passive buzzer; | ||
| + | * common ground and 3.3 V power distribution; | ||
| + | * safe interfacing between the ESP32 and external components. | ||
| - | Sistemul se bazează pe un microcontroler **ESP32** care controlează toţi senzorii şi actuatorul. Placa oferă conectivitate Bluetooth clasică, convertor analog–digital (ADC) pentru LDR‑uri, canale PWM pentru buzzer şi magistrală I²C pentru accelerometru. Structura poate fi văzută ca o mașină cu trei stări: `DISARMED`, `ARMED` şi `ALARM`. | + | ===== General Description ===== |
| - | **Diagramă bloc:** | + | The system is built around an **ESP32 LOLIN32 Lite** board, which acts as the main controller. The ESP32 reads the three LDR sensors through ADC pins, communicates with the accelerometer using the I2C bus and controls the passive buzzer using a PWM signal and a transistor driver. |
| - | {{block_diagram.png?400|Diagramă bloc sistem}} | + | The user interface will be implemented through a PC application. There is no display and no physical keypad on the embedded device. The user will be able to arm or disarm the system remotely. |
| - | ===== Descriere hardware ===== | + | The final system is planned to have three main states: |
| - | * **ESP32 Wireless Development Board** – microcontroler cu 4 MB memorie flash şi Bluetooth clasic; rulează codul de control şi comunică prin I²C, ADC şi PWM. Placa se alimentează prin micro‑USB de la un laptop sau adaptor de 5 V şi este compatibilă cu Arduino IDE. | + | * **DISARMED** - the system is inactive. Sensors may still be read for debugging or status reporting, but they do not trigger the alarm. The buzzer is turned off. |
| - | * **Accelerometru digital LIS3DH** – senzor triaxial conectat la magistrala I²C. Magistrala utilizează două linii, SDA (date) şi SCL (ceas); ESP32 funcţionează ca master şi iniţiază comunicarea. Accelerometrul detectează vibraţii şi mişcări ale sertarului. | + | * **ARMED** - the system monitors the accelerometer and the three LDR sensors. If movement, vibration or light is detected, the system enters the alarm state. |
| - | * **Senzori de lumină (3 × LDR)** – fotorezistori care îşi modifică rezistenţa în funcţie de lumina incidentă. Formați un divizor de tensiune împreună cu rezistențe de 10 kΩ; tensiunea analogică rezultată se citește cu ADC‑ul ESP32 (rezoluţie 10 biţi). Setul de prototipare include doi fotorezistori, iar un al treilea este achiziţionat separat. | + | * **ALARM** - the buzzer is active and a notification is sent. The system remains in this state until a correct ''DISARM <PIN>'' command is received. |
| - | * **Buzzer pasiv 3 V/3,3 V** – mic difuzor capabil să redea tonuri când este alimentat cu un semnal PWM. Un tranzistor NPN 2N2222 se folosește ca driver pentru a prelua curentul buzzerului şi a proteja pinul ESP32. | + | |
| - | * **Tranzistor NPN 2N2222** – este comandat printr‑un rezistor de bază (~1 kΩ) şi permite comanda sigură a buzzerului la 3,3 V. | + | |
| - | * **Kit prototipare** – conţine breadboard de 400 puncte, set de rezistenţe (10 kΩ, 1 kΩ etc.), doi LDR‑uri şi cabluri Dupont. Permite asamblarea fără lipire. | + | |
| - | * **Cablu micro‑USB** – pentru alimentarea plăcii ESP32 de la un laptop/încărcător. | + | |
| - | ===== Schema de conectare ===== | + | The planned remote commands for the final software stage are: |
| - | - **Alimentare**: Conectează cablul micro‑USB la portul plăcii ESP32. Placa foloseşte regulatorul intern pentru a furniza 3,3 V către senzori. | + | * ''ARM <PIN>'' |
| - | - **Accelerometru LIS3DH**: VCC ↔ 3V3, GND ↔ GND, SDA ↔ GPIO21, SCL ↔ GPIO22. Dacă modulul are pini de adresă/întrerupere, lăsaţi‑i neconectaţi sau legaţi‑i conform documentaţiei. | + | * ''DISARM <PIN>'' |
| - | - **LDR‑uri**: Pentru fiecare LDR formaţi un divizor de tensiune: un capăt al LDR‑ului la 3,3 V, celălalt capăt la nodul de intrare analogică; o rezistenţă de 10 kΩ între nod şi GND; conectaţi nodul la un pin ADC (`GPIO34`, `GPIO35`, `GPIO32`). | + | * ''STATUS'' |
| - | - **Buzzer + tranzistor**: Emiţătorul tranzistorului 2N2222 ↔ GND, colectorul ↔ un capăt al buzzerului, celălalt capăt al buzzerului ↔ 3,3 V; baza tranzistorului ↔ rezistor 1 kΩ ↔ pin PWM (`GPIO25`). | + | * ''CHANGE_PIN <old_pin> <new_pin>'' |
| - | - **Bluetooth**: Comunicarea cu PC/telefon se face prin modulul Bluetooth integrat; nu necesită conexiuni fizice suplimentare. | + | |
| - | ===== Flux de funcționare ===== | + | ==== Block Diagram ==== |
| - | Sistemul se comportă ca o **maşină de stări** cu trei stări principale: | + | {{:pm:prj2026:jan.vaduva:diagrama_bloc.png?600|Smart Drawer Anti-Theft System block diagram}} |
| - | * **DISARMED** – Sistemul este dezarmat. Senzorii sunt monitorizaţi dar valorile lor nu declanşează alarma. Comenzile permise: `ARM <PIN>`, `STATUS`, `CHANGE_PIN`. | + | The system contains the following modules: |
| - | * **ARMED** – După introducerea PIN‑ului corect, sistemul trece în starea **ARMED**. Senzorii sunt monitorizaţi în buclă. Dacă accelerometrul detectează vibraţii peste un prag sau dacă media/votul majoritar al valorilor de la cele trei LDR‑uri depăşeşte un prag luminos, sistemul trece la starea **ALARM**. | + | |
| - | * **ALARM** – Buzzerul este activat prin PWM iar prin Bluetooth se trimite o notificare (`ALARM`). Sistemul rămâne în această stare până când este dezarmat (`DISARM <PIN>`). Pentru a preveni exploatarea, comanda `DISARM` verifică PIN‑ul; la mai multe încercări greşite, se poate introduce o întârziere. | + | |
| - | **Diagramă mașină de stări:** | + | * **ESP32 LOLIN32 Lite** - central processing unit of the project. |
| + | * **LDR sensor module** - three LDR voltage dividers connected to ADC pins. | ||
| + | * **Accelerometer module** - detects movement and vibration through I2C communication. | ||
| + | * **Buzzer driver** - passive buzzer controlled through a 2N2222 transistor and PWM. | ||
| + | * **Bluetooth communication module** - planned communication channel between the ESP32 and the PC application. | ||
| + | * **State machine firmware** - planned logic for the DISARMED, ARMED and ALARM states. | ||
| - | {{state_machine.png?400|Mașina de stări}} | + | The three LDR sensors are used for redundancy. Instead of triggering the alarm based on only one sensor, the planned firmware will use a two-out-of-three decision rule. This should make the light detection more reliable and reduce false alarms caused by sensor noise or uneven lighting. |
| - | ===== Pseudocod ===== | + | The accelerometer is used to detect drawer movement, vibration or sudden displacement. This is useful because someone may move the drawer or the whole box without fully opening it, in which case the light sensors may not detect a change immediately. |
| - | <code c> | + | ===== Hardware Design ===== |
| - | // variabile globale | + | |
| - | int pinLDR[3] = {34, 35, 32}; // pini ADC pentru cei 3 LDR | + | |
| - | const int buzzerPin = 25; // pin PWM pentru buzzer | + | |
| - | const int transistorBase = 25; // acelaşi ca buzzerPin | + | |
| - | bool armed = false; | + | |
| - | bool alarmState = false; | + | |
| - | String storedPIN = "1234"; | + | |
| - | void setup() { | + | ==== Current Hardware Implementation Status ==== |
| - | Serial.begin(9600); // debug local (opţional) | + | |
| - | initBluetooth(); // iniţializează modulul Bluetooth | + | |
| - | initAccelerometer(); // configurare LIS3DH via I²C | + | |
| - | pinMode(transistorBase, OUTPUT); | + | |
| - | // se configurează ADC‑urile implicit pe ESP32 | + | |
| - | } | + | |
| - | void loop() { | + | At the current hardware milestone, the ESP32 LOLIN32 Lite is mounted on a breadboard together with: |
| - | checkBluetoothCommands(); // citeşte comenzile ARM/DISARM/STATUS/etc. | + | |
| - | if (!armed) { | + | |
| - | delay(100); | + | |
| - | return; | + | |
| - | } | + | |
| - | bool motionDetected = readAccelerometer() > motionThreshold; | + | |
| - | float ldrValues[3]; | + | |
| - | for (int i = 0; i < 3; i++) { | + | |
| - | ldrValues[i] = analogRead(pinLDR[i]); | + | |
| - | } | + | |
| - | bool lightDetected = (computeMajority(ldrValues) > lightThreshold); | + | |
| - | if (motionDetected || lightDetected) { | + | |
| - | alarmState = true; | + | |
| - | sendBluetoothNotification("ALARM"); | + | |
| - | activateBuzzer(); | + | |
| - | } | + | |
| - | } | + | |
| - | void checkBluetoothCommands() { | + | * three LDR voltage dividers; |
| - | if (availableBluetooth()) { | + | * an I2C accelerometer module; |
| - | String cmd = readBluetoothLine(); | + | * a passive buzzer driven through a 2N2222 NPN transistor; |
| - | if (cmd.startsWith("ARM")) { | + | * common 3.3 V and GND rails. |
| - | String pin = extractPin(cmd); | + | |
| - | if (pin == storedPIN) { | + | |
| - | armed = true; | + | |
| - | alarmState = false; | + | |
| - | sendBluetoothNotification("ARMED"); | + | |
| - | } | + | |
| - | } else if (cmd.startsWith("DISARM")) { | + | |
| - | String pin = extractPin(cmd); | + | |
| - | if (pin == storedPIN) { | + | |
| - | armed = false; | + | |
| - | deactivateBuzzer(); | + | |
| - | sendBluetoothNotification("DISARMED"); | + | |
| - | } | + | |
| - | } else if (cmd.startsWith("STATUS")) { | + | |
| - | sendBluetoothNotification(armed ? (alarmState ? "ALARM" : "ARMED") : "DISARMED"); | + | |
| - | } else if (cmd.startsWith("CHANGE_PIN")) { | + | |
| - | String newPin = extractPin(cmd); | + | |
| - | storedPIN = newPin; | + | |
| - | sendBluetoothNotification("PIN_CHANGED"); | + | |
| - | } | + | |
| - | } | + | |
| - | } | + | |
| - | void activateBuzzer() { | + | The board is powered and programmed through USB during development. After the firmware is uploaded, the ESP32 can also be powered from an external USB power bank for standalone operation. |
| - | ledcAttachPin(buzzerPin, 0); | + | |
| - | ledcSetup(0, 2000, 8); | + | |
| - | ledcWrite(0, 128); | + | |
| - | } | + | |
| - | void deactivateBuzzer() { | + | The current hardware was tested with a firmware smoke test. The Serial Monitor confirms that: |
| - | ledcWrite(0, 0); | + | |
| - | } | + | * the ESP32 boots correctly; |
| + | * the accelerometer is detected on the I2C bus at address ''0x19''; | ||
| + | * the accelerometer returns ''WHO_AM_I = 0x33'', which indicates a LIS3DH-compatible device; | ||
| + | * at least one LDR reading is visible through the ADC; | ||
| + | * the board starts BLE advertising as ''SmartDrawerAlarm''. | ||
| + | |||
| + | Current Serial Monitor evidence: | ||
| + | |||
| + | <code> | ||
| + | Smart Drawer Anti-Theft System boot | ||
| + | [LOG] 221 BOOT | ||
| + | [LOG] 1578 I2C 0x19 accel=LIS3DH-compatible addr=0x19 who=0x33 | ||
| + | [LOG] 1579 LDR raw1=939 base1=937 deltaThreshold=450 | ||
| + | [LOG] 1864 BLE advertising SmartDrawerAlarm | ||
| </code> | </code> | ||
| - | ===== Utilizarea laboratoarelor PM ===== | + | This proves that the ESP32 is running uploaded firmware, the I2C accelerometer is wired correctly and the ADC reading for the LDR circuit is functional. The second and third LDR sensors have also been physically added on GPIO35 and GPIO32 and will be verified together with the final three-sensor voting logic. |
| + | |||
| + | ==== Component List ==== | ||
| + | |||
| + | ^ Component ^ Quantity ^ Role in project ^ | ||
| + | | ESP32 LOLIN32 Lite | 1 | Main microcontroller, sensor reading, buzzer control and Bluetooth communication | | ||
| + | | LIS3DH-compatible accelerometer module | 1 | Motion and vibration detection over I2C | | ||
| + | | LDR sensor | 3 | Light detection inside the drawer | | ||
| + | | 10 kOhm resistor | 3 | Fixed resistors for the LDR voltage dividers | | ||
| + | | Passive buzzer | 1 | Acoustic alarm | | ||
| + | | 2N2222 NPN transistor | 1 | Low-side driver for the passive buzzer | | ||
| + | | 1 kOhm resistor | 1 | Base resistor for the 2N2222 transistor | | ||
| + | | Breadboard | 1 | Prototype assembly | | ||
| + | | Jumper wires | as needed | Electrical connections | | ||
| + | | USB cable | 1 | Firmware upload, serial debugging and power during development | | ||
| + | | External USB power bank | 1, optional | Standalone power supply after firmware upload | | ||
| + | |||
| + | ==== Pin Mapping ==== | ||
| + | |||
| + | ^ Module / Signal ^ ESP32 Pin ^ Reason for choosing this pin ^ | ||
| + | | LDR 1 voltage divider output | GPIO34 | ADC-capable input-only pin, suitable for analog sensing | | ||
| + | | LDR 2 voltage divider output | GPIO35 | ADC-capable input-only pin, suitable for analog sensing | | ||
| + | | LDR 3 voltage divider output | GPIO32 | ADC-capable GPIO, used for the third light sensor | | ||
| + | | Accelerometer SDA | GPIO23 | Custom I2C data pin used by the firmware | | ||
| + | | Accelerometer SCL | GPIO22 | I2C clock pin | | ||
| + | | Buzzer PWM control | GPIO17 | PWM-capable GPIO used to drive the passive buzzer through a transistor | | ||
| + | | Accelerometer VCC | 3.3 V | Sensor power supply compatible with ESP32 logic | | ||
| + | | Accelerometer GND | GND | Common ground | | ||
| + | | LDR voltage dividers VCC | 3.3 V | Keeps ADC voltage within ESP32 limits | | ||
| + | | LDR voltage dividers GND | GND | Common ground | | ||
| + | | Buzzer positive terminal | 3.3 V | Buzzer supply | | ||
| + | | Buzzer negative terminal | 2N2222 collector | Transistor switches the buzzer to ground | | ||
| + | |||
| + | GPIO34 and GPIO35 are input-only pins, which is acceptable for LDR measurements because the firmware only needs ADC input. GPIO32 is also ADC-capable and is used for the third LDR. GPIO23 and GPIO22 are used as custom I2C pins for the accelerometer. GPIO17 is used for PWM because the buzzer is passive and must be driven with a square wave, not just a static HIGH/LOW output. | ||
| + | |||
| + | ==== LDR Voltage Dividers ==== | ||
| + | |||
| + | Each LDR is connected as a voltage divider powered from **3.3 V**, so the output voltage remains compatible with the ESP32 ADC input range: | ||
| + | |||
| + | <code> | ||
| + | 3.3V ---- LDR ---- ADC_PIN ---- 10 kOhm ---- GND | ||
| + | </code> | ||
| + | |||
| + | The ADC pins are: | ||
| + | |||
| + | ^ LDR ^ ADC pin ^ | ||
| + | | LDR1 | GPIO34 | | ||
| + | | LDR2 | GPIO35 | | ||
| + | | LDR3 | GPIO32 | | ||
| + | |||
| + | The firmware will store a dark baseline during calibration and then compare the current ADC values with this baseline. The final light detection logic will use all three LDR sensors and will trigger the alarm only when at least two sensors detect a significant light change. | ||
| + | |||
| + | ==== Accelerometer Connection ==== | ||
| + | |||
| + | The accelerometer module is connected to the ESP32 using I2C: | ||
| + | |||
| + | <code> | ||
| + | ESP32 GPIO23 -> SDA | ||
| + | ESP32 GPIO22 -> SCL | ||
| + | ESP32 3.3V -> VCC | ||
| + | ESP32 GND -> GND | ||
| + | </code> | ||
| + | |||
| + | The firmware performs an I2C scan at startup and reads the ''WHO_AM_I'' register. The detected sensor currently reports: | ||
| + | |||
| + | <code> | ||
| + | I2C address: 0x19 | ||
| + | WHO_AM_I: 0x33 | ||
| + | Type: LIS3DH-compatible | ||
| + | </code> | ||
| + | |||
| + | This startup check is important because the exact accelerometer chip was not assumed only from the module appearance. The sensor is verified through I2C before being used for motion detection. | ||
| + | |||
| + | ==== Buzzer Driver ==== | ||
| + | |||
| + | The passive buzzer is controlled through a 2N2222 NPN transistor, not directly from an ESP32 GPIO pin. The ESP32 generates a PWM signal on GPIO17, and the transistor works as a low-side switch: | ||
| + | |||
| + | <code> | ||
| + | ESP32 GPIO17 --- 1 kOhm --- 2N2222 base | ||
| + | 2N2222 emitter ----------- GND | ||
| + | 2N2222 collector --------- buzzer negative terminal | ||
| + | buzzer positive terminal - 3.3 V | ||
| + | </code> | ||
| + | |||
| + | The buzzer is passive, therefore it requires a PWM/tone signal. The transistor protects the ESP32 GPIO and allows the buzzer current to be switched externally. | ||
| + | |||
| + | ==== Electrical Diagram ==== | ||
| + | |||
| + | {{:pm:prj2026:jan.vaduva:diagrama_electrica.png?650|Smart Drawer hardware connection diagram}} | ||
| + | |||
| + | The electrical diagram should show: | ||
| + | |||
| + | * all modules powered from 3.3 V; | ||
| + | * common GND rail for ESP32, sensors and buzzer driver; | ||
| + | * three independent LDR voltage dividers; | ||
| + | * accelerometer connected over I2C on GPIO23/GPIO22; | ||
| + | * buzzer connected through a 2N2222 transistor and a 1 kOhm base resistor; | ||
| + | * no ADC input connected to a voltage higher than 3.3 V. | ||
| + | |||
| + | |||
| + | ==== Hardware Design Notes ==== | ||
| + | |||
| + | * All sensors are powered from **3.3 V**. | ||
| + | * ADC pins must not receive voltages higher than 3.3 V. | ||
| + | * GPIO34 and GPIO35 are input-only pins, which is suitable for LDR readings. | ||
| + | * The buzzer is controlled through a transistor because it should not be powered directly from an ESP32 GPIO. | ||
| + | * All modules must share a common ground. | ||
| + | * USB is used for firmware upload, serial debugging and power during development. | ||
| + | * An external USB power bank can be used later for standalone operation after the firmware has already been uploaded. | ||
| + | |||
| + | ===== Software Design ===== | ||
| + | |||
| + | This section will be completed during the software milestone. At the current hardware milestone, only a basic firmware smoke test was used to verify that the connected hardware components can be accessed by the ESP32. | ||
| + | |||
| + | ===== Obtained Results ===== | ||
| + | |||
| + | This section will be completed after the full integration and testing stage. | ||
| + | |||
| + | For the current hardware milestone, the obtained hardware results are: | ||
| + | |||
| + | * ESP32 firmware upload through USB is working; | ||
| + | * Serial Monitor output is available at 115200 baud; | ||
| + | * accelerometer I2C detection is working; | ||
| + | * the accelerometer returns ''WHO_AM_I = 0x33''; | ||
| + | * LDR ADC reading is visible; | ||
| + | * BLE advertising starts successfully. | ||
| - | * **UART/Bluetooth (Lab 1)** – Protocolul Bluetooth clasic este implementat în ESP32 ca o interfaţă serială (UART) radio. Comunicarea full‑duplex foloseşte două canale (Tx şi Rx) pentru a trimite şi recepţiona comenzi. | + | ===== Conclusions ===== |
| - | * **PWM (Lab 3)** – Buzzerul pasiv necesită un semnal PWM. PWM variază raportul dintre timpul înalt şi scăzut al unui semnal digital, oferind control asupra puterii medii aplicate unui dispozitiv. | + | |
| - | * **ADC (Lab 4)** – LDR‑urile furnizează tensiuni analogice ce trebuie convertite în valori digitale. Rezoluţia ADC‑ului de 10 biţi dă un pas de cuantizare de aproximativ 3,2 mV, ceea ce ajută la calibrarea pragurilor de lumină. | + | |
| - | * **I2C (Lab 6)** – Accelerometrul LIS3DH comunică prin I²C. Magistrala I²C foloseşte două linii (SDA/SCL) controlate de master; semnalul de ceas este generat de master iar linia de date este partajată. Fiecare dispozitiv are o adresă de 7 biţi. | + | |
| - | ===== Probleme posibile și soluții ===== | + | At the current stage, the project has a working hardware prototype on breadboard. The most important hardware blocks are connected, and at least one component, the accelerometer, has been verified through I2C detection and ''WHO_AM_I'' reading. The LDR circuit also produces ADC readings, and the ESP32 is able to boot and advertise over BLE. |
| - | * **Alarmări false datorate vibraţiilor ambientale** – Pragurile pentru accelerometru şi LDR trebuie calibrate. Montarea accelerometrului pe o suprafaţă stabilă şi filtrarea digitală (medie mobilă) reduc influenţa zgomotului. | + | The next hardware-related steps are to take clear photos of the assembled circuit, finish the electrical diagram, verify all three LDR sensors individually and test the passive buzzer driver. |
| - | * **Senzorii de lumină pot fi acoperiţi de obiecte** – Distanţa dintre LDR şi capacul sertarului trebuie aleasă astfel încât lumina să fie detectată chiar dacă unul dintre senzori este blocat. Algoritmul de vot 2 din 3 previne declanşarea falsă. | + | |
| - | * **Interferenţe Bluetooth** – Utilizarea unui PIN unic şi confirmarea comenzilor previne accesul neautorizat. Dacă apar interferenţe, se poate reduce distanţa de comunicare sau se pot folosi profile BLE cu criptare. | + | |
| - | * **Consum energetic** – În cazul alimentării din baterie, modulul ESP32 poate intra în mod sleep între citiri pentru a reduce consumul. În această aplicaţie, alimentarea USB facilitează consumul continuu. | + | |
| - | ===== Îmbunătățiri viitoare ===== | + | ===== Source Code and Other GitHub Resources ===== |
| - | * Implementarea unei **aplicaţii mobile** (Android/iOS) pentru control şi notificări push, folosind Bluetooth Low Energy. | + | This section will be completed later with the public repository link and final source code structure. |
| - | * Adăugarea unui senzor **magnetic (reed)** pentru detecţia deschiderii sertarului fără vibraţii; poate reduce alarmările false. | + | |
| - | * Înregistrarea datelor de acces (timestamp) pe un card micro‑SD sau trimiterea lor pe un server web prin Wi‑Fi, pentru istoric şi analiză. | + | |
| - | * Integrarea cu un sistem de **smart‑home** (Home Assistant) pentru notificări centralizate şi scenarii automatizate. | + | |
| - | ===== Bibliografie și resurse ===== | + | ===== Journal ===== |
| - | * Fișele de laborator pentru **UART**, **PWM**, **ADC** şi **I²C** din cursul *Proiectarea cu Microprocesoare* – pentru detalii despre protocoale şi utilizare. | + | ^ Date ^ Progress ^ |
| - | * Documentaţia modulelor utilizate (ESP32, LIS3DH, LDR, buzzer) – pentru parametri electrici şi detalii de conectare. | + | | 2026-05-08 | Initial OCW project page created with project idea, block diagram and first hardware description. | |
| + | | 2026-05-15 | Hardware pin mapping was finalized for ESP32 LOLIN32 Lite: LDRs on GPIO34/GPIO35/GPIO32, I2C on GPIO23/GPIO22 and buzzer PWM on GPIO17. | | ||
| + | | 2026-05-15 | ESP32 firmware smoke test was uploaded successfully through USB using PlatformIO. | | ||
| + | | 2026-05-15 | Serial Monitor confirmed accelerometer detection at I2C address 0x19 with WHO_AM_I value 0x33. | | ||
| + | | 2026-05-15 | Three LDR voltage divider connections were added on the breadboard. | | ||
| - | ===== Verificare finală ===== | + | ===== Bibliography/Resources ===== |
| - | * **Corectitudinea listei de componente:** placă de dezvoltare ESP32, modul LIS3DH, trei LDR‑uri, buzzer pasiv, tranzistor 2N2222, rezistenţe (10 kΩ, 1 kΩ), breadboard şi cabluri, plus cablu micro‑USB. Kitul de prototipare include majoritatea componentelor pasive, iar al treilea LDR se achiziţionează separat. | + | * ESP32 LOLIN32 Lite PlatformIO board documentation: https://docs.platformio.org/en/stable/boards/espressif32/lolin32_lite.html |
| - | * **Compatibilitatea hardware:** Toate componentele funcţionează la 3,3 V; ESP32 oferă suficiente intrări ADC, magistrală I²C şi canale PWM; tranzistorul 2N2222 permite comanda sigură a buzzerului. | + | * ESP32 LOLIN32 Lite pinout reference: https://www.mischianti.org/2021/07/30/esp32-wemos-lolin32-lite-high-resolution-pinout-and-specs/ |
| - | * **Realizabilitatea proiectului:** Sistemul se asamblează pe breadboard fără lipire. Costul total estimat (~114 lei) se încadrează în bugetul de 150–200 lei. Codul se scrie uşor în Arduino IDE cu biblioteci standard. | + | * ST LIS3DH datasheet: https://www.st.com/resource/en/datasheet/lis3dh.pdf |
| - | * **Riscuri și atenționări:** Componentele trebuie manevrate cu grijă. Ajustarea pragurilor pentru senzori este esenţială pentru a evita alarmările false. Sertarul trebuie ferit de vibraţii puternice externe. | + | * ST LIS3DSH datasheet: https://www.st.com/resource/en/datasheet/lis3dsh.pdf |
| + | * ST H3LIS331DL datasheet: https://www.st.com/resource/en/datasheet/h3lis331dl.pdf | ||
| + | * DokuWiki syntax reference: https://ocw.cs.pub.ro/courses/wiki/syntax | ||
| + | * PM project template: https://ocw.cs.pub.ro/courses/pm/pm/prj2021/template | ||