Onewire library not working after valve actuation

Hello community, I have an interesting problem reading DS18B20 temperature sensors.
As background, we monitor water and temperature and control a solenoid valve when certain thresholds are reached.

Everything is fine until we do a periodic valve actuation (at 3:30am each day) - then indefinitely afterwards the temperature sensors give invalid readings and, on restart, cannot be found. This has affected about 20% of our initial prototype batch (about 100 devices) so far. Here is an example of the output we get, proving the issue (0C = failed crcCheck):

I confirmed by testing a failed unit with the standard DS18B20 library using the multidrop and singledrop examples on Particle Photon running 1.5.0.
The same temperature sensors work on other devices running same firmware.
Other pins had the same Onewire issues, but the flow monitoring (which uses pulse interrupts) and SD card processes (which uses SPI) still worked.

I am not an expert at onewire, but do you think something like a solenoid valve actuation (6v latching through a relay) could permanently upset the onewire signal processing ability on the Photon?

How are you controlling the solenoid?
Could it be that the kick-back from the coil affects the setup?
Do you have free-wheeling diodes in place?
Can you monitor your signal and GND lines with an oscilloscope?

1 Like

We are controlling using a relay H-bridge (each controlled via GPIOs through a transistor).
It could well be the kick back, although we have free-wheeling diodes in place, would extra capacitance across the supply help?
I just got the oscilloscope out to read D2 and found the line static at around 1.3v.
On a working unit, it is 4.6v when idle then a modulated square wave peaking down to 0v when reading temperature.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.