SENSORS
Cheaper sense and sensor-abilities
The ever-frugal Les Pounder reveals how two of the cheapest sensors on the market can bring a wealth of data to your Raspberry Pi project.
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/lxf290- sensors
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.
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.