loading

Do you ever leave your key under doormat or other hidden place so another family member can open the door?

or when you arrive at your office and realize your door hasn't been locked.

what if another person open your door using the key that you leave.

That's not safe.

Androino Doorlock have the solution.

you can lock and unlock your door using RFID card or your Android.

Just install the app in your android, so you can check your door condition and you can lock or unlock your door whenever and wherever you are.

what you need is:

Hardware:

  • NodeMCU v3 Lolin (ESP8266 module)
  • RC522 (RFID module)
  • Relay module
  • Selenoid Doorlock
  • Power Supply 12V
  • LM2596 (DC-DC converter module)
  • Jumper Cable
  • USB to microUSB cable
  • Android Smartphone

Software:

  • Arduino
  • NodeMCU Flasher Master
  • Notepad ++
  • FileZilla
  • Browser

Step 1: Connect and Flash NodeMCU V3

If you already install driver and flashing NodeMCU just skip this step, otherwise you should read this step to get things ready.

If you are using NodeMCU v3, you must install CH340 Driver.

Open link and click download, you should get zip file. Extract file and run the setup.exe and simply click install.

Check your device manager to assure your NodeMCU is connected.

After you can see NodeMCU in device manager download NodeMCU Flasher Master from GitHub.

Open NodeMCU Flasher Master, set the NodeMCU port and just click flash.

Step 2: Wiring

Connect NodeMCU with RC522 module.

RC522======>NodeMCU

SS======>GPIO16

SCK======>GPIO14

MOSI======>GPIO13

RST======>RST

VCC======>3.3

GND======>GND

i have read so many tutorial about how to connect RC522 to NodeMCU. Many of them connect RST pin of RC522 to to GPIO pin, but after i try RFID wont read any card, so i move the jumper to RST rather than GPIO pin.

After that connect relay module to another available GPIO in this case i use GPIO5.

Step 3: Get Your Own Domain

In this tutorial i use 000webhost as a server for Androino Doorlock.

If you already have your own domain you can also use your domain as a server.

Download Notepad++ and write this code

<? php

	$var1=$_GET["variable1"];
	
	$api=$_GET["api_key"];
	
	$api_key_var="ZXC321ASD";
	
	if(!strcmp($api_key_var,$api))
	{
		$fileContent ="Variable1=".$var1."\r";
		$fileStatus= file_put_contents('web.html',$fileContent);
		if($fileStatus!=false)
		{
			echo "Success: data written to file \n\r";
		}
		else
		{
			echo "Fail: try again \n\r";
		}
	}
	else
	{
		echo "Fail: wrong api key \n\r";
	}
? >

Then save it to YourFileName.php.

After that open FileZilla then login to the server, then upload YourFileName.php to your website.

The API key is up to you, i just randomly write the API key.

$var1=$_GET["variable1"]; this syntax is to get value from entered link

the program will search what value after text variable1 and store it to variable "var1".

this program is case sensitive.

example:

if we enter this link in our browser

yourweb.com/YourFileName.php?variable1=100 -----> var1 value is 100.

yourweb.com/YourFileName.php?variable1=3 -----> var1 value is 3.

yourweb.com/YourFileName.php?variablE1=100 -----> var1 value is empty.

-------------------------------------------------------------------------------------------------------

after variable var1 get the value, then php file will generate file in this case web.html

you should see web.html in your FileZilla if the file succesfully generated.

the content of web.html is depend from this syntax:

$fileContent ="Variable1=".$var1."\r";

so if you call this link yourweb.com/YourFileName.php?variable1=3

then this link yourweb.com/web.html

your should see Variable1=3

Step 4: AppInventor

Open AppInventor, Make new project and write name of your project (this will be your app name).

after you create project you will see designer page, all you need is:

  • Label x2
  • Button x1
  • Canvas x1
  • ImageSprite x2
  • Web x2
  • Clock x1

After that upload lock and unlock image, you can download from file below.

Designer setting:

  1. Canvas
    • Width : 100 %
    • Height : 50%
  2. Image Sprite
    • X: 50
    • Y: 0

Then go to block and follow the picture above.

Step 5: Program + Testing

Make sure you has downloaded ESP8266 Board and RC522 library.

i use NodeMCU 1.0 (ESP-12E Module), 80Mhz, 115200, 4M.

download the program below and upload it to NodeMCU.

Thanks for your attention.

write in the comment if you want to ask.

Vote Me... :)

<p>amazing ,stil doing it, soon</p>
<p>You are realy an Inventor,</p><p> I am in love with this IBLE.</p><p>I have al the parts ordered and hope i can get it to work like you did.</p><p>i was amazed how cool Arduino gets when the quarter finally drops in your head.(my head ) but you are on 100% of Arduino knowledge, and i on 20/30%.</p><p>But it's finally climbing higher after 1 year</p><p>o yes i got 2 NODEMCU boards the first version and the V3 and is much larger.</p><p>Wider is beter to say.</p><p>are they exact the same?? and if not , whats the difference? if i may ask.</p><p>yes you rock</p><p>WannaDuino!!!</p>
<p>Thanks a lot. :)</p><p>im not 100% of Arduino knowledge, i just want to share what i learnt to other people so it can be useful.</p><p>the difference between NodeMCU first version and the V3 is in pin configuration V3 has addition pin VUSB, V3 use CH340 to comunicate with PC while NodeMCU use CP2102.</p>
<p>I loved this project. realy realy its good idea. <br>do you know ı will do this project why ?<br>because someone comin to my home and in garden they taked my chicken :(<br>wh they taked our chicken why ? if ı will see them ı will fight them ı am sure<br>thank you very much</p>
<p>use a wifi alarm camera from BANGGOOD i got it to. it records when somebody enters your space. and you can change al the parameters.</p><p>it comes with an APP android and ios and even for windows.</p><p> it has even a baby phone function, so if you see somebody, you can yell or talk to them. from anywhere in the world.</p><p>and is super cheap, good for the chickens friend. </p><p>http://www.banggood.com/Digoo-BB-M1-Wireless-WiFi-USB-Baby-Monitor-Alarm-Home-Security-IP-Camera-HD-720P-Two-Way-Audio-p-1083520.html?rmmds=myorder</p>
<p>Thanks you, i hope with this project can help you to prevent your chicken stoled.</p><p>you can also put a sensor like PIR sensor(motion sensor) and send the data to your website and show the data to your android.</p><p>since this project use your own website, you can send data without delay(real-time) not like other IoT server provider that require delay for sending the data.</p><p>dont forget to vote me.</p><p>:)</p>
<p>Nice Instructable. I will try this.</p><p>But I cannot figure out in which method of the arduino Code you store the rfid codes? </p><p>Can you explain this?</p><p>Thank you.<br></p>
<p>have you downloaded my program?</p><p>if you already download, goto line number 192,thats subroutine to store RFID in EEPROM.</p><p>in line number 163 is to find stored RFID card in EEPROM</p><p>RFID card store information that call nuid</p><p>example</p><p>A7 E2 55 1B</p><p>that nuid will stored in 4 EEPROM register in this program i use register address 1000 to store A7</p><p>1001 E2</p><p>1002 55</p><p>1003 1B so on.....</p><p>if you already install RC522 library, you can find this program in example RC522 - servo_motor.</p><p>dont forget to vote me...</p><p>:)</p>
<p>Thank you for your reply. </p><p>Now I see it. </p><p>At each Start you can register new Cards. Thats clever :-)</p><p>Have'nt tried it on my NodeMCU. But now it is clearer to me. </p>
<p>Very good Idea, control your doors from anywhere.</p>

About This Instructable

6,750views

154favorites

More by ekhiw:IoT : Androino Doorlock Programming ATmega16A using arduino IDE 
Add instructable to: