RFID coin mechanism with countdown display

Hello everyone, :slight_smile:

I need your help to code a system because unfortunately, I understand the arduino code but I can't write it ... :roll_eyes: Can you give me some food for thought with equivalent or complementary systems.

I want to make a coin mechanism with triggering by RFID badge to operate a 5V relay. Each badge will have a certain number of credits (example: 5 credits). Each time the user badges, his credit will be debited from 1 and the remaining credits will be marked on the seven-segment display. In addition, there will be a total of ten different badges each with their number of credits; At the start of each month, all badges are reset to 5 credits.

Other peculiarity, when the user badges the relay will be active for 10 min and a green LED will light up during the whole duration of the operation.

Here (in photo) an electrical diagram of the assembly which I wish to carry out, you will find there an arduino card MEGA2560 R3, an RFID-RC522 card, a 16-pin transistor, a seven-segment display and a standard 5V relay.

For any further information I remain at your disposal. Thanks in advance. :smiley:

Thomas

What is Your motivation getting into this trying to speak a language You only read? There are surely easier hobbies.

To tell the truth, I have already followed the initiation tutorials of arduino with a box. There are the basics of each system. But what I'm trying to do is manage to link several systems together to make them work simultaneously.

Attache the code You are using and please, use code tags, up to the left in this window.

How will you write the new number of credits left to the RFID badge?

How will you add credits to the RFID badge?

Surely, you don't expect the Arduino to keep track of the number of credits for each badge all the time, even over power outages.

I don't yet have a code that groups all the functionalities ... I thought that someone could refer me to find some where to adapt it for my system.

Indeed, to add the number of credits, I thought that the arduino could associate a number of credits with the identifier of a badge and keep it in his memory.

Forget that anyone will hand over the complete code You need. That will not happend.
Start trying just to make RFID Reading work.
Then left that code rest and try example code to run a relay. Then You surely can let the RFID code ooperate the relay when an RFID tag i shown.