Differences

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

Link to this comparison view

iothings:proiecte:2022sric:home_security_system [2023/06/02 00:01]
robert.delicostea [Software Design]
iothings:proiecte:2022sric:home_security_system [2023/06/02 00:52] (current)
robert.delicostea
Line 1: Line 1:
-====== Home security ​System ======+====== Home Security ​System ======
  
 * Student: Delicostea Robert-Alexandru * Student: Delicostea Robert-Alexandru
Line 35: Line 35:
  
 The code for the system is written in Android IDE and the Blynk app. Blynk is an IoT platform for iOS or Android smartphones that is used to control Arduino, Raspberry Pi and NodeMCU via the Internet. This application is used to create a graphical interface or human machine interface (HMI) by compiling and providing the appropriate address on the available widgets. The code for the system is written in Android IDE and the Blynk app. Blynk is an IoT platform for iOS or Android smartphones that is used to control Arduino, Raspberry Pi and NodeMCU via the Internet. This application is used to create a graphical interface or human machine interface (HMI) by compiling and providing the appropriate address on the available widgets.
 +
 +{{:​iothings:​proiecte:​2022sric:​blynk_browser.png?​700|}}
  
 === Arduino Code === === Arduino Code ===
Line 97: Line 99:
 </​code>​ </​code>​
  
-{{:​iothings:​proiecte:​2022sric:​correct_password.jpeg?​350|}} +{{:​iothings:​proiecte:​2022sric:​correct_password.jpeg?​150|}} 
-{{:​iothings:​proiecte:​2022sric:​gauge.jpeg?​350|}} +{{:​iothings:​proiecte:​2022sric:​gauge.jpeg?​150|}} 
-{{:​iothings:​proiecte:​2022sric:​incorrect_pasword.jpeg?​350|}} +{{:​iothings:​proiecte:​2022sric:​incorrect_pasword.jpeg?​150|}} 
-{{:​iothings:​proiecte:​2022sric:​correct_pasword.jpeg?350|}}+{{:​iothings:​proiecte:​2022sric:​correct_password.jpeg?150|}} 
 + 
 +In the activateBuzzer function the number of times the button needs to pressed is set and the owner sees it on the Blynk app and in the handleButton the buzzer is stopped if the number is reached 
 + 
 +<​code>​ 
 +passNumber = random(3, 10); 
 +Blynk.logEvent("​button_pushed",​ String("​Buzzer activated, password is press button ") + passNumber + String("​ times"​));​ 
 +</​code>​ 
 + 
 +<​code>​ 
 +// Check if the button state has been stable for the debounce delay 
 +  if (millis() - lastDebounceTime >= debounceDelay) { 
 +    // Update the button state only if it has changed 
 +    if (reading != buttonState) { 
 +      buttonState = reading; 
 + 
 +      // If the button is pressed (LOW) and the buzzer is active, increase the press count 
 +      if (buttonState == LOW && buzzerActive) { 
 +        buttonPressCount++;​ 
 +        Serial.println(buttonPressCount);​ 
 + 
 + 
 +        // If the button has been pressed passNumber or more times, stop the buzzer 
 +        if (buttonPressCount >= passNumber) { 
 +          Serial.println("​hereeeee"​);​ 
 +          digitalWrite(buzzerPin,​ LOW); 
 +          buzzerActive = false; 
 +          buttonPressCount = 0; 
 +          return true; 
 +        } 
 +      } 
 +    } 
 +  } 
 +</​code>​ 
 + 
 + 
 +==== Demo ==== 
 +[[https://​drive.google.com/​file/​d/​1RYqV6uQVkARoj2Cm0B9M-EyMoeUGO6nH/​view?​usp=sharing|Demo of Application]] 
 + 
 +[[https://​github.com/​alex99delicostea/​Iot_security_system|Full code]] 
 + 
 +===== References =====   
 +  * https://​docs.blynk.io/​en/​ 
 +  * https://​randomnerdtutorials.com/​esp32-hc-sr04-ultrasonic-arduino/​ 
 +  * https://​esp32io.com/​tutorials/​esp32-piezo-buzzer 
 +  * https://​app.diagrams.net/​ 
 +  * https://​www.circuito.io/​
iothings/proiecte/2022sric/home_security_system.1685653294.txt.gz · Last modified: 2023/06/02 00:01 by robert.delicostea
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