Escape Room - Webclient - Arduino + Ethernet

Escape Room is an interesting way of spending time and having fun. Can torment brain threads in puzzles, digital tasks by solving which players progress in the game. I also decided to put in the Escape Room an interactive way of entering the code in the room. Arduino has five buttons for sending / changing numbers (depending on the implementation). The buttons are debugged via the millis () timer function; with debounter time (treatment of button flickers) 50 ms. The input method of the buttons is in the initial value INPUT_PULLUP, when they are connected to the 5V by an internal pullup resistor. They're turning against the ground. Switches are used, not expandable.

The LCD display is used to represent the entered numbers from the user with their real-time visualization. It is possible to use LCD 20x4 / 16x2 with I2C converter. The statement is only executed on 2 lines.

The display also shows the address on the LAN, indicating connectivity or a network problem. Arduine is plugged Ethernet shield W5100 from Wiznet, which via HTTP protocol communicates over the network with the webserver, which sells the entered number from the user.

Datas are transferred by the POST method. The answer of the server is payload with confirmation / rejection of the received number.

Confirmation is performed if the correct code is guessed. The result of the confirmation is the unlocking of the door by means of an electromagnetic relay which controls the solenoid door lock. It is also possible to use the SSR relay if the solenoid door lock is on AC voltage. (SSR relays have a problem with opening the DC voltage circuit - see triac in the frequently used relay OMRON G3MB-202P.) The relay is switched by reverse logic, ie. active low. At 5V (log 1), the relay is open, at 0V (log 0), and the solenoid lock is open. In the case of an unpredictable number, an error is indicated on the display / additional LED for the user with an incorrect code number.

The web interface for the administrator includes a login system with the ability to change data and the ability to change the search number for all 3 game modes that are supported. The first mode consists of sending one number with buttons 1-5. By pressing the button, the HTTP POST request is immediately sent to the webserver and the webserver responds with the result of the verification to the payload. There are only 5 possible combinations, the search is fast. This game mode is not equipped with a display.

The second game mode employs four repeatable numbers, i. from 0000-9999. So there are a total of 10,000 combinations, with only one right. The four buttons are used to set the numbers. Each button operates its position by incrementing a number from 0-9. The fifth button serves as Enter and when pressed, the entered four-combination is sent to the web interface.

The third mode is almost identical to the second mode, it works without repeating numbers. In total there are 5040 possible combinations with one right.

All 3 game modes can be operated from one web interface. The administrator can select a search number for each game. The change is applied immediately (even during the game). The web interface can be further supplemented by the use of MySQL database for individual connections from Arduino. Use for statistics, success of competitors competing with the entered numbers, number of attempts, time period. The website is treated for number inputs for each of the game modes (taking into account repetition, non-repetition, number code length).

ESP32, ESP8266 with WiFi connectivity can also be used as microcontroller. They also support HTTPS encrypted connection to the website. For ESP32 it is possible to use own certification authority, HTTPS certificate. The project is actually deployed and it is a paid solution to which I am able to deliver software, wiring diagram. Included in this article is one code for the Arduino and Ethernet W5100, which in a quartered version offers part of the first game mode with a single number search. The number is fixed in the .php file of the website to which the Arduino with Ethernet shield connects, does not include a database connection, admin interface. The paid version also includes an integrated watchdog that Arduino restarts in the event of a hang.
More projects can be found on my site: https://arduino.php5.sk/?lang=en
Wiring diagram for all 3 game modes:

Comments

Popular posts from this blog

Web scraper via Arduino & NodeMCU & ESP32

ESP32 control via UDP datagrams

Biking on Google Maps - Arduino Leonardo (32u4) - HID device