The DS18B20 and DHT11 are two cheap, simple-to-use temperature sensors. They can even work side-by-side for added data collection.
OUR EXPERT
Les Pounder is the under-paid associate editor at Tom's Hardware and a freelance maker for hire.
YOU NEED
> Any Pi model
> The latest Pi OS
> DHT11 temperature sensor
> 3x female to female jumper wires
> DS18B20 temperature sensor
> 4.7K Ohm resistor (Yellow Purple Red Gold)
> Breadboard
> 3x male to female jumper wire
> Code and diagrams at https://bit.ly/Ixf290sensors
The electronics world has many different, cheap and simple sensors that we can use to gather temperature data. We've chosen two models that meet all of those categories, and will show you how to use them with just a few lines of Python.
Three wires is all we need to connect the DHT11 to our Raspberry Pi. Buy a DHT11 with a built-in resistor - they're much easier to work with.
Project 1: DHT11 sensor
The DHT11 is often bundled in electronics kits for the Raspberry Pi and Arduino. It's accurate to within five per cent between 20 and 80 per cent humidity, and ±2°C between 0 and 50°C. This makes it a great hobby sensor, but not ideal for projects that require precision.
There are two versions of the DHT11: a basic version with no pull-up resistor; and our version, which has an integrated resistor. If you can, buy this version.
This story is from the {{IssueName}} edition of {{MagazineName}}.
Start your 7-day Magzter GOLD free trial to access thousands of curated premium stories, and 9,000+ magazines and newspapers.
Already a subscriber ? Sign In
This story is from the {{IssueName}} edition of {{MagazineName}}.
Start your 7-day Magzter GOLD free trial to access thousands of curated premium stories, and 9,000+ magazines and newspapers.
Already a subscriber? Sign In
Create your first WebSocket service
Mihalis Tsoukalos explains how to use the Go programming language to work with the WebSocket protocol.
Fantastic Mr Firefox
Nick Peers takes a trip down memory lane to reveal the story behind the rise - and slight fall - of Mozilla's popular web browser.
Set up your terminal and email like it's 1983
Jump in the hot terminal time machine with Mats Tage Axelsson who emails from the command line using the latest technology.
Universal layer text effects with GIMP
Posters use them, films and presentations are hard to imagine without them: text effects. Attract attention with Karsten Günther and GIMP.
Jump to a federated social network
Nick Peers reveals how you can get up and running with this free, decentralised and non-profit alternative to Twitter.
Free our SOFTWARE!
Taking anything for granted is dangerous, so Jonni Bidwell and Mike Saunders revisit how the free software movement got started to help free us from proprietary tyranny!
Master RPI.GPIO
Les Pounder goes back to the early days of the Raspberry Pi - and his career with this classic library! -
Waveshare Zero to Pi3
Transform your Pi Zero into a Pi 3, they promised Les Pounder, but it's more like adding on go-faster stripes.
The Best OPEN SOURCE Software Ever!
In an attempt to trigger controversy, Michael Reed and Neil Mohr unequivocally state these are the greatest free software apps ever. Probably. We’re just trying to be helpful.
Linux-Mandrake 7
Simplicity and a wide range of applications make this a great distribution for all Linux users.