The coronavirus pandemic has changed our daily lifestyle, as protection of oneself from this virus include wearing of masks, regular cleaning of hands, etc. The virus is notable for spreading easily through cough drops in the air, touching of common surfaces including currency, elevator buttons, doorbells, etc.
This project demonstrates the implementation of Bolt IoT in any commercial elevator, enabling users to control it using their smartphone, in an attempt to reduce the touching of the elevator buttons.
To start, the connections to the Arduino are:
Step 1:Connection to Bolt IoT
Step 1.1: Connect the RX0 pin (pin 0) of Arduino to TX pin of the Bolt
Step 1.2: Connect the TX0 pin (pin 1) or Arduino to RX pin of the Bolt
Step 2: Connection to push buttons:
Step 2.1: Connect pin 24 of Arduino to one end of Ground floor button, the same end of the button will be connected to ground via a 1k Ohm resistor. Connect the other end of the button to 5V supply.
Step 2.2: Connect pin 25 of Arduino to one end of floor 1 button, the same end of the button will be connected to ground via a 1k Ohm resistor. Connect the other end of the button to 5V supply
Step 2.3: Connect pin 26 of Arduino to one end of floor 2 button, the same end of the button will be connected to ground via a 1k Ohm resistor. Connect the other end of the button to 5V supply
Step 2.4: Connect pin 27 of Arduino to one end of floor 3 button, the same end of the button will be connected to ground via a 1k Ohm resistor. Connect the other end of the button to 5V supply
Step 3 :Connection to limit switches (floor sensor)
Step 3.1: Connect pin 21 of Arduino to the NO (Normally Open) end of Ground floor limit switch, the NO end is also connected to ground via a 1k Ohm resistor. Common end of the limit switch is connected to 5V supply.
Step 3.2: Connect pin 20 of Arduino to the NO end of floor 1 limit switch, the NO end is also connected to ground via a 1k Ohm resistor. Common end of the limit switch is connected to 5V supply.
Step 3.3: Connect pin 19 of Arduino to the NO end of floor 2 limit switch, the NO end is also connected to ground via a 1k Ohm resistor. Common end of the limit switch is connected to 5V supply.
Step 3.4: Connect pin 18 of Arduino to the NO end of floor 3 limit switch, the NO end is also connected to ground via a 1k Ohm resistor. Common end of the limit switch is connected to 5V supply.
Step 4 : Connection to the motor driver
Step 4.1: Connect pin 22 of Arduino to input pin 1 of the motor driver
Step 4.2: Connect pin 23 of Arduino to input pin 2 of the motor driver
Step 4.3: Connect pin 8 of Arduino to bottom pin of enable A block of the motor driver (for controlling the speed of the motor, if not required then put a female-to-female jumper on both enable pin A terminals)
Step 4.4: Connect pin 9 of Arduino to top pin of enable A block of the motor driver (for controlling the speed of the motor, if not required then put the jumper on both enable pin A terminals)
Step 4.5: Connect 5V pin of Arduino to VCC and 5V power pins of the motor driver. Make sure to remove the 12V jumper from the motor driver, and connect the GND pin of the motor driver to GND of Arduino
Step 4.6: Connect each terminal of the motor A block to each end of the motor
This is to be done if you’re using your Arduino to power the motor controller (although this will consume more power from the Arduino and the LCD may go dim). There are other ways to do it too. You can check out this link for using other methods to power up the motor controller.
For an idea of the schematic of the motor controller, check out the diagram below
Step 5 : Connection to the LCD Display
Step 5.1: Connect the VSS pin (pin 1) of the LCD to ground
Step 5.2: Connect the VCC pin (pin 2) of the LCD to 5V
Step 5.3: Connect the V0 pin (pin 3) of the LCD to ground via a 3.3k Ohm resistor (or three 1k Ohm resistors in series)
Step 5.4: Connect the RS pin (pin 4) of the LCD to pin 12 of Arduino
Step 5.5: Connect the R/W pin (pin 5) of the LCD to ground
Step 5.6: Connect the EN pin (pin 6) of the LCD to pin 11 of Arduino
Step 5.7: Connect the D4 pin (pin 11) of the LCD to pin 5 of Arduino
Step 5.8: Connect the D5 pin (pin 12) of the LCD to pin 4 of Arduino
Step 5.9: Connect the D6 pin (pin 13) of the LCD to pin 3 of Arduino
Step 5.10: Connect the D7 pin (pin 14) of the LCD to pin 2 of Arduino
Step 5.11: Connect the A pin (pin 15) of the LCD to 5V
Step 5.12: Connect the C pin (pin 16) of the LCD to ground
For an idea of the pins on the LCD, refer the diagram below:
The Schematic for the connections is given below
Step 1:
XAMPP is used to make MySQL databases which store the elevator details (the building the elevator’s located in, number of floors above, on and below the ground) and the corresponding credentials to access the elevator (device name and API key of the bolt module). The bolt’s credentials, though stored in the database, are not directly accessible by the user.
Let’s look at the databases made using xampp:
To begin with, open xampp by going to start, then searching for “xampp” and clicking on XAMPP Control Panel. In the application window, click the Start button under Actions for Apache and MySQL rows.
The XAMPP window should look like this:
Step 2:
Now, click on the Admin button under the MySQL row. You will see the MySQL admin loaded in your browser. It will look like this:
Step 3:
Click on the Databases button, then under Create database, type the database name you want to create in the text field (I used the name verticel) and click create. This will the database name to be used in all PHP codes in the project. Then click on the database name (verticel) in the list of databases, and then a new page will appear. The tables can be made here as given below:
Step 4:
The following pictures will guide you to create the table elevator_details which will be storing the details of the elevator to be displayed in the front end of the application
Step 5:
The following pictures will guide you to create the table elevator_config which will be storing the details of the bolt module used in the elevator and the random code used to access it. This random code will prevent any misusage of the elevator.
You can get your API Key and Device ID/Device Name from your Bolt Cloud Dashboard. The Device Name should be entered in the database omitting the word BOLT i.e. only the numbers need to be entered in the database.
Never share the device name and API key with others as it may lead to unauthorized and unwanted access to the device. In case you feel that the bolt device is hacked by someone, simply generate a new API key.
Step 6: Resolving Errors
On clicking Start in XAMPP, in case a message appears which looks like this, then try changing the ports for the servers. Below the picture is the information for changing the ports in XAMPP.
Step 7:
To design the webpages for the project, I used Sublime Text 3, which is free to use. To make sure the code works over the local network, all the files and folders must be stored in the location in the computer pointed out below:
The codes to be saved in the folder are given in this link.
The codes to be saved in the folder are given in this link.
Step 8:
After saving the codes, open your browser and open the webpage localhost/Admin/auto_update_lift_code.php and leave it open until the end of the project
The webpage address will change if the Main Port is changed in XAMPP. In that case, open the webpage by including a :PortNumber after localhost. For eg., if the Main Port is 8080, then the address will be localhost:8080/Admin/auto_update_lift_code.php
Step 9: Upload the firmware present in the code given in this link to the Arduino. In this code, only the pre-installed libraries were utilized and no additional libraries were installed.
Before transferring the code, ensure that the device selected for debugging/running the code is changed to Arduino Mega 2560 by going to Tools->Board->Arduino Mega or Mega 2560.
Step 10: Android Studio was used to create the app which runs the webpage verticel.php using the WebView feature.
To create the mobile app, open Android Studio, and follow the steps in the following set of pictures:
Step 11:
After making sure that the 4 tabs specified in the picture above are open, paste the code which is provided in the project’s resources.
After all the codes are done, connect your phone to the computer via USB cable and switch on the developer mode and ensure that USB debugging is enabled.
To turn on the developer mode in your phone, go to your phone’s settings, then tap on About phone, then tap on Software information, and finally tap on Build number 7 times. This will enable the developer mode. Next, go to the settings main menu and click on Developer options. Search for USB debugging and turn it on while ensuring that the phone is connected to the computer.
After turning on USB debugging, follow the procedure shown in the following picture:
On clicking the button showing your phone in the dropdown list, the application will be installed on the phone and will open. Simply enter the required details in the app to call the elevator.
The codes for inserting in Android Studio are given in this link.
Watch our project in action:
The project successfully demonstrates the implementation of the Bolt IoT in controlling an elevator by using the mobile application VerticEl.
The application is used to search for the building, entering the floor details after selecting the building and entering the code displayed in the LCD panel, which will call the elevator to the source floor, and after getting inside the elevator, it will go to the destination floor, just like how it would happen using normal buttons.
You can see the working of the project in the video in this link.
This concept can be implemented in any commercial elevator with automatic doors and any control module to allow the touch-free movement of people.
Check out the Bolt IoT and ML training. This online video training is excellent for those who want to start with IoT and ML because it teaches you to build projects from the basics. Click on the button below to know more about the training.