Skip to content

Adding sensors to BSB–LAN

fredlcore edited this page Jun 22, 2024 · 2 revisions

In addition to the sensor data that your heating system provides (such as outside, room or flow temperature), you can also add your own sensors for additional data collection. There are three types of sensors that are supported by BSB-LAN "out of the box":

  • DS18B20 temperature sensors (a.k.a. "OneWire", "1-Wire" or "Dallas" temperature sensors)
  • DHT22 temperature/humidity sensors
  • BME280 temperature/humidity/pressure sensors

DS18B20 temperature sensors

In order to connect a DS18B20 sensor to the microcontroller, you have to identify an unused data pin first (for the Olimex EVB, you can repurpose one of the two I2C GPIO pins 13 and 16, located on the UEXT connector on pins 5 and 6). For other microcontrollers, please check the respective pinout. The identified pin on the microcontroller is referred to as GPIO-DATA from now on.
On the sensor side, the pins are either referred to as VCC, DATA and GND, or the cables are color-coded, where black usually refers to GND, red to VCC and the remaining connection to DATA. In any case, make sure to check the documentation.
Then you have to make the following connections:

DS18B20 Microcontroller
VCC 3V3
DATA GPIO-DATA
GND GND

The one-wire system also requires a pull-up resistor between VCC and DATA of approximately 4.7k. This one should be added close to the microcontroller. For further information on setting up a reliable, long 1-Wire network, see the documentation of the manufacturer.

Upon successfully adding the sensors, you have to enter the selected GPIO-DATA pin in the configuration (a value of -1 disables DS18B20 sensors). To access the sensor(s), go to the Sensors category where you will find the DS18B20 sensors in parameter range 20300 to 20399. Each parameter will consist of two components:

  • The .0 component contains the sensor ID
  • The .1 component contains the measured temperature

Take note: The assigned parameter number to a sensor can change as it depends on the detection during the booting of the microcontroller. To identify a sensor exactly, you have to evaluate the sensor ID as well.

DHT22 sensors

In order to connect a DS18B20 sensor to the microcontroller, you have to identify up to two unused data pins first (for the Olimex EVB, you can repurpose one of the two I2C GPIO pins 13 and 16, located on the UEXT connector on pins 5 and 6). For other microcontrollers, please check the respective pinout. The identified pin on the microcontroller is referred to as GPIO-DATA from now on.
On the sensor side, the pins are either referred to as +, out and -, sometimes a fourth pin is also present. In any case, make sure to check the documentation.
Then you have to make the following connections:

DHT22 Microcontroller
+ 3V3
out GPIO-DATA
- GND

Upon successfully adding the sensors, you have to enter the selected GPIO-DATA pin(s) in the configuration (a value of -1 disables DHT22 sensors). To access the sensor(s), go to the Sensors category where you will find the DHT22 sensors in parameter range 20100 to 20199. Each parameter will consist of four components:

  • The .0 component contains the sensor ID
  • The .1 component contains the measured temperature
  • The .2 component contains the relative humidity
  • The .3 component contains the absolute humidity (g/m3)

Take note: Contrary to DS18B20 sensors, the parameter numbers are tied to the sorting order of the GPIO pins entered in the configuration. So unless you change the pins or their order, the parameter numbers will always refer to the same sensor attached to that pin.

BME280 sensors

In order to connect up to two BME280 sensors to the microcontroller, you have to identify the I2C GPIO pins first, please check the respective pinout. Take note which pin is SDA and which pin is SCL.
On the sensor side, take note of the I2C address that the sensor contains. Usually, this can be determined via three solder pads, and the sensor's address depends on which ones are connected/not connected. Check the documentation of the sensor and make sure that the first sensor listens to the address 0x76 and a potential second sensor listens to address 0x77.
Then you have to make the following connections:

BME280 Microcontroller
VIN 3V3
SDA SDA
SCL SCL
GND GND

Upon successfully adding the sensors, you have to enter the selected number of sensors (1 or 2) in the configuration (a value of 0 disables BME280 sensors). To access the sensor(s), go to the Sensors category where you will find the DS18B20 sensors in parameter range 20200 to 20299. Each parameter will consist of six components:

  • The .0 component contains the sensor address
  • The .1 component contains the measured temperature
  • The .2 component contains the relative humidity
  • The .3 component contains the pressure (in hPa)
  • The .4 component contains the altitude
  • The .5 component contains the absolute humidity (g/m3)

If you need more than two BME280 sensors, you can connect up to eight of them using a TCA9548A I2C multiplexer chip. Theoretically, you could even chain several of them in order to access 64 sensors, but we haven't received feedback on this. So if you have chained two or more multiplexers, please let us know how/if this works!

Clone this wiki locally