I have my Raspberry Pi 2 running Nagios 4 in a small HiFi cabinet which I have converted into a rack of sorts, and would like to monitor the temperature of said rack.

Ideally I would like to not have to use a breadboard so I could utilise the GPIO pins directly on the Pi.

I should say I'm not very well versed in pulling data off sensors, so any advice on that is really appreciated too.

  • 1
    A breadboard can never be a requirement, it is just a convenience for use in development, experimentation, etc. Once you are clear on the connections, you can ditch the breadboard one way or another.
    – goldilocks
    Commented Aug 10, 2015 at 1:17

3 Answers 3


A popular choice is the DS18B20 1-wire sensor. The link is an example, not an endorsement.

It only requires three connections to the Pi (one gpio, ground, and 3V3 power) and a 4k7 resistor between the output line and 3V3.

It has Linux kernel support so reading the sensor is simply the matter of reading a file.

If you search the site for DS18B20 you will find plenty of examples.

  • A bread board is needed for this though, right?
    – SORoss
    Commented Aug 9, 2015 at 21:21
  • No. You connect the three sensor pins to three pins on the Pi. Personally I'd probably use three male to male jumper wires. Stick the sensor pins in one end and solder for security and push fit the other ends of the jumpers over the Pi pins. I'd solder the 4k7 resistor between the output and 3V3 pins at the sensor end. Using wires would give you flexibility in actually positioning the sensor.
    – joan
    Commented Aug 9, 2015 at 21:30
  • Ah I've got you, it looks like all the tutorials out there feature a breadboard which is annoying as I'm certainly a beginner at this! Thank you for your help.
    – SORoss
    Commented Aug 9, 2015 at 21:43

If you are not afraid of using a soldering iron or a breadboard you could use a LM75 temperature sensor. You can gather the temperature via i2c.

Beware that there exist two variants: LM75CIM-3 and LM75CIM-5 which need either 3.3V or 5V. You can useboth variants with your RPI but beware when connecting it to your RPI!

Both will give you the temperature in a 9 bit two's complement format (signum = 1 bit, 8 bit "real data"). The sensor ranges from -55°C to +125°C with a resolution of +/- 0.4°C.

Finally you could use the i2c utils from the linux kernel to talk to your sensor and poll data.


You could try something like this Temperature sensor for Raspberry Pi. It plugs directly into the GPIO pins of the Pi. It comes fully assembled so no soldering required.

You then need to find a tutorial for the LM75 sensor and reading it using the I2C bus. You could try this Raspbian LM75 temp logger... which shows you how to read and plot the results graphically.

  • Have edited the answer as that GPIO plug-in sensor comes fully assembled, so no soldering required.
    – recantha
    Commented Aug 9, 2015 at 17:21

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.