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.