IoT : Androino Doorlock




Intro: IoT : Androino Doorlock

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:


  • 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


  • 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.








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

		$fileContent ="Variable1=".$var1."\r";
		$fileStatus= file_put_contents('web.html',$fileContent);
			echo "Success: data written to file \n\r";
			echo "Fail: try again \n\r";
		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.


if we enter this link in our browser -----> var1 value is 100. -----> var1 value is 3. -----> 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

then this link

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... :)



    • Metalworking Contest

      Metalworking Contest
    • Audio Contest 2018

      Audio Contest 2018
    • Furniture Contest 2018

      Furniture Contest 2018

    14 Discussions


    10 months ago

    nice project!! really helpfull for people, hopefully i can try this


    1 year ago

    Thanks for this Tutorial! I was looking for the pinout from RC522 to LOLIN, this was quite helpful - Eeeexcept that in step 2 you forgot the MISO line which must be connected to GPIO12. ;)

    1 reply

    Reply 1 year ago

    Thanks for your correction
    i hope this tutorial helpful for you...


    1 year ago

    Real good project, thanks for posting


    1 year ago

    amazing ,stil doing it, soon


    1 year ago

    You are realy an Inventor,

    I am in love with this IBLE.

    I have al the parts ordered and hope i can get it to work like you did.

    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%.

    But it's finally climbing higher after 1 year

    o yes i got 2 NODEMCU boards the first version and the V3 and is much larger.

    Wider is beter to say.

    are they exact the same?? and if not , whats the difference? if i may ask.

    yes you rock


    1 reply

    Reply 1 year ago

    Thanks a lot. :)

    im not 100% of Arduino knowledge, i just want to share what i learnt to other people so it can be useful.

    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.


    1 year ago

    I loved this project. realy realy its good idea.
    do you know ı will do this project why ?
    because someone comin to my home and in garden they taked my chicken :(
    wh they taked our chicken why ? if ı will see them ı will fight them ı am sure
    thank you very much

    2 replies

    Reply 1 year ago

    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.

    it comes with an APP android and ios and even for windows.

    it has even a baby phone function, so if you see somebody, you can yell or talk to them. from anywhere in the world.

    and is super cheap, good for the chickens friend.


    Reply 1 year ago

    Thanks you, i hope with this project can help you to prevent your chicken stoled.

    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.

    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.

    dont forget to vote me.



    1 year ago

    Nice Instructable. I will try this.

    But I cannot figure out in which method of the arduino Code you store the rfid codes?

    Can you explain this?

    Thank you.

    2 replies

    Reply 1 year ago

    have you downloaded my program?

    if you already download, goto line number 192,thats subroutine to store RFID in EEPROM.

    in line number 163 is to find stored RFID card in EEPROM

    RFID card store information that call nuid


    A7 E2 55 1B

    that nuid will stored in 4 EEPROM register in this program i use register address 1000 to store A7

    1001 E2

    1002 55

    1003 1B so on.....

    if you already install RC522 library, you can find this program in example RC522 - servo_motor.

    dont forget to vote me...



    Reply 1 year ago

    Thank you for your reply.

    Now I see it.

    At each Start you can register new Cards. Thats clever :-)

    Have'nt tried it on my NodeMCU. But now it is clearer to me.


    1 year ago

    Very good Idea, control your doors from anywhere.