Elektor_Mag_-_January-February_2021

([email protected]) #1
lektor January & February 2021 47

  - platform: adc
    name: “Target temperature”
    id: t_target
    icon: “mdi:temperature-celsius”
    pin: A0
    update_interval: 5s
    # Convert potentiometer scale to °C (min=6.75°C,
max=31.75°C)
    filters:
      - multiply: 25.0
      - offset: 6.75
    unit_of_measurement: “°C”
    on_value:

this YAML file (see below). Adding filters allows for compensating the
measured temperature in some way if needed.

Target Temperature
The target temperature is set with the potentiometer. Add it to the sensor
section of the YAML file by defining a sensor of the adc platform type as
the value is a voltage. Using so-called sensor filters, the input voltage is
converted to a temperature value that corresponds to the scale printed
on the enclosure. The equation Ttarget = 25•Vin + 6.75 fits quite well in my
case. This translates to a multiply filter with value 25 and an offset filter
with value 6.75. By specifying the units as °C, an automation controller
like Home Assistant will treat this data as a temperature.

Figure 3: Some parts from the old thermostat were reused in the new
design. This included the enclosure, which explains the strange shape of the
new PCB. It also put constraints on the positioning of certain components.


Figure 6: Assembly completed. The two pushbuttons are accessible through
two cut-outs (left) and the sensor sticks out of what is the bottom. The
green and yellow LEDs are only visible through the ventilation slits to avoid
lighting the room at night. Using different colours for them makes it easy to
see which one is turned on.

Figure 5: After some minor adjustments of the old thermostat’s enclosure
(i.e., cutting away some plastic), the new board fits snuggly.

Figure 4: Everything SMT is mounted on the backside of the board. The
traces connected to the heater (right upper corner) were reinforced with
extra solder to allow them to carry large currents without overheating.
The slot right below them provides galvanic isolation between the high-
and low-voltage parts. The black thingy sticking out on the right is the
temperature sensor, protected by heat-shrink tubing. All the heat-producing
parts are located on the left side of the board and are supposed to point
upwards after installation of the thermostat.
Free download pdf