Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Reply To: MS One-Wire Power

Home Forums Environmental Sensors MS One-Wire Power Reply To: MS One-Wire Power

#17152
Shannon Hicks
Moderator

    Onewire sensors like the DS18b20 don’t like to have their bus power cycled on and off.   Back when I last experimented with them (with a different sketch not related to ModularSensors), if you’ve got the sensor connected to the switched power supply, you had to do “DSsensors.begin();” each time the logger woke and powered up the switched power bus.  Only then will the DS18b20 be seen by the Mayfly.  So I just put that command in the loop right after the Mayfly wakes up from sleep.

    The easy solution to this is to just connect the DS18b20 to the Mayfly’s D5-6 Grove jack and put the power-select jumper to “3.3v const”(it’s default position) that way the Onewire sensor is constantly powered and won’t “disappear” after the pin 22 switched power is cycled.  Having a constantly powered Grove jack for I2C and Onewire peripherals is exactly why I designed the Mayfly’s D5-6 jack power selection options.