How do you feel about this article? Help us to provide better content for you.
Thank you! Your feedback has been received.
There was a problem submitting your feedback, please try again later.
What do you think of this article?
Introduction of the project
During recess time or lunch hour, many students queued at the tuck shop of the school to buy snacks or food. Usually, it was quite chaotic and sometimes fellow students would just jump the queue. It was this unpleasant experience that triggered our project created in the “Inventions for School Contest”.
So the project was designed to tackle the problem created by queue jumpers. In the contest, we were introduced the use of the micro-controller Arduino and chip-sized computer Raspberry Pi. With some other ideas in mind, we thought that our project “Smart Attack on Queue Jumper” could solve the problem with the use of Arduino, Raspberry Pi, and some other electronic components and modules.
The idea of the solution is that students should present their smart student ID card, which is a MIFARE type, at the “registration card reader” before they can buy food. After that they can just sit and wait. They can see the status of the queue in the monitor mounted above the tuck shop counter. When the student see that his current position is “number one”, the very front position of the queue, he can proceed to the counter. He will then present his smart student id card again at the “purchase card reader” which will signal if he is really number one in the queue. In case of the student in the does not present at the counter, purchase card reader has a cancel button to remove that student’s purchase registration.
By the use of the system, no one can jump the queue or stand in the queue. We successfully implement the prototype of the system to demonstrate the effectiveness of the system.
Implementation
Registration/Purchase Card Reader
These two readers are similar in hardware. They both have a MFRC522 smart card reader module connected to the Arduino. The card id is read from the MFRC522 module and sent the Raspberry Pi’s web server for processing. We chose ESP8266-01 serial to WIFI module to send the data so that no long LAN cable is required and the positions of the card readers can be more flexible. Because ESP8266 module use one serial port and we need another serial port connection to computer for debugging during design time, we use Arduino Mega 2560.
The indicate the success of beeping the student id card, we connect one LED with red and green colors and a buzzer to two digital pins of Arduino. For the purchase card reader, we also connect an button to the Arduino for canceling the purchase in case the student is absent at the tuck shop counter.
We reference to GitHub’s sources https://github.com/itead/ITEADLIB_Arduino_WeeESP8266 and https://github.com/miguelbalboa/rfid to write the program to read and send data to Raspberry Pi.
Electronic Queue
The queue of the tuck shop is processed electronically in Raspberry Pi. We use the Raspbian image and install Apache web server, MySQL database and PHP. The card id is stored with timestamps in the MySQL database and the communication between the Arduino and MySQL database is handled by PHP. Moreover, the electronic queue is displayed using a web page through Raspberry Pi’s HDMI port. The web page is updated every second using the HTML.
The electronic queue is database with two tables, card and queue. Table card store the registered student card id and the corresponding student information like their names. The queue table stores the card id, in time and out time of reading the card at the registration and purchase card reader.
We created a in.php to insert record to the queue table. After reading the card id at the purchase card reader, the out time of the student’s queue record is updated. To check whether the student is the number one in the queue, we use select SQL command to sort the queue record with NULL out time and order them by in time. If the first record’s student id matches the one read by the purchase card reader, the system can confirm he is not a queue jumper and a status “Success” is sent back to the Arduino card reader. The Arduino card reader will reader the received data and look for “Success” string. If it is read, the green LED and buzzer pins will be set high, otherwise it is set LOW.
The queue.php is just a HTML output to the monitor. It reads the table queue with NULL out time records. The names of the records is listed one by one to show the order of the queue.
This is our demo video: