Skip to content
Snippets Groups Projects
Commit 8799b091 authored by Evan Jones's avatar Evan Jones
Browse files

UPDATED COMMIT

parent 0f145974
No related merge requests found
Showing
with 96 additions and 6 deletions
README.md 100755 → 100644
# Raspberry Pi 4 Facial Recognition
Full Tutorial posted - https://www.tomshardware.com/how-to/raspberry-pi-facial-recognition
# Smart Doorbell System – Raspberry Pi Project
![RaspberryPi Facial Rec](https://github.com/carolinedunn/facial_recognition/blob/main/photo/screenshot.png)
This project is a **smart doorbell system** built on a Raspberry Pi using the GrovePi sensor kit and Python. It combines motion detection, light sensing, and a physical doorbell button to trigger notifications via visual, audio, and cloud-based channels. It also includes **mock hardware modules and a full unit test suite**, allowing for development and testing without physical hardware.
---
## Features
- Motion detection (PIR sensor)
- Light level detection for night/day logic
- Button press detection (doorbell trigger)
- LCD display (scrolling messages)
- Audio buzzer notifications
- Visual and MQTT (Thingsboard) notifications
- Fully testable with mocked GPIO and MQTT clients
- Modular code structure for clarity and reusability
---
## Project Structure
doorbellSystem/
├── doorbell/# Core application logic
├── config.py
├── display.py
├── mqtt_client.py
├── notifier.py
├── sensors.py
├── utils.py
└── main.py
├── mocks/ # Mocked hardware interfaces
├── mock_gpio.py
├── mock_lcd.py
└── mock_mqtt.py
├── tests/ # Unit tests for all major components
├── test_button.py
├── test_light.py
├── test_motion.py
├── test_display.py
└── test_mqtt.py
├── run_tests.py # Script to run the full test suite
└── README.md # You're reading this!
---
## Running the program
This project must be run as a module
python -m doorbell.main
## Running the Test Suite
This project uses Python’s `unittest` framework with custom hardware mocks for offline/local testing.
# 1. Enable Mock Mode
In `doorbell/config.py`, make sure this is set: MOCK_MODE = True
# 2. Run the Tests
From the root folder: python run_tests.py
# 3. Verify Output
Example Output
csharp
Copy
Edit
[TEST] Reading motion sensor on pin 4
[MOCK GPIO] digitalRead(4)
Motion detected: True
[TEST] Reading light level on pin 1
[MOCK GPIO] analogRead(1)
Light level: 412
...
----------------------------------------------------------------------
Ran 6 tests in 0.01s
OK
All tests should return ok if the system is working correctly.
Unit Test Coverage
Test File Description
test_button.py Verifies mock button returns expected values
test_motion.py Checks mock motion sensor readings
test_light.py Validates light value range + night mode threshold
test_display.py Ensures LCD accepts and displays messages
test_mqtt.py Tests MQTT connection and telemetry sending
Materials: Raspberry Pi 4 and Webcam
![RaspberryPi Facial Rec](https://github.com/carolinedunn/facial_recognition/blob/main/photo/webcamandRPi4.JPG)
Full Tutorial posted - https://www.tomshardware.com/how-to/raspberry-pi-facial-recognition
File moved
# Raspberry Pi 4 Facial Recognition
Full Tutorial posted - https://www.tomshardware.com/how-to/raspberry-pi-facial-recognition
![RaspberryPi Facial Rec](https://github.com/carolinedunn/facial_recognition/blob/main/photo/screenshot.png)
Materials: Raspberry Pi 4 and Webcam
![RaspberryPi Facial Rec](https://github.com/carolinedunn/facial_recognition/blob/main/photo/webcamandRPi4.JPG)
Full Tutorial posted - https://www.tomshardware.com/how-to/raspberry-pi-facial-recognition
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment