Difference between revisions of "Temperature monitoring with Dallas DS18B20 sensors and Domoticz"

From CommonsLab
Jump to navigation Jump to search
(re-added wikimedia commons images + mention coating)
(→‎Sensor Pinouts: Add ADC and I2C pins)
 
Line 17: Line 17:
 
| [[File:Wire white orange stripe.svg|60px|Pair 2 Tip]]<br/> White/orange&nbsp;stripe
 
| [[File:Wire white orange stripe.svg|60px|Pair 2 Tip]]<br/> White/orange&nbsp;stripe
 
| Rx + ||  
 
| Rx + ||  
| not connected
+
| NC (I2C SCL)
 
|  
 
|  
 
|-
 
|-
Line 23: Line 23:
 
| [[File:Wire orange.svg|60px|Pair 2 Ring]]<br/> Orange solid
 
| [[File:Wire orange.svg|60px|Pair 2 Ring]]<br/> Orange solid
 
| Rx − ||
 
| Rx − ||
| not connected
+
| NC (Analog)
 
|  
 
|  
 
|-
 
|-
Line 29: Line 29:
 
| [[File:Wire white green stripe.svg|60px|Pair 3 Tip]]<br/> White/green&nbsp;stripe
 
| [[File:Wire white green stripe.svg|60px|Pair 3 Tip]]<br/> White/green&nbsp;stripe
 
| Tx + ||
 
| Tx + ||
| DATA
+
| DATA (I2C SDA)
 
| [[File:Wire white.svg|60px]]<br/> White
 
| [[File:Wire white.svg|60px]]<br/> White
 
|-
 
|-

Latest revision as of 15:03, 11 October 2018


Sensors

We use the DS18B20 sensors, pre-mounted into a waterproof flange from the BrewPi project. These have RJ11 (6P4C) connectors pre-crimped, which we replace with the more common RJ45 (8P8C) connectors and extend the cable with a standard CAT5e FTP (or STP) cable. The connections are similar to the the common T568B color coding and the follow the 802.3af (Power Over Ethernet / POE) with respect to the DC +/- colors.

Sensor Pinouts

Pin numbers on an 8P8C (RJ54) plug.
Pin number T568B color 10/100 mode B,
DC on spares
RJ45 connector (8p8c) DS18B20
flange-cable color
Pin 1 Pair 2 Tip
White/orange stripe
Rx + NC (I2C SCL)
Pin 2 Pair 2 Ring
Orange solid
Rx − NC (Analog)
Pin 3 Pair 3 Tip
White/green stripe
Tx + DATA (I2C SDA) Wire white.svg
White
Pin 4 Pair 1 Ring
Blue solid
DC + +3.3V Wire red.svg
Red
Pin 5 Pair 1 Tip
White/blue stripe
DC + +3.3V Wire red.svg
Red
Pin 6 Pair 3 Ring
Green solid
Tx − GND (- for data) Wire black.svg
Black
Pin 7 Pair 4 Tip
White/brown stripe
DC − DC - (for power) Wire black.svg
Black
Pin 8 Pair 4 Ring
Brown solid
DC − DC - (for power) Wire black.svg
Black
Pin number RJ11 connector (6p4c) DS18B20
flange-cable color
Pin 1 empty (no contact)
Pin 2 not connected
Pin 3 Vdd (+3.0V — +5.5V) Wire red.svg Red
Pin 4 GND (-) Wire black.svg Black
Pin 5 DQ (DATA) Wire white.svg White
Pin 6 empty (no contact)

Development Progress

Part 1: Fixed installation - 8 temperature sensors per ESP

In this part, we want to attach as many DS18B20 on one ESP as possible, with the circumstance, that the sensors are up to 40 meters apart from each other.

GPIO pin assignement

The NodeMCU has it's own designation of pins for the ESP8266, just like the Arduino has for the ATmega328.

We use D0 - D7 as digital inputs for the 1-Wire connection to the DS18B20 temperature sensors. D8 can not be used for 1-Wire devices, because the 1-Wire bus needs a pull-up resistor and the D8 is GPIO15 on the ESP8266, which needs to be LOW at power-on or reset, otherwise the controller will not boot.

Cable length testing

ESPeasy-DS18B20-flanged-20m-test.jpg

The first sensor with 20 meters CAT5e FTP (unshielded) cable and 8p8c (RJ54) connector and socket (for PCB) works, when connected to ESPeasy.

Production

The PCB was produced in the CNC. The parts were hand-soldered and covered with conformal coating (4 layers of acrylic spray). The PCB was installed in an outdoor rain-proof enclosure, together with a 5V/1A USB power supply.


Part 2: Valve control - 4 Sensors and 4 Relays per ESP

In this part, we need to monitor 4 temperatures and control two valves, which are operated with an electric motor. Each motor is operated by 220V and has an internal end-stop switch, which breaks the circuit at the correct motor/valve position, as well as returns the 220V on a feed-back contact to signal successful operation.

220V circuit

Valve controller 220V circuit.png

The electric motors can also be energized by manual override buttons, one to open and one to close each valve. The automatic control is done by one SSR (Solid State Relay), which is used for the state of the motor (ACTIVE/INACTIVE) and one electromechanical relay, which is used for the direction (OPEN/CLOSE).