Automatic Dam Shutter Control System
Circuit Diagram
Algorithm
- Get distance of water from SONAR and convert distance to height using
damHeight
. - If the height of water is too high (
heightWater>heighOpen
) start opening the gate (start the motor). - Once enough time has passed (
openTok - openTik > openTime
) stop opening the gate (stop the motor). - If the height is neither too high nor too low (
heightClose<heightWater<heightOpen
) keep the motor off. - If gate is open(
isOpen=true
) and height of the water is too low (heightWater<heightClose
) start closing nthe gate (start the motor in oposite direction). - Once enough time has passed (
closeTok - closeTik > closeTime
) stop closing the gate (stop the motor).
Total States
There are total 4 states,
- Opening
- Opened
- Closing
- Closed
Caution
- Keep
heightClose
&heightOpen
value close. - Keep
heightClose
> Mininum water height when gate is open.