1-Wire Digital Thermometer

Model: Thermometer DS18S20
Purpose: Measures temperature.
Purchased from: www.hobby-boards.com
Details:
Measures temperatures from -55C to +125C (-67F to 257F)
0.5C accuracy from -10C to +85C
9-bit thermometer resolution
 
You are probably saying that it looks like a transistor, true, but it's not.
The two outer legs are connected to ground and the centre pin is the DQ pin or the 1-wire Data line.
 
 
Maxim 1-Wire Temperature Sensor DS18S20 mounted inside a DSE RJ-45 Network cable joiner.
 

Complete inside case.