Wednesday, June 12, 2024

Smart home door lock RFID card sistem menggunakan arduino Uno, serta sensor suara untuk menyalakan lampu

 

Components Required:

  • Arduino Uno
  • SG90 servo motor
  • RFID module (e.g., RC522)
  • Sound sensor (e.g., KY-038 or similar)
  • LED light
  • LCD 16x2 with I2C module
  • Breadboard and jumper wires
Bisa dibeli di meteor store Purwokerto robotika pusat jual arduino sensor iot nodemcu esp 32 dipurwokerto, Cilacap, Kroya, Banyumas, Purbalingga Bumiayu kebumen dan sekitarnya 





Wiring:
RFID Module (RC522):
SDA to pin 10
SCK to pin 13
MOSI to pin 11
MISO to pin 12
IRQ to not connected
GND to GND
RST to pin 9
3.3V to 3.3V

SG90 Servo Motor:
VCC to 5V
GND to GND
Signal to pin 3

Sound Sensor:
VCC to 5V
GND to GND
Digital output to pin 4

LED Light:
Anode (+) to a current-limiting resistor (220Ω recommended) to digital pin 5
Cathode (-) to GND

LCD 16x2 with I2C Module:
SDA to A4
SCL to A5

Libraries Required:
MFRC522 library for RFID
Servo library for servo motor
LiquidCrystal_I2C library for the LCD
You can install these libraries through the Arduino IDE Library Manager (Sketch -> Include Library -> Manage Libraries).

Program dapat didownload di link berikut 


Explanation:
Include Libraries:

SPI.h and MFRC522.h for the RFID module.
Servo.h for controlling the servo motor.
Wire.h and LiquidCrystal_I2C.h for the LCD.

Define Pins:

Pins for RFID module, sensors, and LED.
Setup Function:

Initialize serial communication, SPI bus, RFID module, servo motor, and LCD.
Set initial states for sensors and LED.

Loop Function:

Continuously check for new RFID cards.
If an authorized card is detected, move the servo to open the door and display a message on the LCD.
If an unauthorized card is detected, display an error message on the LCD.
Continuously check the sound sensor for sound detection and turn on the LED and display a message on the LCD if sound is detected. The LED stays on for 5 seconds and then turns off.
Helper Function:

isAuthorized function compares the detected UID with the predefined authorized UID.

Notes:
Replace the authorizedUID array with your actual RFID card's UID.
Adjust the servo angles and delays as needed for your specific setup.
Ensure the sound sensor's digital output logic is correct (e.g., HIGH indicates sound detected).

Kunjungan Meteor store Purwokerto info lebih lanjut kontak me


No comments:

Post a Comment