Q. I remember reading in a Midrash that Miriam’s well did not constantly flow water; it only came when people came close to it. If so would it not be prohibited on Shabbat as it would be similar to a motion detector

A. It is difficult to envision what would be the biblically prohibited melocho involved when making the water flow. Even if there is one, Horav Shlomo Miller Shlit”a explained that anything that works by the powers of a miracle is not included in the prohibitions of Shabbos.

Rabbi A. Bartfeld as advised by Horav Shlomo Miller Shlit”a.