This is an old revision of the document!
Author: Gabriela Alecu
Master: AAC2
The system intends to help in recognizing the identity of the person that rings a doorbell. It has two main components: a Raspberry pi that does the image capturing and image processing, and an Arduino Uno, that displays the name of the person and is connected to the locking mechanism. This is just a prototype built into a box designed with a 3D printer specifically for testing.
// clear the screen with a black background TFTscreen.background(0, 0, 0); // write the static text to the screen // set the font color to white TFTscreen.stroke(255, 255, 255); // set the font size TFTscreen.setTextSize(2); // write the text to the top left corner of the screen, 20 rows below the top TFTscreen.text("e la usa!\n ", 0, 20); // ste the font size very large for the loop TFTscreen.setTextSize(2);
if (Serial.available() > 0) { //Erase the previous first line of the screen TFTscreen.stroke(0, 0, 0); //Write the name again because, if not, sometimes the screen would get black TFTscreen.text(personName, 0, 0); //Read name from serial String name = Serial.readStringUntil('\n'); if (name == "Gabi"){ open_door(); } else{ //Convert from string to Char Array so the print function of the screen works name.toCharArray(personName, name.length()+1); // print the sensor value TFTscreen.text(personName, 0, 0); } }
void open_door(){ digitalWrite(LED_PIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(5000); } if (buttonState == LOW) { open_door(); } else { digitalWrite(LED_PIN, LOW); // turn the LED off by making the voltage LOW }
The raspberry pi has been configured using Facial recognition guide, and it uses code provided by this git repository, that uses the OpenCV library for the facial detection.