Make Arduino Powered Digital Number Lock : Lockduino

Lockduino-electronics-lock

Now take out your Arduino to make a new Project,Lets make Digital Combinational Number lock to protect your house and things from Introducers.

The project was submitted by 15 year old Electronic hobbyist at Instructables,The lock is controlled by 4 potentiometers and a pushbutton.Watch the working below

Components Required

  • Arduino
  • 1 Micro servo
  • 1 Green LED
  • 1 Red LED
  • 2x 350 ohm reistors
  • 10k ohm resistor
  • 4x 10k (or 50k) micro potentiometers (the higher the resistance the better)
  • Perf board
  • Momentary pushbutton
  • 2.54 cm. pin headers
  • Insulated jumper wire
  • Heat shrink
  • Ribbon Cable
  • 9v battery and clip
  • 4 AAA battery holder

Construction

Here is a list of 11 construction steps at Instructables,Well illustrated and explained.

Arduino Sketch


#include<Servo.h>
int redLED = 12;
int greenLED = 13;
int button1 = A4;
int buttonState = 0;

Servo myservo;

void setup()
{
 pinMode(redLED, OUTPUT);
 pinMode(greenLED, OUTPUT);
 pinMode(button1, INPUT);
 myservo.attach(9);
}

void loop()

{
 buttonState = digitalRead(button1);

 int analog1 = analogRead(A0);
 int pot1 = analog1 * (10.0 / 1023.0);
 int analog2 = analogRead(A1);
 int pot2 = analog2 * (10.0 / 1023.0);
 int analog3 = analogRead(A2);
 int pot3 = analog3 * (10.0 / 1023.0);
 int analog4 = analogRead(A3);
 int pot4 = analog4 * (10.0 / 1023.0);

if (pot1 == 4 && pot2 == 5 &&
 pot3 == 6 && pot4 == 1)
 {
 digitalWrite(greenLED, HIGH);
 digitalWrite(redLED, LOW);
 myservo.write(90);
 }

else if (buttonState == HIGH)
 {
 digitalWrite(greenLED, HIGH);
 digitalWrite(redLED, LOW);
 myservo.write(90);
 delay(5000);
 }

else
 {
 digitalWrite(greenLED, LOW);
 digitalWrite(redLED, HIGH);
 myservo.write(170);
 }

}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>