HomeElectronicsIoT-Enabled Good Metro Card System: Step-by-Step Venture

IoT-Enabled Good Metro Card System: Step-by-Step Venture


Metro sensible automated techniques all the time look cool to us. You’ll be able to scan and rescan to journey simply utilizing a MetroCard. No want for particular personnel or something—simply recharge the cardboard, and also you’re able to journey.

Right here, we’ll design our personal model of this know-how.

Our Good Metro System goals to create a sensible ticketing resolution utilizing RFID know-how. This method permits passengers to make use of RFID playing cards for metro rides, routinely deducting fares and updating the cardboard stability accordingly.

It consists of two most important parts: the RFID card reader/author and the online server interface for monitoring card balances and transactions.

Two completely different machines are made: one is the RFID Card Steadiness Author, managed by the supervisor on the metro station, the place you pay money, and your card will get recharged with the paid quantity. The opposite is the RFID Metro Station Entry/Exit Gadget, the place you scan the cardboard at entry to board the metro and scan once more at exit.

– Commercial –

The quantity on the cardboard is deducted and up to date, and the identical is displayed wirelessly to the metro station employees. The machine itself retains a document of every entry and exit, and the scanned card stability and UUID are exhibited to you as effectively on a display by way of a webpage opened by that machine.

RFID-based Metro Station System Prototype
Fig 1. RFID-based Metro Station System Prototype

Invoice of Supplies

On this design, we use a small growth board, particularly the IndusBoard Coin, and an RFID reader/author module, the RC522 reader/author. Should you use only one setup, you’ll be able to make use of a single IndusBoard Coin and RC522 reader/author module.

First, configure it to recharge the cardboard, then reupload the code and reconfigure the identical circuit for the station entry/exit system. Alternatively, you need to use two separate setups: one for the metro entry and exit system and one other for the recharge module. The whole listing of parts is offered within the desk under.

Parts Amount
IndusBoard  Coin 2
Servo Motor 1
RC522 RFID READER WRITER 2
RFID Tag/card 1

Code for RFID-based Metro Station System

Right here, we want two codes: one for the recharge machine and one other for the metro card scan system for entry and exit. In each circumstances, we use the RFID learn and write features.

For the recharge machine, we first learn the cardboard after which recharge it with the quantity the consumer pays. For the metro entry and exit scan system, we learn the cardboard at entry, and at exit, we deduct the stability for the journey and replace the cardboard with the brand new stability.

First, we’ll create the recharge code.

Recharge Code

Begin by putting in the RFID reader library “MFRC522” utilizing the Library Supervisor. Then, configure and outline the SPI pins within the code based mostly in your reference to the IndusBoard.

Subsequent, test for a card scan on the RFID reader/author. When a card is detected and scanned, create the code to delete the information within the card’s blocks and replace it with the brand new information from the Serial Monitor. This information is the recharge quantity.

For instance, if an individual needs to recharge with 150 rupees, we ship “150” by way of the Serial Monitor, and the brand new card stability quantity will likely be up to date within the card’s storage.

Code for configuring pins and serial monitor baudrate
Fig 2. Code snippet configuring pins and serial monitor baudrate
Metro Ticketing System Code
Fig 3. Code snippet updating the cardboard storage.

Metro Card Scan Code

Now we’ll make the scan code that can permit the particular person to enter the metro or subway, after which on exit, routinely deduct the stability from the cardboard and replace it with the brand new stability.

Right here, we first test the scanned card’s UUID after which decide if it’s an entry or an exit, deduct the stability from the cardboard, and replace the identical stability.

Then, show the identical wirelessly in a document utilizing an IoT dashboard for every scan, with the UUID and its present stability. The Wi-Fi credentials have to be configured within the code to get the machine linked to Wi-Fi for real-time show of every scan entry and exit, and quantity replace on the cardboard.

Metro Card Scan Code
Fig 4. scan card code snippet config WiFi credentials

Circuit Connection

The connections stay the identical for each units, besides that the servo motor isn’t wanted for the recharge machine and ought to be eliminated. Join the parts as per the circuit diagram. You too can change the pins and outline the SPI pins within the code based mostly in your connection.

Circuit for RFID based Metro Station System
Fig 5. Circuit

Testing

RFID Metro Card Recharge and Entry/Exit System
Fig 5. IOT web page exhibiting the scanned card and stability

Energy the recharge machine and scan the RFID card. Preserve the cardboard on the reader till the recharge is full. Ship the quantity (e.g. 150 rupees) by way of the Serial Monitor to replace the cardboard’s stability.

For the entry/exit machine, energy the scan machine, hook up with WiFi, and scan the cardboard at entry to log the UUID and timestamp. Scan once more at exit to deduct the fare (e.g., 30 rupees), replace the stability, and transfer the servo to open the gate. Test the IoT dashboard to verify the UUID, entry/exit occasions, and up to date stability are displayed wirelessly.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments