Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Ultrasonic sensor

The Mayfly can easily connect to ultrasonic rangefinder sensors like some of the models from Maxbotix.  Any sensor that has a TTL serial output can be used on any of the Mayfly digital pins using the SoftwareSerial library, or you could use the spare UART port if you aren’t using it for Bee socket communication.

The following example has been tested with the Maxbotix MB7386 and the MB7389 sensors, both of which are specifically designed for rangefinding to a liquid surface and are rated for outdoor use.

 

You can also put the Mayfly to sleep between samples, and record the data to a microSD memory card.  You’ll need several Libraries if you don’t already have them.  In the following example, the ultrasonic sensor power pin is connected to pin D10 and the data pin is connected to D11.