На информационном ресурсе применяются рекомендательные технологии (информационные технологии предоставления информации на основе сбора, систематизации и анализа сведений, относящихся к предпочтениям пользователей сети "Интернет", находящихся на территории Российской Федерации)

Feedbox

12 подписчиков

Picking the Right Sensors for Home Automation

Author: Maya Posch / Source: Hackaday

Imagine that you’re starting a project where you need to measure temperature and humidity. That sounds easy in the abstract, but choosing a real device out of many involves digging into seemingly infinite details and trade-offs that come with them. If it’s a low-stakes monitoring project, picking the first sensor that comes to mind might suffice.

But when the project aims to control an AC system in an office of temperature-sensitive coders, it pays to take a hard look at the source of all information: the sensor.

Continuing a previous article I would like to use that same BMaC project from that article as a way to illustrate how even a couple of greenhorns can figure out how to pick everything from environmental sensors to various actuators, integrating it into a coherent system that in the end actually does what it should.

Popularity Isn’t a Good Indicator

A major issue when it comes to figuring out which components one needs is that there are a lot of (online) articles, forum posts and other commentary out there by people who are using the same sensors and actuators without ever really questioning why they are using those devices and not others. A good example of this are the DHT11, DHT22, and AM2302 temperature and hygrometer sensors. While very popular and used by everyone and their dog, they come with a whole range of potential issues.

This sensor and a number of others were recently compared in a comprehensive test. The findings of that test showed that across six different sensor devices (specifically the DHT22, BME280, SHT71, AM2320, HTU21D and Si7021), the DHT22 performed the worst, with three out of six sensors outright dying over the course of two years.

They also showed issues with variability between individual sensors and a lack of long-term stability and reliability. Long-term stability cannot be expected, self-heating is an issue, and there’s no reliable way to detect strong heating or cooling as compared to a failing sensor.

Another issue that makes this range of sensors so annoying to work with is that they use their own, proprietary interface and protocol. This protocol is somewhat similar to the 1-wire protocol as invented by Dallas Semiconductor, but uses its own timing system and without the bus-mastering additions. With only its from Chinese translated datasheet to base a library on, one has to raise serious questions about the reliability of any system that includes one of these sensors.

In the BMaC project we initially started out with these DHT22 sensors as well. They were cheap and plentiful, and at first glance they seemed to be just fine. Unfortunately the breakout boards we had did not include the proper resistors on the breakout board, so humidity measurements were off by a few percent RH, as we found out later. These sensors, especially including the breakout boards, are rather bulky as well, making them hard to integrate into projects.

At some point we came across this MEMS sensor from Bosch, the BME280. It was similar to the BMP180, another quite popular MEMS temperature and relative humidity sensor. The BME280 does pretty much the same, only a bit more accurately, and also adds air pressure measurements. Even better, these sensors on a nifty little breakout board cost little more than the DHT22 boards we’d been using until that point.

These Bosch sensors all use either an I2C or SPI bus. This means that one can hook multiple of these sensors to a single I2C bus and communicate with them using an industry-standard protocol. This massively simplifies the sensor code, as it only has to concern itself with reading out the appropriate registers, instead of also the timing and interpretation of the received bits.

So in short, these BME280 sensors turned out to be the superior choice for the project. They are much smaller and more accurate, use a standard interface, and make it easy to chain multiple sensors to a single microcontroller and gaining air pressure readings in the process.

Devil is…

Click here to read more

The post Picking the Right Sensors for Home Automation appeared first on FeedBox.

Ссылка на первоисточник

Картина дня

наверх