Skip to content

PUT-PTM/KnockDetector

Repository files navigation

KnockDetector

Overview

Mechanism which protects the door from intruders with a lock that will only open when it hears one of the secret knocks set by authorized users of Android application.

Description

The division of duties was split to several controllers. Each of them has an important function in the project.

Detector controller

Reads analog signal from operational amplifier connected with buzzer. Normal values oscilates above Detector_Threshold. If readed value is under Detector_Threshold this means somebody knocks to the door and then controller start to listen to secret knock code. After three seconds of last exceedion controller validates secret code with algorithm comparing sequence of knocks with recorded code sequences in data stored in the database.

Database controller

Loads data from SD card into memory and manages users and secret codes according to commands from detector controller and bluetooth controller. After every change on data it saves file on memory card. By default, can store up to 20 users. Number of users can be extended in Database_Parameters.h.

Bluetooth controller

Receives commands from mobile application, executes them on microcontroller and sends response with OK or ERROR to application. Basic functionalities are: add/delete user, change secret code(record new one), send database to mobile application.

LED controller

Receives commands from detector controller and according to the result of validation lights red or green. Also lights red when person is knocking the door.

Lock controller

After receiving Unlock command from Detector controllers sends signal to engine to open the door. Similarly, after receiving Lock command from Bluetooth controller locks the door.

Main controller

Tools

Hardware

  • STM32F4 DISCOVERY with USB cable
  • Bluetooth module
  • SD module
  • Android mobile phone(for Android application)

Electronic components

  • Piezo speaker(buzzer)
  • LED diodes: green, red
  • 12V DC motor
  • Resistors: 1 x 10 Mega Ohms, 2 x 220 Ohms
  • Printed circuit board

Power supply

  • 12V(+5V wire) Power supply

Software

  • System Workbench for STM32
  • STM Studio (optional, for debugging buzzer values)

How to run

Wire Connections

  • Bluetooth module.
STM32F4 DISCOVERY Bluetooth module
5V VCC
GND GND
PC10 RXD
PC11 TXD
  • SD module.
STM32F4 DISCOVERY SD module
3V 3V3
GND GND
PB11 CS
PB13 SCK
PB14 MISO
PB15 MOSI
  • Lock. In the picture not all wires are correctly connected.

STM32F4 DISCOVERY H bridge Power Supply Engine
PA1 IN1 - -
PA2 IN2 - -
- OUT1 - IN1
- OUT2 - IN2
- 12V 12V -
5V 5V 5V -
GND GND GND -
  • Operational amplifier and buzzer.

STM32F4 DISCOVERY Operational amplifier LM358N
3V V+ (8)
GND GND (4)
PA0 Output A (1)

  • LED Diodes.
STM32F4 DISCOVERY Diodes
PA6 GREEN
PA7 RED
GND shared GND

Printed circuit board

How to compile

Microprocessor program

1️⃣ Clone repository to your machine.
2️⃣ Connect STM32F4 DISCOVERY to your PC using USB wire.
3️⃣ Build project in System Workbench for STM32.
4️⃣ Run project on your STM32F4 from Workbench.

Android application

Future improvements

✔️ Final version RELEASED on 8th July 2018

⚠️ This project will no longer be developed

Known issues

Lock/Unlock mechanism is not fully implemented. Programmer has to adjust time for locking and unlocking according to lock and power of engine
SD module controller is not correctly implemented. Functions cause errors writing to/reading from SD card.
Thresholds set in detector controller and algorithm may not work properly. Can generate false negatives

Attributions

  • FatFS library for SD module (library files are mixed with project logic files in inc and src folders)

License

License

Credits

The project was conducted during the Microprocessor Lab course held by the Institute of Control and Information Engineering, Poznan University of Technology.

Contractors: Szymon Bandowski, Przemysław Czajka, Jakub Dąbrowski

Supervisor: Tomasz Mańkowski

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published