[adrotate banner=”7″]

The arm activates in 10 seconds after pressing the a button for detecting objects, it uses an ultrasonic sensor and once the alarm detects something a buzzer starts emitting a sound. In order to stop the alarm, we need to insert a four digit password. The preset password is 1 2, 3 4, but we also have the possibility to change it by pressing the P button. We enter the password change menu, but first we need to enter the current password in order to continue and then enter the new four digits password. Once the password is changed the next time we activate the alarm, we will only be able to stop the alarm by entering the new password. If we enter a wrong password, we will get a message that we need to try again now. Let’S see the required components for this project. Obviously, we need an Arduino board, an ultrasonic sensor, LCD display a buzzer and a four by four keypad here’s, the circuit schematic. So for the buzzer we just need a single pin, but one we PWM support the 4 by 4. Keypad has 8 pins, 4 of them are for the rows, and 4 of them are for the columns of the keypad. Each button is actually a push button switch, which makes a short between one row and a column when pressed so, for example, if we set the row one line low and all columns line high, when we will press, for example, the button tree due to the short Between the two lines, the column tree line will drop to low.

So in such a case, we can register that the button tree has been pressed. As for the two other components on this project, the ultrasonic sensor and LCD display, you can check my previous detailed tutorials on how to connect and use them. Next let’s see the original code. So first we need to include the standard liquid crystal library, for the LCD and keypad library, which needs to be additionally installed. Then we need to define the buzzer and you just onek sensor, pins, define some variables needed for the program, define the keys of the keypad as well as create the two objects for the keypad and the LCD. In the setup section, we just need to initialize the LCD and define the pin modes for the buzzer and Neutra sonic sensor in the loop section. First, we check whether the alarm is activated or not. So if the arm is not activated on the LCD, we will hit the home screen of the program, which offers two options: a for activating the alarm and before changing the password, then using the my keypad dot gate key function. We read which button from the keypad has been pressed and if that’s the button, a the buzzer will produce a 200 millisecond sound and the activate alarm variable will become true. In that case, on the LCD we will print the message. Alarm will be activated in and using the while loop. We will make a countdown of nine seconds before the alarm is activated, then the message alarm activated will appear and we will measure the initial distance from our alarm device to the objects opposite of it.

So the next step is that the ultrasonic sensor will constantly check whether the currently measured distance is smaller than the initial distance corrected by a value of 10 centimeters. And if that’s true. It means that an object has appeared in front of the sensor. And the alarm will be activated, the tone function will activate the buzzer and the enter password custom function will be called. This custom function will print a message that the alarm is activated and that we need to enter a password in order to stop the alarm. So using the next while loop, we are constantly checking whether we have pressed a button on the key and each button press is added to the temporary password variable. If we enter more than four digits or we press the sharpe button, the previously entered digits will be clear, so we can type them again from beginning. On the other hand, if we press the asterisk button, we will check whether the currently entered password is the same as they originally set password. If that’s true, the alarm will be deactivated, the buzzer will stop producing a sound and we will get back to the home screen. But if the entered password was wrong, the message wrong, try again will appear and we will have to try to enter the correct password again for changing the password. We use a similar method here. First, we need to enter the current password in order to be able to set a new password.

So just like I said, we are using the same method as the one exclaim for entering the password for deactivating. The alarm, of course, you can find and take a closer look at this code on my official website article for finishing the project.


[adrotate banner=”1″]

arduino home security Video

[mam_video id=lTAo_H5eqsk]



[adrotate banner=”2″]


[mam_tag id=4861]



[adrotate banner=”3″]


arduino home security news






[adrotate banner=”4″]



arduino home security Social



[adrotate banner=”5″]




👋 Want to bring Tony Stark-like gesture control to your projects? Learn how with the BLE-enabled MKR WiFi 1010 and Nano 33 BLE Sense boards using the ArduinoBLE library.

Arduin-yo ho ho! A fairground favorite, the pirate ship is a fun way to explore the oscillation of a pendulum. How much fun, you ask? Access our Science Kit Physics Lab preview and see for yourself: http://bit.ly/2oC6L0Q

🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today: http://bit.ly/2MnQ7fr


OTR Links 07/27/2018


[adrotate banner=”6″]