This is an old revision of the document!


eSafe

Name: Dascalu Stefan-Nicolae
Group: 331CA

Introduction

eSafe is a digital lockbox implemented on an Arduino Uno. It uses a 4×4 matrix keypad for PIN entry, an SG90 servo for a mechanical latch, a DS1307 real-time clock (I²C) to enforce access windows, and a 16×2 I²C LCD to display status and time. Three wrong PIN attempts trigger an alarm tone and flashing red LED; valid entries drive the servo to unlock, light a green LED, and display “UNLOCKED.”

This project integrates functionalities from three labs:

  • Lab 2 (Interrupts & GPIO): keypad row-change detection
  • Lab 3 (Timers): debounce via Timer 2 CTC and alarm timing
  • Lab 6 (I²C): shared bus for LCD and RTC

Hardware Design

Below are both the abstract block diagram and the detailed wiring schematic with an Arduino Uno:

Note on Simulation vs. Real RTC

In Tinkercad I used a generic 7-segment I²C display; the real build uses the DS1307 module on the same SDA/SCL, so no rewiring or code changes are needed.

Hardware Functionality

  • Keypad: row-interrupt + Timer 2 CTC debounce
  • Buzzer: tone/noTone alarm, driven directly from Arduino pin
  • LEDs: status indicators with resistors
  • Servo: 50 Hz PWM; relocked non-blocking after 5 s
  • LCD/RTC: HD44780 via PCF8574; DS1307 battery-backed timekeeper
  • Power: on-board 5 V regulator (~500 mA); peak draw ~270 mA

Pin-out Detail

Component Interface Arduino pin Direction Rationale
Keypad row/col GPIO D2–D9 input Pin-change ISR on D2–D5; columns polled on D6–D9
Passive buzzer GPIO D11 output direct drive with tone()/noTone()
Red LED GPIO D13 output Built-in LED pin
Green LED GPIO D12 output Digital status LED (no PWM on D12)
Servo SG90 PWM D10 output attach() supports D10
LCD I²C I²C (TWI) A4/A5 bidir Hardware Wire bus
RTC DS1307 I²C (TWI) A4/A5 bidir Shares same TWI bus

Bill Of Materials

Photos of the eSafe project

esafe1.jpeg esafe2.jpeg esafe3.jpeg

Software Design

Implementation Status

  • Full feature set in ~200 lines of C++ on Arduino Uno
  • PIN entry, servo latch, LEDs, buzzer, I²C LCD & RTC, time window, unlock log
  • Stable on hardware; manual end-to-end tests completed

Library Choices

Library Purpose Justification
Wire / RTClib I²C + DS1307 Adafruit’s proven RTC driver
LiquidCrystal_I2C I²C LCD Minimal wiring, easy print interface
Keypad 4×4 scan + debounce handles interrupts + debouncing
Servo SG90 control official Arduino, simple API

Novelty Element

  • Time-lock feature enforcing business hours
  • Unlock log on LCD
  • Integration of multiple lab modules into one device

Development

  • Arduino IDE / PlatformIO

Core modules

  • `updateDisplay()`: live clock, PIN prompt/asterisks, last-unlock
  • `handleKey()`: ‘C’ clear, digit entry, ‘D’ submit with window check
  • `unlockDoor()`: unlock sequence + schedule non-blocking relock

Libraries

  • Wire/RTClib
  • LiquidCrystal_I2C
  • Keypad
  • Servo

Safety & Build Quality

- neat wiring on breadboard

- LEDs have 330 Ω current-limiting resistors

Conclusions

eSafe demonstrates integration of GPIO, interrupts, timers, PWM, and I²C into a user-friendly digital safe. Non-blocking design ensures smooth UI and reliable timekeeping.

Bibliography & Resources

pm/prj2025/eradu/stefan.dascalu2612.1747772981.txt.gz · Last modified: 2025/05/20 23:29 by stefan.dascalu2612
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