Peripheral hardware


Temperature sensor DS18B20

The digital temperature sensor DS18B20 External link from Maxim Integrated External link is an ingenious piece of hardware. It delivers accurate temperature readings over a single data wire which can be shared with several other DS18B20 sensors. Each sensor has its own unique hardware address which is used to relate a temperature reading to a specific measurement point.

Product image of the digital temperature sensor DS18B20 from Maxim Integrated.

The temperature sensor is available in several different encapsulations, from stainless steel water tight, to weather resistant, to vented for indoor applications.

A good range of configurations is available here External link from a supplier in Sweden.

Connect the temperature sensor to the ESP-node according to this article.

Magnet sensor reed switch

Detecting the presence of a magnet with a reed switch External link is commonly used in applications such as monitoring the open/closed state of a door, window or gate. Home security systems can usually be configured with this type of sensor. Another application is logging some sort of consumption measured by analog metering equipment for either gas or water. Many of these meters have a magnet which moves when the number wheels in the totalizer unit rotate. This creates detectable impulses for a reed switch which is proportional to the consumption.

Product image of a typical reed switch.

The reed switch has two pins or wires without polarity just like a regular switch. It operates as a closing switch when a magnet is within detection range. The internal resistance is very low which may require an additional resistor to limit the current when the reed switch closes. Some versions do have three pins or wires and therefore operates as an alternating switch.

Reed switches are produced with a specific level of sensitivity. The sensitivity is measured in ampere-turns External link or AT. A low AT value means the reed switch has higher sensitivity compared to a similar one with a higher AT value. If the distance between the reed switch and the magnet is more than a few millimeters or the magnet is fairly weak, then a high sensitivity reed switch must be used.

Electronic components can be sourced at this External link very good suppler in Sweden.

Connect the magnet sensor to the ESP-node according to this article.

Light intensity sensor LDR

The easiest way to detect light or measure the light intensity is by using a light dependent resistor or LDR External link. This fairly uncomplicated component has two pins or wires without polarity just like a regular resistor. The LDR is not as accurate as the more sophisticated photo diode or photo transistor but is sufficient in many applications.

Product image of a light intensity sensor LDR.

To detect if it is light or dark, or count the flashing of an indicator light, just connect the LDR to a digital input of an ESP-node or similar micro controller. When the LDR is exposed to light the resistance is lower than when it is not exposed to light (in darkness). The variation in resistance can be as much as several mega ohms.

Measuring the level of light requires an analog input on the ESP-node and some additional components for a voltage divider to achieve a usable measuring range. Calibration is also necessary if specific levels of light should be detected.

Electronic components can be sourced at this External link very good suppler in Sweden.

Connect the light intensity sensor to the ESP-node according to this article.