Protecting DS18B20 temperature sensor from electromagnetic fields

Recently working on my aquarium controller project i have faced with aquarium’s temperature sensor problem. I am using DS18B20 digital sensor like this:

DS18B20 temperature sensor

I bought it in Ebay cheaply. Sensor has 3 meters long cable without any shielding. I placed sensor in the aquarium water to measure temperature. My aquarium’s water filter is placed near the sensor.  When controller started the 230V AC water filter problems with sensor occurred. The filter has only 7W motor. But at the moment when the filter starts it produces very powerful electromagnetic impulses. These impulses stuck temperature sensor. Stuck sensor gives bad temperature readings or can’t be read at all. I have software protection in controller which give sensor error if sensors measures temperatures below of 1 degrees and more 50 degrees Celsius, when average water temperature is about 26 degrees. So after filter start my controller frequently gave error. I do not checked what readings were exactly but it was clear that they were out of 1-50 degrees range. I only could suspect that sensor do not had filtering capacitors. DS18B20 is complex digital chip. Like every chip it must have filtering capacitors near to it. Sensor chip is in metal tube, so i cut the wire near the tube and soldered one 1uF SMD capacitor between “+” and “-” wires.

DS18B20 sensor1


I put waterproof Raychem thermally shrinking tube with adhesive on the cut place.

DS18B20 sensor2


After enhancement the sensor is functioning fine and there are no more any stuck when filter is working.

Leave a Comment

Your email address will not be published. Required fields are marked *