Arduino Secret Knock Pattern Door Lock
Arduino Secret Knock Pattern Door Lock CIRCUIT DIAGRAM : MATERIALS : Arduino UNO / NANO Relay module 5V Solenoid Lock Speaker LED Resistor 220, 10k, 1M Push Button Wires Breadboard CODE : //Eliyas Science Info //Secret Knock Pattern Door Lock const int knockSensor = 0; const int programSwitch = 2; const int lockMotor = 3; const int redLED = 4; const int greenLED = 5; const int threshold = 3; const int rejectValue = 25; const int averageRejectValue = 15; const int knockFadeTime = 150; const int lockTurnTime = 2000; const int maximumKnocks = 20; const int knockComplete = 1200; int secretCode[maximumKnocks] = {50, 25, 25, 50, 100, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int knockReadings[maximumKnocks]; int knockSensorValue = 0; int programButtonPressed = false; void setup() { pinMode(lockMotor, OUTPUT); pinMode(redLED, OUTPUT); pinMode(greenLED, OUTPUT); pinMode(programSwitch, INPUT); Serial.begin(9600);...