Flow control check

Hi

I have put together a sketch, but when I hook everyting up it does not work as I intended. Can anyone have a look at it and see if there is a error somewhere? And please keep in mind that I am new at this and for the most part I have no idea what I'm doing :slight_smile:

A little bit of my project: I am building av flow control, that controls how much water flows through a valve. Let's say I'm going to fill a vessel with 40 liters of water, I can adjust the amount up and down with two buttons, when the amount is set I press another button to open an electric valve and start the water flow. When the amount passed through the sensor/valve reaches the set amount, it triggers an effect that closes the electric valve. The fourth button is just a reset button.
I use a 16x2 i2c lcd display to see the adjustments and flow. I also use two relays to control the electric valve. The valve is 12volts and the rest is 5 volts.
I power everyting with a 12volt 1.5A power supply.

If anyone wants to have a look at it, I can e-mail the sketch because it is to big to post here.

thank you

You can use the attach option to post the code.

it does not work as I intended.

Along with using the Reply button, not the Quick Reply field, you need to elaborate.

"it does not work as I intended" doesn't mean anything (except that you are frustrated).

What does it do? How does that differ from what you want?

A schematic would be useful to - a Fritzing diagram or the (really) old-fashioned pencil on paper kind.