Hello,
I have a RFID Reader Project with,
- one ESP32 Controller with a MFRC522 RFID Reader and
- one ESP32 Controller with a 4-Channel Relay.
The current situation is this:
A user is holding his rfid tag to the reader and if the tag is authorized it opens one channel on the relay and the user can use the machine. The communication is via MQTT. The RFID Reader sends the message to the MQTT Channel Topic and the 4-Channel Relay is listening to this Channel Topic and if he gets a "allowed" it turns on the channel, if he gets "not allowed" it shuts the channel off.
But I would like to build in a timer that:
- If the user is holding his rfid tag a timer start for 5 minutes and than he uses the machine.
- After 4 minutes a red light should blink (I've build in green and red light) and should warn the user to hold his card again to let the machine know you are still using it.
- If there comes no reaction after 5 minutes it should shut everything off, if he hold s his card again the timer should reset and should start the 5 minutes again.
- If he wants to turn off the machine while using it, the user holds his card to the terminal and the timer gets a reset and if he holds within 10 seconds his card again it shuts off the machine.
- And while using the machine, no one should be allowed to hold the card.
I'm a newbie in C++ and I could do all by myself to this point but now I don't know how I can integrate this. I've read into "millis" a bit and I think to use this method.
Thanks ![]()