Need some help on water atm/kiosk

I'm sorry, I need to create a water kiosk where the user will have a prepaid card, and in order to get water service, his card must have enough balance and if his card does not have enough balance, he will not get water service, and the cost will be charged according to the amount of water he got , and if a person's card does not have enough balance, then the admin will increase the balance on the card using the master card and push buttons. To create this system, I will use EM18 RFID reader, Water flow sensor, Solenoid Valve and push buttons in order to help the admin increase the balance on someone's card. I am asking for your help on how to complete this project.

1 Like

Why are you sorry?

Ok so which bits need completing?

sorry sir, what do you mean?

And when is your project due ?

i need to complete this soon as possible sir.

How far have you got on your own? Show us your current work.

i don't know how to start sir on this

Start 1 step at a time.

Get each piece of hardware working independently. Most hardware comes with links to example code. Get those examples working, and try and understand how they work. Then you can start to think about combining everything together.

If you are asking for someone on this forum to do all the work for you... then you will likely be disappointed.

ok sir

Is that a school project?

Yes sir it's a school project

Ok - so you probably must have learnt a few things about programming an arduino and those components and as it’s not a simple 15 minute code writing exercise, I suppose you have been given some time to complete this - so where is the urgency?

Explore each module, read about state machine if you did not study this yet in school. (If you are allowed to use libraries, a button library will make your code simpler (I like Button in easyRun or OneButton or Toggle)

Read also about using millis() so that you don’t get a blocking code (see Using millis() for timing. A beginners guide and Several things at the same time)

ok sir thanks let me try to do that then i will give you the feedback

How much teaching have you had on the Arduino?- have you mastered the basics?

I may be wrong, but from what I read about the EM18 you can't write to the card so you can't store the balance there. That means (if I'm right) you would need to implement some kind of mini-database on the Arduino. Maybe you could use the built-in eeprom to store the balances, and link the user's tags to various eeprom addresses.

But I may be wrong: I've never used such a reader / tags but that's how I interpret what I've read.

yes sir that's what i wanted to perfom

What is? That you want to update on the card, or update a database?

on arduino eeprom so that if the rfid card placed on the em 18 reader the balance of the specific card can be retrieved from the eeprom sir

Please say what you know so far about Arduino programming.

This is not a very very complex project, but nor is it one for an absolute beginner. Have you for example written code to just read and write to eeprom? Have you acquired or written code that can read an rfid tag and display its id? Have you got code that can open and close a solenoid?

I agree with red_car in #8 that you should get all the parts working alone before you try to combine them into the overall soultion.

yes i know some of them like how to write and read data from eeprom, how to activate and deactivate the solenoid valve but the problem am getting is how link the rfid id with the specific value like balance in the eeprom and how to retrieve from the eeprom when the card placed on the em 18 reader, also how to add the balance to the specific card by using master rfid card and push button switches/keypad membrane sir

That's very different from what you said earlier

I'd go for a state machine approach (mentioned already in #12) so that it's normally in "user" state and if the admin card is read it goes to "admin" state. Then another read of the admin card will return it to "user" state. If I were you I would spend some time studying state machines, and then draw the state diagram for the project. One of the biggest mistakes is to dive into coding too early with no "road map" so to speak.

You could (I think... this is off the top of my head) code the user ids into an array and when a tag is read, see where it is in the array and then use that array index to be the "key" to the eeproms and access the right one.

How many user tags do you need to cater for? What data do you need to store per user?- only the balance?- or is there other stuff you need? And don't forget the eeprom has a finite limit to how many times it can be read. Quite big, but finite nevertheless.

Why don't you share your thoughts on this so far?