I have made thermometer with 1-wire sensor (DS18B20). The sensor connected to microcontroller via long (approx. 4m) three wires (GND, VDD, DQ). The wires has no shield.

It works, but I worry about EMI. Should I protect wires? If yes, how? Can I use ferrite bead on DQ near my device?

  • 4
    \$\begingroup\$ You may delete the comment about your English from your profile. Your English looks OK to me, and besides, it's not relevant. \$\endgroup\$
    – stevenvh
    Aug 11, 2012 at 15:36

1 Answer 1


There is insufficient information to completely answer the question.

I assume you are concerned about EMI from external sources affecting your thermometer -- not the other way around.

Questions to ask:

  1. What kind if EMI is your system going to be exposed to?
  2. What exactly are you worried about? Damage to the uC, damage to the sensor, both?
  3. Corrupted Data?
  4. Consequences of actual EMI. E.g. danger to equipment or humans, down time, cost.

Taking these in turn:

Likely sources of EMI are from switching transient of high power local loads, especially inductive ones (motors). Nearby high power RF transmitters may also cause problems but cell phone tower are usually not an issue. Static electricity discharge can damage electronic devices too, but that is independent of the cable length.

Damage to the uC and sensor is unlikely if your sensor is connected to the uC by 3 wires in the same cable. Any noise will be mostly "common mode" (all wires are equally affected). You can put a few turn of the entire cable through a ferrite ring core if you are really paranoid.
A suitable RC filter on the uC pin(s) connected to the DQ signal may be appropriate. The details depend on your circuit. E.g. do you use 1 pin with direction control or separate read/write pins, etc?

If your concern is that you might get incorrect readings, then the CRC in the data stream will allow you to detect that and discard occasional bad readings.

Consequences of EMI: EMI protection can be expensive. If there are no dangerous consequences then replacing your thermometer may be the most economical option.

Summary: Your circuit may be fine as is, nothing further required.

The Maxim application note on 1-wire networks may help. See Appendices. The circuit in Appendix B looks appropriate for your application. Guidelines for Reliable Long Line 1-Wire® Networks

  • \$\begingroup\$ Could I ask what is the ferrite core for? Why would it help in general conditions? I asked this because I have seen them several times.. \$\endgroup\$ Jan 22, 2015 at 3:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.