Timer Valve Release Based Upon Temperature Feasibility


I am currently looking at working on a project where fluids are released from a system based on when they reach a desired temperature. Essentially, there would be a thermocouple that would read the temperature of whatever fluid it was submersed in. This temperature would be sent to a PID controller, where the user would also edit what the desired temperature would be. Once this desired temperature was reached, the PID controller would open a solenoid valve to release the fluid. This is where the point of question comes in. I am needing a means to keep that valve open for a set period of time, let’s say ten seconds. Is this something that would be feasible with arduino, essentially to have the valve open and then use arduino as a timer for ten seconds and then have the valve close?

Thanks for any help!

Easily done using the millis() function. When the valve is opened, record the value of millis() in a variable. Each time through loop, check the value of the current millis() versus the recorded time. When the difference is 10 seconds (10*1000 milliseconds) close the valve. See the beginner’s guide to millis().

Thanks for the help! I'll start looking into that!