Using 2 RFID and implementing access control algorithms

Hi everyone.

I want to make access control project with RFID reader in the gate, when family enter each member will have NFC tag , i want to register the parent and under them is the kids.
Where the kid is not allowed to exit unless the parent scan his tag.

How can i connect the tags ID of the kids with the parent so only his parent can allow him to exit not any parent.

I had been thinking for days to implement it but no idea came to me.

Also then i need another RFID reader where if one of the kid scan his tag it will add 5$ on the family balance and when the family exit they can pay all the balance.

I need suggestions or ideas

You can do it with if elif constructs. Each card has a separate ID. you keep the parent's cards in a separate list
Separate children's cards. It should not allow output if the incoming data is equal to a list on the subcard. Let the parent card allow it. Let it let you handle it with a simple if else structure, if you want me to explain it in more detail, just say it.

But the problem here is that any parent will open the gate for the child, i want them to be connected as a family.

Because then i want another RFID that when any member scan it , it will add 5$ on the family balance.

I was thinking about online database bit cant get my head around it.

Design your data model.

link a child's tag to the tag of a parent.
If necessary, make it possible to link to 2 parent tags.

if you store your data in RAM or EPPROM a simple structure might help.
Just as an idea

struct Keydata
{
  byte id;     // a unique number for all known tags >= 1 - omnit ID 0!
  byte uid[4]; // the UID/Tag number of this tag
  byte parentA; // if <> 0 that id will be the parent of this ID
};

Keydata keydata[] {
  {1, {1, 2, 3, 1}, 0}, // a client A
  {2, {1, 2, 3, 2}, 0}, // another client B
  {3, {1, 2, 3, 3}, 2}, // a child of client B
  {4, {1, 2, 3, 4}, 2}  // another child of client B
};

This sound very interesting approach, can ypu elaborate on the last part of the code.

Like the parent side, why each client would be 0 and kids 2?

I'm new to this data model

therefore I suggested you should draft your own data model. Mine is just an example.

all entrys (ID 1 .. ID 4) represent one key (or one person).
ID 1 has no relation to a parent
ID 2 has no relation to a parent
ID 3 is a child, therefore it needs a relation to another person - a parent. In the example it has an relation to ID 2.
ID 4 is a child, therefore it needs a relation to another person - a praent. In the example to ID 2.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.