Debris flows are very destructive phenomena that cause damage to population living near rivers. Current warning systems for these phenomena are based on fixed instrumentation located at certain points through the river or indirectly, through remote measurements; as a result, the information they provide is limited, as it lacks real-time and precise data about the event location and its speed. In this paper, we introduce a set of algorithms and protocols for debris flows detection in rivers, using a wireless sensor network. The proposed detection protocol is distributed and decentralized, as it does not rely on a central coordinator to decide on the presence of the event. The proposed algorithms and protocols were evaluated on a simulator, in order to evaluate its performance. Results show that the algorithms are capable of detecting the phenomenon and alert people in the danger area with enough anticipation to prevent a tragedy.