Category Archives: Sensors

How to make the 1-wire bus more reliable on a Raspberry Pi

Thermal sensors, such as DS18B20 can be connected to the Raspberry Pi via 1-wire bus. However, the 1-wire bus is not implemented in hardware, but only as software emulation on GPIO4, which has some major disadvantages. The 1-wire data link is acting as a very long “antenna” which catches interferences. All GPIO pins of a Raspberry Pi are directly connected to the CPU. So every interference cought on 1-wire bus is transported directly to the Broadcom SoC. Furthermore, the 1-wire protocol needs a very tight and time-critical signal generation, so it’s resource-consuming to communicate with 1-wire slaves and therefore highly unreliable if running on a non-real-time operating system.
I noticed that the DS18B20 sensors, which I have wired to my Raspberry, return at least once or twice a day bad temerature values, making it impossible to retrieve reliable max/min temperature data.
I recently stumbled upon a DS2482S-100 1-wire master breakout board that allows to control one or many 1-wire slave devices by simply sending I2C commands, relieving the task of generating the time-critical signals the 1-wire protocol requires. It provides bidirectional protocol conversion between an I2C master and 1-wire slave devices. The breakout board makes use of a DS2482S-100 converter, that is exclusively sold in a SO-8 package which doesn’t fit onto a breadboard.

Continue reading How to make the 1-wire bus more reliable on a Raspberry Pi

Monitoring air quality with a Nova PM2.5/PM10 Sensor and Python

It is a major problem in almost all large German cities, that fine particulate matter is frequently exceeding  its maximum permissible value of 50 μg/m3. In a special issue of the Make Magazine (IoT special 01/2017), I read an article about the Nova PM SDS011 sensor, which is using the principle of laser scattering to measure the concentration of particulate matter between 0.3 to 10 μm in the air. The sensor is cheap (about 20 Euro) and easy to use, since it communicates via serial connection.

For placing the sensor into an enclosure,  it is equipped with a nozzle that allows to connect a hose of max. 1 m length. The UART communication protocol requires a bit rate of 9600 baud, with 8 data bit, no parity and one stop bit.

Continue reading Monitoring air quality with a Nova PM2.5/PM10 Sensor and Python

A Raspberry Pi Moisture Sensor to Monitor Your Plants

For quite a while I am monitoring temperature and humidity in each single room of my apartment. I was inspired by several Raspberry projects, featuring a “Garden Pi“, to monitor my house plants as well, using a probe to measure moisture level of soil.

On the net, one can find many low-cost sensors which are compatible with Arduino or Raspberry Pi. They usually consist of simple PCBs with two electrodes which are pushed into the earth. Moisture is determined by measuring conductivity of the soil which isn’t very reliable for long-term measurements. Cheap sensors are often affected by heavy corrosion, so that  Copper ions will leach out and might poison your plants.

moisture-sensorIn contrast, sensors measuring soil moisture levels by capacitive sensing rather than resistive sensing are much more suitable, because they are made of corrosion resistant material which gives them an excellent service life.

Continue reading A Raspberry Pi Moisture Sensor to Monitor Your Plants

Using the ESP8266 module for the Internet of Things

About two years ago, a cheap five dollar microcontroller has been entering the maker scene, featuring b/g/n wireless LAN.  The ESP8266 is manufactured by a Chinese company, called Espressif Systems and became soon very popular as a building-block for home-automation and IoT projects.These modules were distributed on  Ebay, the Amazon Marketplace or AliExpress for a few dollars. However, communication with most of the ESP8266 modules requires an external USB-to-Serial-Adapter and a special procedure to bring the device into “flash-mode”, which can be cumbersome in some cases, especially for beginners. With the brand-new WeMos D1 Mini, the setup was significantly simplified, so that it is as easy to use as an Arduino UNO.


Continue reading Using the ESP8266 module for the Internet of Things