Maintaining the water level in a dam is really important. The water level in the dam affects the amount of potential energy present to generate electricity, higher water level gives high potential energy. Also, the water level should not rise above the crest of the dam as it increases the risk of bursting the dam and causing major floods in nearby villages and cities. To overcome this problem, we have created a smart dam system using RS-485 serial communication protocol between a single-chip embedded controller ARM cortex STM32F103C8T6 and ESP8266. The water level will be measured using a capacitive sensor connected with STM32. STM32F acts as the master and serially communicates with ESP8266. Servo motor and Infrared sensors will be connected with ESP8266 to open the floodgate and detect the obstacle near the floodgate. The floodgate will be opened automatically based on the water level. The water level and status of the floodgate will be updated lively in a website that we created and a notification will be sent to the locals in case of any emergency due to the water level using IFTTT.