Urbanization has a profound impact on watersheds, causing changes in hydrology, water quality, and stream geomorphology and ecology. Impervious surfaces and traditional stormwater systems contribute to larger, more disruptive flows, leading to erosion and ecological impairments in streams. Conventional stormwater control systems, such as detention basins, are widely used in the USA. However, their static design, tailored to specific storm events, can be inefficient for smaller, more frequent storms, and even increase erosion by prolonging the time that the stream discharge is above a critical threshold for erosion. Recent advances in Real-Time Control (RTC) technology, coupled with decreasing costs, offer a promising opportunity to enhance the performance of conventional stormwater systems. In our study, we evaluated the effectiveness of a smart detention pond equipped with a movable gate on its outflow structure. This gate can be dynamically adjusted based on real-time weather forecast data and hydrologic simulations with varying lead times. We developed a novel algorithm to control the outflow gate opening to achieve two primary objectives: reducing stream erosion by minimizing high outflows and improving water quality by retaining water within the pond as long as possible. Our algorithm was implemented on detention ponds within several urban watersheds by conducting long-term simulations using Python and the Hydrologic Modeling System (HEC-HMS). The simulation results served to assess changes in stream erosion. Our next research phase involves the development of an algorithm that enables centralized control of all detention ponds within a watershed. This approach considers not only the individual conditions of each pond but also the interaction of the effects related to different ponds (centralized control), thus promoting more effective stormwater management practices. This study contributes to the advancements in RTC technology and its application in stormwater management, offering a path towards sustainable urban water management practices that mitigate erosion and enhance water quality.