The following pics show how much you can file off the case before the sensor starts malfunctioning.
Height before: 4.55mm. Height after: 4.15mm
Thickness before: 3.6mm. Thickness after: 2.4mm
I kept filing it down:
At 3.9mm height, copper starts to show. Still working!
3.8mm: the copper tab is around 3.4x0.5mm in size. Still working. In this state it reacts instantly to temperature changes! Still working.
Height: 3.3mm. We're getting close...
3.3mm height, 4.5mm width, 2.4mm thick. Still working!
That's it. Our beloved sensor is dead now. The two shiny spots you see is the part of the actual die. It is located in the back of the case (where the case is rounded).
Sensor reads a steady 24°C at this point. No change whatever you do.
Conclusion:
You could file off another 0.2mm off front and back to get to a final thickness of around 2mm. Your final sized down sensor would have the following dimensions:
Height: 3.4mm (to be safe), thickness: 2mm, width: 4.6mm
Wouldn't this put the device somewhat out of spec?
Wouldn't it be simpler and easier to use the SOIC version if you need it to be less chunky?
Or couldn't you select a different part that's equally well supported? The BMP180 for example is tiny, and has air pressure as a bonus.
Not saying shaving components when you're in a hurry isn't an option (I've shaved many an LED to fit into places) - just not an ideal thing to do if you can order a part.
@Tin feel free to replicate this on your horizontal-surface grinding machine. I used a small hand file by the way. Not exactly easy to get perfectly angled cuts that way...
The biggest problem I've had with DS18D20s is that, if you are measuring temperature a lot higher / lower than ambient, the case and leads connected to the sensor will tend to introduce stem effects that can make temperature readings off by a few degrees.
Being able to make a good thermal connection to the copper tab should help with this a lot.
Another thing I've been doing is putting 50 mm - 75 mm of Dumet wire between the sensor and the copper leads I use to connect the sensor to my electronics. Dumet is an Iron / Nickel alloy that has a 10th the thermal conductivity of copper. These two design details should make for some really accurate DS18D20 temperature measurements.
Wouldn't this put the device somewhat out of spec?
Wouldn't it be simpler and easier to use the SOIC version if you need it to be less chunky?
Or couldn't you select a different part that's equally well supported? The BMP180 for example is tiny, and has air pressure as a bonus.
Not saying shaving components when you're in a hurry isn't an option (I've shaved many an LED to fit into places) - just not an ideal thing to do if you can order a part.