Optoisolation assumes you have DC power on both sides but gives good isolation.
Another way to isolate sensor from large common mode , CM, noise that may exceed CM input range of Op Amp is using a large CM choke to raise CM impedance with cap to ground to attenuate CM noise. Current Loop sensor offers some CM immunity but only from DC drop to some lower frequency than what CM choke or " Balun" can do.
Using shielded pair or twisted pair for all connections also reduces ingress of noise.
Ferrite beads on interface signals is also common to suppress RF noise.
DC-DC converter may also be another source of radiated noise. So isolation and shielding can be useful.
Usual method to determine EMI problems is to use a scope probe with shorted tip using ground clip or loop antenna to sniff for radiated noise near sources or ambient for noise >10MHz to determine what noises you can expect from arcing motors or relay contacts.
The PV panel may need lightning transient noise protection with CM choke as well and RF plastic cap to ground.
Only you can determine the requirements by doing an evaluation of site noise levels or testing the product by simulating arc transients with electric drills, cap discharge to plate antenna, power line transient, HIPOT, ESD generator (3 to 15kV discharge from 300pF cap+100R) etc etc.
A metal enclosure may be better or worse if poor grounding than metallic sprayed plastic, but both serve a purpose.
We can’t give exact design but principle is this.
It is critical in EMC design to understand source/load impedance and voltage or current of both signal and interference from any source over the entire spectrum from DC to RF to ensure high S/N ratio. You can use STP or coax with <100 pf/m est. with filters, and CM chokes when necessary.
Ferrite beads are like lossy RL similar in low pass response with RC (xx pF) but raises output Z(f), while RC lowers Zo(f) .
CM chokes do better if high CMRR (f) is needed.
Start with SNR goal then test for this. When achieved your design is successful. Experience with all parameters above determines how to save time in choices for signal integrity, loading and compatability, EMC.
Proximity orientation and balance of actuator noise current-cable help when coupling is radiated. Quality and choice of earth ground is also significant. Search for any keywords above for details.
If you use strong pull-up then driver must be much stronger sink. ~50-75ohms for 74HC @5V, margin is defined by attenuated noise AND DC shift. Thus trade offs. e.g SCSI uses pull-up/down for optimization.
For logic consider using Interleaved gnd ribbon cable or UTP or STP or CAT x cables and RJ style connectors
Analog and digital grounds must be carefully selected common connection point near PS source, where currents are not shared. When source is noisy SMPS, then CM noise can be high and reduced by raising CM impedance >1MHz with CM choke or often best with low Z(f) earth gnd.
Keep in mind high current spikes in skinny tracks, are Inductive and high impedance // tracks have mutual coupling.
Best Answer
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:
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