March 15, 2018

Arduino RFID (Part 5 The Final Chapter)

(... continued from part 4)

As implemented, my Arduino RFID boxes are in the style of separate In and Out walkways as seen in most typical MRT systems where the incoming and outgoing people use completely different walk ways and separate scanners. Unfortunately we don't have electric gates, so sometimes employees get confused and scan their cards multiple times at the wrong scanners. My Arduino code prevents multiple scans that immediately follow one another, and our Windows side software will take care of other duplicate scans.

The guards have a special RFID card that's used to "swap sides". Our In and Out walkways are normally fixed, but in case a box goes out of order, we can immediately change the walk ways and redirect the employees to scan correctly. So far we've only had to do this a couple of times, when the POE Ethernet Shield blew up, and when the electricity went out for so long that the UPS that feeds the POE switch ran out of power, and we had to rig up a battery pack for a single RFID box to let the employees get off work.

The point of this is that the RFID card itself doesn't know if it's "inside" or "outside" of the premises. The boxes only do the scanning and logging, and it's up to the Windows software to figure out the working hours and overtime hours. The Windows software can also check the current time and check the logs to see if the employee is "inside" or "outside". I mentioned in the previous article (also via source code), the employee's name and code are written onto the card. They're displayed when the card is scanned for the user to read, but only the RFID card's UUID and the employee code are logged. There's no need to log the name.

However, since the MiFARE Classic cards are actually capable of being written to (like cash cards). An alternate design is the bus system where a single scanner can be used for both incoming and outgoing, and it's up to the card itself to remember its state. In this design, if the employee forgets to scan the card, the in/out status would be reversed, and they would need to reverse the status by scanning the card again, or letting HR reverse the status. This was to be my initial design, but I felt the employees would be too confused by this implementation.

Oh yeah, while working on the RFID boxes, one issue that came up was the accuracy of the time clocks. I tried to explain to the HR people what NTP is, but couldn't get through their skulls. Eventually I ended up doing a completely different project to handle the clocks.

All good things must come to an end, it's been a while since the last article, and over the years my Arduino RFID boxes have performed admirably, except for every month or two (roughly once every 10,000 scans) HR would complain that an employee missed a scan which I could never discover the problem. So late last year (2017) I finally gave up and the company purchased new scanners directly from vendors with warranty and we switched to the new system on the first day of 2018. And two and a half months into this year we've already missed more than 20 scans. Garbage I say.

However, since Raspberry Pi 3 B+ is released today, I might pick up this project again just for fun. The Raspberry Pi is easier to manager than the Arduino because it runs a full OS and even though I've never written about it here, I've played with them quite a bit since the very first release and I've done a really simple project that I'm actually proud of. Will write more later.

March 14, 2018

RIP Hawking


"The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge." 

I don't think it's an exaggeration to say that Stephen Hawking was every geek's childhood hero. Rest in peace, and thank you for being an inspiration for a generation of scientists and engineers.