phatrabbitzz
Posts: 5
Joined: Sun May 27, 2018 11:55 pm

RFID Parking System w/ counters

Mon May 28, 2018 12:15 am

I am looking to build a parking RFID system where there is one reader in the entry and one reader at the exit. The entry and exit gates are not the same gates.

Now I have a group of 5 people (group A) can get 5 cards, so one card per person, and a group of 3 people (group B) can get 3 cards, also one card per person.

I need to be able to control the number of entries per group. Meaning I want to only give group A 2 entries only (I do not care who from group A enters, but no more than 2 can enter). So max amount of people in the parking can be 2 people from group A, if person #3 tries to enter he will be denied until someone from group A swipes the exit reader.

For group B I want to give 1 entry only (I do not care who from group B enters, but no more than 1 can enter). So max amount of people in the parking can be 1 person from group B, if person #2 tries to enter he will be denied until someone from group B swipes the exit reader.

I need to be able to manage about 150 groups and each group can have different amounts of cards.

I'm looking for some guidance on how to best approach this project. I was thinking if I setup the groups into a DB on pi and have the readers check UID but would need some sort of counter per groups. However I am open to ideas on how to go about setting this all up.

Thanks!

User avatar
topguy
Posts: 5003
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: RFID Parking System w/ counters

Mon May 28, 2018 9:31 am

In theory you would only need a few tables.

A table for the cards:
Card UID (key) / GroupID / InOrOut
343454543 : 12 : "In"
343486333 : 12 : "Out"

And one for the groups:
GroupID (key) / MaxIn.
12 : 2

On entry you:
- get the group the UID belongs to.
- get the MaxIn for that group.
- count how many in that group is "In"
- compare the values.
- if card should be let in, then update the record with "In".

If I now have done your school homework I will be very disappointed in you.

phatrabbitzz
Posts: 5
Joined: Sun May 27, 2018 11:55 pm

Re: RFID Parking System w/ counters

Mon May 28, 2018 6:15 pm

It does read like a HW question, but I've been out of school for well over a decade now. I'm actually trying to build this thing and make it work in an actual parking garage. Currently the entrance to the deck is by calling a number and the boom lifts. However since all 5 users within a group are allowed to call, though they might only have 3 spaces, the system currently just lifts the boom for all 5 calls as it does not know who is in or out of the deck. By putting a card read in both the entrance and exit should be able to eliminate this problem.

For hardware and testing this out I'm going to order two Mifare RC522 units.

I found something similar here but unfortunately it does not look like the author released the code.
http://shazsterblog.blogspot.com/2016/1 ... ry-pi.html

I setup the sqllite DB as topguy suggested, just need to figure out how to connect the RFID to interface and update the tables accordingly.

Return to “Automation, sensing and robotics”