Promo Video: https://youtu.be/SJe7rN5sQgk
Abstract:
The Super Duper Security Super System (SDSS) uses a series of sensors and locks to keep you safe and sound. The system is composed of a sensor that analyzes the voice and unlocks the door when a special key word is said. If the key word is incorrect or it is a guest, the SDSS will take a picture of the person as the door opens and send it as a text message to the owner of the room. This system could also be implemented in lockers, drawers and safe boxes amongst many other things.
This project came to mind in order to make the dorms and storage drawers inside of the dorm safer. For example, in Gabriel’s case, his dorm’s door does not completely close or gets locked. The Super Duper Security SuperSystem would perfectly solve the problem.
The system is composed of 3 modules: a motor that serves as a lock, a ping sensor to detect the movement of the door/ drawer, and a camera that will either take pictures or live stream the people who go through the door. The modules are pieced together by bluetooth and a hardwire cable that sends the signal to the camera module if the door is opened. The ping sensor uses sonar to determine if the door has been opened. This then sends a signal to the camera module. All 3 modules use Arduino to implement some code to employ some simple logic and complexity.
A couple of things we learned was how to connect the camera to the Arduino as well as making the motor move 90 degrees and after 2 seconds go to its original position. Connecting the camera to the Arduino gave us a lot of trouble. Initially, we had an incorrect camera that would not work with Arduino. Later, we got the correct camera and hardwired it correctly. The issue appeared when we had to download the code from online. We followed a tutorial to download a code that would make the camera connect to the Arduino. However, the code was partially incorrect, and it took a long time for us to debug it. Another problem appeared when we had to connect the camera and the ping sensor through Wi-Fi. We were thinking for the ping sensor to detect were the door was and depending on where the door was it will send a signal through Wi-Fi to the camera and the camera would automatically take the picture. We could not achieve that. Therefore, we decided to connect the camera and the ping sensor through Bluetooth, and depending on the position of the door, and LED next to the camera would light up and a person would manually take a picture or record the scene.
What we could include next for the project could be than instead of the lock opening just when a button gets pressed, maybe we could use the finger print or integrate MatLab with Arduino so when a person says a specific word the lock opens.
Code:
Module 2: Ping Sensor - hardwire define trigPin 12 define echoPin 13 void setup() { Serial.begin (9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(8, OUTPUT); } void loop() { long duration, distance; digitalWrite(trigPin, LOW); // start trig at 0 delayMicroseconds(2); digitalWrite(trigPin, HIGH); //The rising edge of trig pulse delayMicroseconds(10); // decides duration of trig pulse digitalWrite(trigPin, LOW); //falling edge of the trig pulse // NOTE: echo pin reads HIGH till it receives the reflected signal duration = pulseIn(echoPin, HIGH); // Reading the duration for which echoPin was HIGH gives //the time the sensor receives a reflected signal at the echo pin //you distance = (duration / 2) / 29.1; Serial.println(distance); if ( distance < 20) { digitalWrite(8, HIGH); } else { digitalWrite(8, LOW); } }
Module 2: Ping Sensor - bluetooth
include define trigPin 12 define echoPin 13 SoftwareSerial BTSerial(2, 3); const int button = 8; //added int val = 0;
void setup() {
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(8, OUTPUT);
BTSerial.begin(9600);
}
void loop() { long duration, distance; digitalWrite(trigPin, LOW); // start trig at 0 delayMicroseconds(2); digitalWrite(trigPin, HIGH); //The rising edge of trig pulse delayMicroseconds(10); // decides duration of trig pulse digitalWrite(trigPin, LOW); //falling edge of the trig pulse // NOTE: echo pin reads HIGH till it receives the reflected signal duration = pulseIn(echoPin, HIGH); // Reading the duration for which echoPin was HIGH gives //the time the sensor receives a reflected signal at the echo pin //you distance = (duration / 2) / 29.1; Serial.println(distance); if ( distance < 20) { digitalWrite(8, HIGH); } else { digitalWrite(8, LOW);
} val = digitalRead(echoPin); if(val == HIGH) { BTSerial.print("H"); Serial.println("H"); } else if(val == LOW) { BTSerial.print("L"); Serial.println("L"); } delay(100); }
Module 3 - Camera - Arducam Library must be downloaded
ifndef MEMORYSAVER define MEMORYSAVER
//Only when using raspberry,enable it //#define RASPBERRY_PI
//There are two steps you need to modify in this file before normal compilation //Only ArduCAM Shield series platform need to select camera module, ArduCAM-Mini series platform doesn't
//Step 1: select the hardware platform, only one at a time //#define OV2640_MINI_2MP //#define OV3640_MINI_3MP //#define OV5642_MINI_5MP //#define OV5642_MINI_5MP_BIT_ROTATION_FIXED //define OV2640_MINI_2MP_PLUS define OV5642_MINI_5MP_PLUS //#define OV5640_MINI_5MP_PLUS
//#define ARDUCAM_SHIELD_REVC
//#define ARDUCAM_SHIELD_V2
//Step 2: Select one of the camera module, only one at a time if (defined(ARDUCAM_SHIELD_REVC) || defined(ARDUCAM_SHIELD_V2)) //#define OV7660_CAM //#define OV7725_CAM //#define OV7670_CAM //#define OV7675_CAM //#define OV2640_CAM //#define OV3640_CAM //#define OV5642_CAM //#define OV5640_CAM
//#define MT9D111A_CAM
//#define MT9D111B_CAM
//#define MT9M112_CAM
//#define MT9V111_CAM
//#define MT9M001_CAM
//#define MT9V034_CAM
//#define MT9M034_CAM
//#define MT9T112_CAM
//#define MT9D112_CAM
endif
endif //MEMORYSAVER
Module 3 - Camera with bluetooth include SoftwareSerial BTSerial(2, 3); //TX RX int led = 9; void setup() { BTSerial.begin(9600); //begin bluetooth communication Serial.begin(9600); //begin serial communication pinMode(led, OUTPUT); } void loop() { if (BTSerial.available()) { char inChar = (char) BTSerial.read(); //reads single character at a time if(inChar == 'L') { digitalWrite(led, LOW); } else if(inChar == 'H') { digitalWrite(led, HIGH); } Serial.println(inChar); } }
Module 1 - lock include const int buttonPin = 13; const int ledPin = 5; int buttonState = 0; Servo servoRight; Servo servoLeft; void setup() { // put your setup code here, to run once:
Serial.begin(9600); pinMode(buttonPin, INPUT); pinMode(ledPin, OUTPUT); }
void loop() {
// put your main code here, to run repeatedly:
buttonState = digitalRead(buttonPin);
Serial.println(buttonState);
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
servoRight.attach(6);
servoRight.write(90);
delay(2000);
servoRight.write(0);
}
else if (buttonState == LOW) {
digitalWrite(ledPin, LOW);
} }

Log in or sign up for Devpost to join the conversation.