Comment on RPi Pico "disconnects" after a few minutes to days
dgriffith@aussie.zone 1 year agoHmm I’m not sure of the pin drive currents on the Pico, but can you power the sensor off a pin? At least then you can programmatically power cycle the sensor if you need to.
agressivelyPassive@feddit.de 1 year ago
Not really, at least I wouldn’t really know how. The sensor needs +3V, GND and two data pins, and the pico only has one 3V out, that seems to connect directly to the voltage regulator. I guess, I could try to use a GPIO pin as a switchable 3V out, but that seems rather hacky.
Unfortunately, a simple machine.reset() seems not to be enough. I didn’t use “real” watchdogs, but what a Java dev knows: try/catch. I wrapped the entire loop in a try/except block and simply call machine.reset() if something goes wrong. That does work sometimes, but not always. Of course the possibilities are a) some exception isn’t getting caught b) there is some electronic issue, maybe the SPI interface to the DHT is “stuck” or not properly reset. I can resolve the problems by completely disconnecting the device for a while from power.