29
A Magnetic Door Lock employing Arduino Technology BY, SRAVANTHI RANI SINHA S

Magnetic door lock using arduino

Embed Size (px)

Citation preview

Page 1: Magnetic door lock using arduino

A Magnetic Door Lock employing Arduino Technology

 

BY,SRAVANTHI RANI SINHA S

Page 2: Magnetic door lock using arduino

• To sense the correctness of a secret code using the Arduino technology.

• When the correct code is entered through keypad, it lights a green LED in addition to operating a small solenoid.

A Magnetic Door Lock employing Arduino Technology

 

Page 3: Magnetic door lock using arduino

1. Arduino Introduction

2. Variety and Shields and Sensors

3. Applications

4. Design and Development of Magnetic DOOR lock

Page 4: Magnetic door lock using arduino

Arduino is a board

USB Port

Power Supply

Digital In/Out Pins

Analog Input Pins

Power Pins

Atmega328p

USB to Serial

Page 5: Magnetic door lock using arduino

Hardware Features

Microcontroller ATmega168Operating Voltage 5VInput Voltage (recommended) 7-12VInput Voltage (limits) 6-20VDigital I/O Pins 14 (of which 6 provide PWM output)Analog Input Pins 6DC Current per I/O Pin 40 mADC Current for 3.3V Pin 50 mA

Flash Memory 16 KB (ATmega168) or 32 KB (ATmega328) of which 2 KB used by bootloader

SRAM 1 KB (ATmega168) or 2 KB (ATmega328)EEPROM 512 bytes (ATmega168) or 1 KB (ATmega328)Clock Speed 16 MHz

Microcontroller ATmega168/ATmega328

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limits) 6-20V

Digital I/O Pins 14 (of which 6 provide PWM output)

Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory16 KB (ATmega168) or 32 KB

(ATmega328) of which 2 KB used by bootloader

SRAM1 KB (ATmega168) or 2 KB

(ATmega328)

EEPROM512 bytes (ATmega168) or 1 KB

(ATmega328)Clock Speed 16 MHz

Page 6: Magnetic door lock using arduino

BLOCK DIAGRAM OF ATMEGA MICROCONTROLLER

Page 7: Magnetic door lock using arduino

ATMEGA168 MICROCONTROLLERIts features includes:

• 23 general purpose I/O lines• 32 general purpose working registers• 3 flexible timer/counters with compare/capture/PWM mode, a SPI serial

port• 16K bytes of in-system programmable Flash with Read-while-Write

capabilities.• 512 bytes of EEPROM and 1K bytes SRAM.• In Idle mode CPU stops working while allowing the SRAM,

timers/counters, USART, SPI port and interrupt system to continue functioning.

• It also has 6 channel 10-bit ADC, a programmable watchdog timer with internal oscillator .

Page 8: Magnetic door lock using arduino
Page 9: Magnetic door lock using arduino
Page 10: Magnetic door lock using arduino
Page 11: Magnetic door lock using arduino

2. Arduino Variety, Shields and Sensors

Page 12: Magnetic door lock using arduino

Arduino Variety

Page 13: Magnetic door lock using arduino

Arduino Shield

Add-on module to extend arduino’s capabilities. Also called Daughterboard

or Cape

Page 14: Magnetic door lock using arduino

Shields

Page 15: Magnetic door lock using arduino

Communication Shields

RFIDEthernet WiFi

Bluetooth GPRS

GPS

Page 16: Magnetic door lock using arduino

Sensors

IR Thermometer Smoke Detector Pressure

Polar Heart Rate Sensor RTC pH Sensor

Page 17: Magnetic door lock using arduino

3. Applications

Page 18: Magnetic door lock using arduino

Heart Rate Monitor Interface

Page 19: Magnetic door lock using arduino

Arduino Electric Blindshttp://bitly.com/zfZT3H

Gear Motor

Page 20: Magnetic door lock using arduino

Barcode scanner

Page 21: Magnetic door lock using arduino

Lego and Arduino

NXShield

http://bitly.com/wLBvY0

Page 22: Magnetic door lock using arduino

Design and Development of Magnetic Door lock

COMPONENTS AND EQUIPMENT

• Arduino Diecimila or Duemilanove board or clone

• D1 Red 5-mm LED• D2 Green 5-mm LED• R1-3 270 resistor• K1 4 x 3 keypad• 0.1-inch header strip• T1 BC548• 5V solenoid (< 100 mA)• D3 1N4004

Page 23: Magnetic door lock using arduino

The schematic diagram

Page 24: Magnetic door lock using arduino

The Bread Board Layout

Page 25: Magnetic door lock using arduino

The software for this project#include <Keypad.h>#include <EEPROM.h> char* secretCode = "1234";int position = 0;boolean locked = true;const byte rows = 4;const byte cols = 3;char keys[rows][cols] = {{'1','2','3'},{'4','5','6'},{'7','8','9'},

{'*','0','#'}};byte rowPins[rows] = {2, 7, 6, 4};byte colPins[cols] = {3, 1, 5};Keypad keypad = Keypad(makeKeymap(keys), rowPins,

colPins, rows, cols);int redPin = 9;int greenPin = 8;int solenoidPin = 10; void setup() {pinMode(redPin, OUTPUT);pinMode(greenPin, OUTPUT);loadCode();flash();updateOutputs(); }

void loop(){char key = keypad.getKey();if (key == '*' && ! Locked) {// unlocked and * pressed so change codeposition = 0;getNewCode();updateOutputs(); }if (key == '#‘){locked = true;position = 0;updateOutputs(); }if (key == secretCode[position]){position ++;}if (position == 4){locked = false;updateOutputs();}delay(100);}

Page 26: Magnetic door lock using arduino

void updateOutputs(){if (locked){digitalWrite(redPin, HIGH);digitalWrite(greenPin, LOW);digitalWrite(solenoidPin, HIGH);}else{digitalWrite(redPin, LOW);digitalWrite(greenPin, HIGH);digitalWrite(solenoidPin, LOW);}}

void getNewCode(){flash();for (int i = 0; i < 4; i++ ){char key;key = keypad.getKey();while (key == 0){key = keypad.getKey();}flash();secretCode[i] = key;}saveCode();flash();flash();}

void loadCode(){if (EEPROM.read(0) == 1){secretCode[0] = EEPROM.read(1);secretCode[1] = EEPROM.read(2);secretCode[2] = EEPROM.read(3);secretCode[3] = EEPROM.read(4);}} void saveCode(){EEPROM.write(1, secretCode[0]);EEPROM.write(2, secretCode[1]);EEPROM.write(3, secretCode[2]);EEPROM.write(4, secretCode[3]);EEPROM.write(0, 1);} void flash(){digitalWrite(redPin, HIGH);digitalWrite(greenPin, HIGH);delay(500);digitalWrite(redPin, LOW);digitalWrite(greenPin, LOW);}

Page 27: Magnetic door lock using arduino

Putting It All Together

Page 28: Magnetic door lock using arduino

Conclusion and future scope

• A Magnetic Door Lock employing Arduino technology is presented. we have implemented a fail safe maglock ,fail secure maglock also can be implemented.

• Instead of keypad Reader using the variety of sensors and shields various combinations of Magnetic Door Lock can be produced and installed according to the requirements of any Industry.

Page 29: Magnetic door lock using arduino

References• http://arduino.cc/• ITP Physical Computing• http://www.ladyada.net• http://www.sparkfun.com• http://www.openlabtaipei.org/ (Openlab Taipei)• http://seeedstudio.com• http://coopermaa2nd.blogspot.com

Thank you,Sravanthi Rani Sinha s

(09BD1A04A0)