Android Controlled Door Latch System
Introduction
A low cost Door Latch System which can be control using an Android App and it even shows you the status of the door if it is open or closed in real time.
Technology Stack
- Firebase
- Android
- NodeMCU/Arduino Programming
Harware Components
- NodeMCU
- Jumpers
- Breadboard
- Power Supply 12V and 5V both
- Reed Switch
- Magnets (we used Neodymium Magnets)
- Solenoid Latch
- Relay Module
- USB to Micro USB cable
- Multimeter (not necessary but it was handy to quickly check some connections)
Circuit Diagram
NodeMCU Pinout
Complete Circuit
Libraries
1. ESP8266HTTPClient
2. WiFiClientSecure
3. ESP8266WebServer
4. ArduinoJson
5. FirebaseArduino (v5.0 used in earlier version)
Steps to make this prototype
- Download and install an Arduino IDE
- Install above listed libraries
- Go to File > Preferences. In the “Additional Boards Manager URLs” field, type (or copy-paste) http://arduino.esp8266.com/stable/package_esp8266com_index.json. Don’t forget to click OK!
- Then go to Tools > Board > Board Manager. Type “esp8266” in the search field. The entry “esp8266 by ESP8266 Community” should appear. Click that entry and look for the install button on the lower right.
- Select appropriate Board in Tools > Board and appropriate Port.
- Set up Firebase Project
- Upload the code in
DoorLatch.ino
after making necessary changes especially the which are labelled like - Make the connections as shown in the circuit diagram.
- Make sure that the hotspot is on.
Video
Key Lessons Learnt
- Old Relays (shown in picture) turns on when Input Pin is HIGH while the new Relays turns on when the Input Pin is LOW.
- Difference between HTTPS and HTTP in case of using native firebase APIs