Another illustration how to control and wire the Rolling Ball Tilt Switch or Ball Sensor along with Raspberry Pi. Ball tilt switch allows you to detect an location or inclination they are small and easy to wired-up it use low
Wiring the DS18B20 Digital Thermometer w/d Raspberry Pi
The DS18B20 is a digital thermometer provides 9bit to 12bit Celsius temperature measurement, this device has an alarm function with nonvolatile that user can program upper and lower trigger points. DS18B20 communicates over one wire bus or one data line