I am working on a Laminar Flow nozzle project. In this project Arduino shall control RGB LED, one Solenoid, and Anemometer made from CD ROM Motor. Actually i should not called it a perfect Anemometer for the time being because it just provide me voltage at high wind and i am not able to convert those voltages into wind MPH. The maximum voltage i get from this Anemometer is 0.4 V DC.
The idea is when the voltages reaches to 0.24 DC the laminar flow disturb and i want to stop the pump. This seems very simple as i can monitor the voltages through Analogue pin easily. But, i do not want the Arduino to stop/start the pump frequently. WHAT I want:
1- I want Arduino to get the voltage of Anemometer. If the voltage reading is 0.24 DC then take further readings if the voltage is greater 0.24 or equal to 0.24 for 1 minutes then STOP the pump.
2- The Arduino takes the reading of anemometer after stoppage of pump if the readings are persistent for a minute then the Pump should not be started. This cycle should be calculated again and again till the arduino knows that the wind is low and DC voltages are less than 0.24VDC. then start the pump.
I need all of your help please. How can i do it. Any psuedcode will be useful or any other method / technique shall be good for me.