Flow, temperature, energy measurement and PWM pump control

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Flow, temperature, energy measurement and PWM pump control

#1 Post by Domosapiens » 22 Oct 2018, 00:42

Objective is a generic Sensor/Actor unit:
- Measure temperature IN and OUT (DeltaT) for floor heating and boiler
- Measure water flow
- Calculate Energy: Flow * DeltaT * 4.18
- Control the floor heating pump by PWM, based on DeltaT
- Report flow, temperature, energy and pump speed to Domoticz
- Control pump On/Off from Domoticz
- A small box for local read-out with a LCD 1602
- Switched back-light for the LCD

Applicable for:
- Water consumption flow/temperature measurement
- Boiler-load energy measurement
- Boiler-unload energy measurement for sanitair water
- Boiler-unload energy measurement for floor heating
- Floor heating energy consumption
- Floor / Air thermostat
- Temperature-adaptive floor heating pump control
- Automatic / Manual Boiler temperature adjustment (NTC adjustment)

The unit:
Operational_unit.jpg
Operational_unit.jpg (3.88 MiB) Viewed 3375 times

Rational:
After more then 23 years of operation, it's time to re-think and replace some components of my central heating system.
The modified system will be based on a Producer-Consumer concept. Heat producers and heat consumers with both their optimal pace by decoupling with a boiler-buffer in-between.

In 2014, I modified the Grundfos UPS 25-60-180 floorheating pump's from mechanical 3 speed adjustment to a Z-wave 3 speed remote control capability. While the conventional mechanical adjustment can still be used. See: http://www.domoticz.com/forum/viewtopic.php?f=34&t=5025

During the refurbishment those pumps will be replaced (after 23 years of problem-free operation!) by PWM controlled pumps based on DeltaT and flow measurement will be added, to calculate the effective heat consumption of the 2 distribution units.

Since 2014, I measure with #16 DS18B20 sensors via #4 Z-Wave units, the heater and floor distribution units In/Out temperatures. In 2017, I started to replace them by 2# ESP_Easy units and increased the number of sensors to #28.

A good insight of the real energy need is lacking:
m3 gas * gas energy content * heater brochure efficency
the latter are both disputable (like with cars!).
For that reason I like to calculate the energy production/consumption with:
Flow * DeltaT * 4.18

Further posts will cover:
- Electrical scheme
- Bill of Material
- Building suggestions (1&2)
- RCWL-0516 Microwave Radar modification
- Level shifter modification and PWM discussion
- ESP Tasks
- ESP Rules
- Known Issues
- Incoming fresh water measurement
- Floor thermostat with rotary encoder adjustment
- Boiler thermostat with rotary encoder adjustment

[edit 21-1-19] application update
Last edited by Domosapiens on 21 Jan 2019, 21:34, edited 3 times in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#2 Post by Domosapiens » 22 Oct 2018, 00:43

- Electrical scheme
Flow measurement, Temp sensors, Energy calculation, PWM pump control and Floor heating thermostat (web version 3).JPG
Flow measurement, Temp sensors, Energy calculation, PWM pump control and Floor heating thermostat (web version 3).JPG (339.73 KiB) Viewed 2594 times
[edit]: update to V3
Re-arrangement of GPIO's
DS18B20 and pull-up moved to GPIO16=D0
Detect moved to GPIO14=D5, PU removed, current limiter resistor added
Touch (connect A) added to GPIO2=D4 (has PU on the Wemos board)
Optional Rotary encoder added, uses PU of the Level Convertor (in that case the Flow meter and PWM are not used and have no plug)
Rotary encoder switch added to GPIO0=D3 (has PU on the Wemos board)
Optional IR temp sensor MLX9061 added for air and floor measurement (hole trough the housing on position of Flow meter plug)
For IR temp senosor, see patent reference: viewtopic.php?f=2&t=5955&p=32481#p33929


This set of components just fit in the 86 Plastic Project Box (8.6*8.6*2.6cm), that has on the backside a DIN rail adapter.

I/O
- 230V, less then 1.5Watt
- XS8-4 M-plug: 2 up to 8 DS18B20 sensors
- XS8-3 M-plug: Flow meter like YF-B6, USC-HS10TA or proximity sensor LJ12A3-4-Z/BX-5V
- XS8-2 M-plug: WITA Delta Top 25/60 PWM 180 pump

The level converter is modified: from channel 4, the 10KOhm Drain resistor is removed,
to support max 5mA PWM current as needed for the WITA pump.

The RCWL-0516 is modified, the 220 Ohm Antenna resistor is replaced by 330 Ohm ([edit]: 470 Ohm not correct) to reduce the detection range.

Currently I have 6 units under production:
2# housing closed & under test
2# housing open & under test
2# soldering & waiting for parts

[edit 3-11-18]:
update to scheme V2
Pull-up Cnt3V removed (PU already in LC)
RCWL-0516 330 Ohm still under test
Enable RCWL-0516 added against alarm flooding
Capacitors added against false alarms
[edit 19-11-18]:
expected soon ...update to V3
[edit 10-03-19]:
scheme V2 removed
Last edited by Domosapiens on 11 Mar 2019, 23:16, edited 11 times in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#3 Post by Domosapiens » 22 Oct 2018, 00:43

Bill of Material
(I know how much time this saves!)

DIN rail adapter MNWL DINRAIL ADAPTER 72MM
search in https://onderdelendatabase.nl/

DIN rail JMV DIN-RAIL TS35SL LG2
search in https://onderdelendatabase.nl/

Power supply 5V HLK-PM01
https://nl.aliexpress.com/item/Free-Shi ... itle=true

86 Plastic Project Box Case voor LCD1602
https://nl.aliexpress.com/item/86-Plast ... Title=true

DS18b20 temperature probe
https://nl.aliexpress.com/item/TZT-1PCS ... Title=true

Aluminium Foil Adhesive Sealing Tape for DS18b20 mounting, like:
https://nl.aliexpress.com/item/Aluminiu ... Title=true

WeMos D1 mini ESP8266
https://nl.aliexpress.com/item/5PCS-lot ... Title=true

16X2 LCD 1602 module Blue/Yelow Green screen IIC/I2C (Use only as reference!)
My suggestion buy separate LCD 1602 module and I2C module to solder them in parallel.
https://nl.aliexpress.com/item/LCD1602- ... Title=true
M3*6+6 Black Nylon Spacer Male to Female Hex
https://nl.aliexpress.com/item/100PC-Lo ... Title=true

RCWL-0516 Microwave Radar
https://nl.aliexpress.com/item/Free-Shi ... itle=true

0805 SMD Resistor Kit pack for 470Ohm modding of the RCWL-0516
https://nl.aliexpress.com/item/SMD-Resi ... Title=true

TTP223 Touch Key Switch Module (Alternative for RCWL-0516)
https://nl.aliexpress.com/item/10Pcs-TT ... itle=true

10x22 cm DIY Prototype Paper PCB (for 2 units)
https://nl.aliexpress.com/item/10x22-cm ... Title=true

4 channel IIC I2C Logic Level Converter
https://nl.aliexpress.com/item/10PCS-II ... Title=true

XS8 Aviation connector 8mm push-pull circular quick connector 2pin3pin4pin
https://nl.aliexpress.com/item/Free-shi ... Title=true

Isolation: 0.25mm thickness PTFE Teflon Adhesive Tape
https://nl.aliexpress.com/item/1-Roll-0 ... Title=true

Example of Flow sensor
G3/4" YF-B6 water Hall magnetic Brass flow sensor (search for your size & prices)
https://nl.aliexpress.com/item/3-4-wate ... itle=true
M12 4mm sensing DC 5V (!!) inductive proximity sensor switch NPN NO LJ12A3-4-Z/BX-5V
https://nl.aliexpress.com/item/Free-shi ... Title=true

For test, to emulate a pulse counter:
Frequency Signal Generator
https://nl.aliexpress.com/item/Signal-G ... itle=true

Cabling:
Wire Wrap Strip Unwrap Tool WSU-30m AWG 30
https://nl.aliexpress.com/item/1pc-new- ... Title=true
AWG30 Wire Wrap cable 8 color
https://nl.aliexpress.com/item/New-arri ... itle=true

Stranded CAT 5 cable for plug connections (cheap)
Striped solid CAT 5 cable for power and ground lines (cheap)

White AC 250V 10A,EN,EU,Round 2 Pin 4.0mm Power Cord plug
https://nl.aliexpress.com/item/10pcs-wh ... Title=true
Ferrules Tool Crimper Plier
https://nl.aliexpress.com/item/0-25-2-5 ... Title=true
20AWG Bootlace cooper Ferrules (also in other sizes) [corrected on 25-10-18]
https://www.aliexpress.com/item/100PCS- ... 4c4dedX3k2

3-12mm Step Cone Drill
https://nl.aliexpress.com/item/3pcs-Hss ... Title=true

Rotary Encoder:
https://nl.aliexpress.com/item/5pcs-EC1 ... Title=true
Knob:
https://nl.aliexpress.com/item/Aluminum ... Title=true

IR sensor GY-906 MLX90614ESF-BAA (opening 45 degrees):
https://nl.aliexpress.com/item/GY-906-M ... Title=true
Under study:
MLX90614ESF-BCC (opening 35 degrees)
MLX90614ESF-DCI (opening 2 degrees, ideal, but expensive and large size)

Black Hot Melt Glue Stick (to prevent false side-light from LCD)
https://nl.aliexpress.com/item/10pcs-25 ... Title=true

X9C103P X9C103 DIP-8 E2POT Nonvolatile Digital Potentiometer
https://nl.aliexpress.com/item/High-Qua ... Title=true

[edit 3-11-18] Buy LCD 1602 and I2C separate
[edit 21-12-2018] Rotary Encoder, Knob and IR sensor
[edit 19-01-2019] Black Melt Glue, X9C103P Nonvolatile Digital Potentiometer
[edit 21-01-2019] Aluminium Foil Adhesive Sealing Tape for DS18b20 mounting
Last edited by Domosapiens on 21 Jan 2019, 21:27, edited 10 times in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#4 Post by Domosapiens » 22 Oct 2018, 00:44

Building suggestions 1
(description level: beginner/intermediate)
Sorry: Board problem with pictures, need to solve this

Create a drilling template, print it on sticker paper (see picture below) and use some dish-washing liquid on the box before you sticker it to move it in the correct position (drying needs some time). Make sure... on the bottom side, check the sliding screw holes!
Mark the drilling positions with a piercer, drill 1mm, then 5mm.
Use the step cone drill, for smooth result, to enlarge the 3 right holes to 8mm.
Remove, by cutting, the internal plastic screw protection (we need all the space in the box).
Use 4mm slanted head screws to mount the DIN rail adapter (not upside down!) and isolate the screws.
Cut the middle set of 3 out of the 5 supplied buttons and glue them in the box (to fill the holes, no other function).

Left: top UP, Right: bottom UP:

Pic1

Wire the plugs with slanted CAT5 cable. Check the XS8-4 pole for numbering, I have seen different number schemes. No problem as long as you don't mix order batches (as I did).
Prepare a 230V cable, add the Power Cord plug, where using ferrules and crimper plier gives a nice and safe result (see BOM)

Pic2

I don't have the experience for PCB design and production. To prevent lead-times, re-work and lead-times again, I used my eighties skills of soldering and Wire-Wrap.
Cut a 79.5mm * 79.5mm PCB board (mark it with a Stanley knife and break along the lines).
Clear 8mm space for the plugs. Drill mounting holes on the corners and holes for the LCD spacers (10.6 and 41mm from the top, very close to the side). Clear some space (10.9*10.9mm) for the LCD back-light potentiometer (12.9mm from top and from the right).
Check your LCD, I have seen some different sizes for this potmeter.
Clear the copper around the 230V side of the power supply.

Solder the 5V and 3.3V power-line. The Ground-line has 2 Via's: 1 under the level shifter and one to pass the 5V line. The 5V power supply goes via 2 jumpers (for setting to work) to the 5V- and Ground-line. The 3.3V line is feeded by the Wemos D1 Mini.

Pic3
Attachments
Drilling template and power lines.JPG
Drilling template and power lines.JPG (166.57 KiB) Viewed 3302 times
Cable connection.jpg
Cable connection.jpg (435.75 KiB) Viewed 3302 times
DIN rail both sides.jpg
DIN rail both sides.jpg (300.36 KiB) Viewed 3302 times
Cable connection.jpg
Cable connection.jpg (435.75 KiB) Viewed 3303 times
Last edited by Domosapiens on 22 Oct 2018, 13:50, edited 6 times in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#5 Post by Domosapiens » 22 Oct 2018, 00:44

Building suggestions 2

Check the LCD for a correct mounting of the I2C print (straight, in parallel with the LCD)
With my second batch of 2# LCD's this was not, and it took a lot of de-soldering rework to get it corrected. Lessons learned: buy seperate LCD an I2C units.
Place some isolation tape in the free space between the LCD an I2C unit, to prevent contact if we close the box.
Use 2 times 4 spacers of 6mm (see BOM) : under and on top of the LCD
On the back of the I2C unit there are 2 pins for the LCD back-light (with jumper).
Cut the pins, remove the PVC holder, cut again and solder a connection between them.
Turn the other 4 pins 90 decrease to go trough the PCB holes.
Check that the potentiometer of the I2C unit goes trough the cutted PCB hole
The Level Converter is placed under the LCD, also there put some isolation on the LCD.
Check that it fits between the mechanical lips of the LCD.
Also the 470uF Elco is placed under the LCD, check for the correct position, the mechanical lip of the LCD.
At the side of the power supply there is a 2*2 pin jumper configuration to decouple the PS from the circuit. Here you can insert 5V from an external power supply with current limitation during Setting To Work (STW).
The interface between PCB and connector cables is via long pins. Long pins because they are convenient for Dupont wires to measure. From PCB to the pins via a hole in front and power/ground soldered on top, plug cables soldered on the bottom of the pins. The 47uF Elco sits in front of the DS18B20 power lines for undisturbed power.
The Wemos D1 mini has it's USB connection to the outside, not optimal for the WiFi so close to the PS, but needed in case of a "hard programming".
The Wemos female connectors are convenient for measurement during STW.
As spacer under the Wemos I use 4 small cuts from plastic swab stems.
Keep the height of the Wemos below the PS height.
Also cut the long pins some more below the PS height (for the unused buttons on the cover)
Under LCD_2.JPG
Under LCD_2.JPG (1.55 MiB) Viewed 3292 times

For all data-lines I use WireWrap with AWG30 wire (see BOM), a simple and convenient way of connecting.
Under LCD_2.JPG
Under LCD_2.JPG (1.55 MiB) Viewed 3292 times
Attachments
WireWrap front-back_2.JPG
WireWrap front-back_2.JPG (1.75 MiB) Viewed 3291 times
Last edited by Domosapiens on 23 Oct 2018, 01:07, edited 2 times in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#6 Post by Domosapiens » 22 Oct 2018, 00:44

RCWL-0516 Microwave Radar modification and TTP223 Touch sensor usage:

After endurance tests with several units, I skipped the idea of replacing the resistor on the left bottom marked 221 (220 Ohm, 0805 SMD) by a 470 Ohm.
With the 470 Ohm you reduce the antenna gain.
It does reduce the detection range to around 1 meter.
But ... side effect ... it shifts also the center frequency ..I assume too close to the 2.4Ghz WiFi frequency.


Currently I use a 1M-ohm type 0805 SMD on position R-GN on the RCWL-0516 it reduces the range to 5m according to spec.
Tested on several units, and gives a good result.
My experience is that it reduces detection down to ~3 meter.
This could be caused by the close mounting to the LCD1602 with it's metal frame.
Use a 1KOhm series resistor to limit the output current.
Detection's from the RCWL-0516 are used to switch the LCD back-light on, for a limited time (via a Rule).

With the "Enable" connection it is possible to define in a rule, if the RCWL-0516 is active.
My experience so far is that "Enable" always leads to a detection ... (have to check further).
The idea is to switch off the RCWL-0516 while the LCD back-light is on, to prevent a flood of detection interrupts when people stay longer in close vicinity.

When multiple units are close to each other(like in the boiler room), I foresee that there will be only one RCWL-0516 active, to prevent interference and race conditions.
The "Detection" will then be distributed to the other close-by units via a rule and inter-ESP communication (have to find out how).

As alternative a TTP223 touch switch is mounted at the side of the RCWL-0516. (photo will follow)
This switch is a parallel possibility to switch the LCD on, for a limited time (via a Rule).
The TTP223 is connected to GPIO2=D4 with a pull-up resistor on the Wemos board (needed for boot).
Therefore the TTP223 needs to be active "Low": the pad marked "A" needs to be interconnected.
As result the red Led is always on. So I removed the serial resistor marked 121.
The TTP223 has also a double-click role for the thermostat setting.
Last edited by Domosapiens on 21 Dec 2018, 12:13, edited 2 times in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#7 Post by Domosapiens » 22 Oct 2018, 00:45

Level shifter modification and PWM discussion.

In 2014, I modified the Grundfos UPS 25-60-180 floorheating pump's from a mechanical 3 speed adjustment to a Z-wave 3 speed plus Off remote control capability.
See:http://www.domoticz.com/forum/viewtopic.php?f=34&t=5025
Thanks to this modification the electrical usage is rather low.
During the upcoming refurbishment those pumps will be replaced as precaution (after 23 years of problem-free operation!).

The same type is still available, but also more efficient permanent-magnet pumps are available (f.i. Wilo, Gundfos, OEG)
They have new features as adaptive, constant pressure and constant flow.
In my floor heating system there are no, flow limiting, temperature controlled valves per group. The groups are hydraulic static balanced (works perfect!)

Secondary, the boiler is smart, the thermometer is smart, but together not! (not created for floor heating)
Adding a third smart component (adaptive pump) ... I assume it makes the system even more dumb.

So the new features: adaptive and constant pressure are useless for my system.

Left-over is the 3 speed constant flow: like the old pump has ....but...
Thanks to the permanent magnet, a modification for remote control as I did before, is not possible!

In the world of Solar Boilers they all use permanent magnet PWM controlled pumps.
Solar Boiler pumps are way much cheaper (~100€ less) with the more advanced PWM control capabilities!
But they have a size of 130mm instead of the usual 180mm for floor heating.
Grundfos offers adapters from 130mm to 180mm for around 100€.
Seems like a cartel, 180mm pump prices are over the top.

Then I found out that OEG pumps are rebranded pumps from WITA.
WITA is producing 180mm PWM controlled pumps Delta MIDI 60 and Delta Top 60 as replacement for Grundfos UPS 25-60-180 and Wilo.
https://www.wita.de/en/product-category ... rol-input/
https://www.wita.de/en/products/pump-te ... pie-kopie/
https://www.wita.de/wp-content/uploads/ ... TOP_60.pdf

For an acceptable price:
https://www.pumpendiscounter.de/ReigaGb ... ienzpu.htm

With: 4 constant characteristics, 4 proportional characteristics, minimum operating Level, externally controllable PWM characteristics.

It has a PWM Heating characteristic:
When the PWM signal is switched off, the pump runs at maximum speed. This ensures that the system can function in an emergency, even if the controller is defective or the connection cable is broken. As the PWM signal rises, the speed of the pump falls.
PWM curve.JPG
PWM curve.JPG (20.16 KiB) Viewed 2938 times

And it has a PWM Solar characteristic: (not used)
When the PWM signal is switched off, the pump is in stand-by mode. This ensures that the system does not overheat.
Nice he?

There is no need to note the polarity of the lead.
PWM current is not specified (not so nice!) but after contact with Wita, they stated 5mA (@ 4.5 - 15V / 100 - 1000Hz).
PWM form.JPG
PWM form.JPG (20.94 KiB) Viewed 2938 times
So, some kind of level shifting of the ESP PWM output pin is needed.
The used level shifter can not supply 5mA as it is a high resistance solution.
Therefor I removed the pull-up 10K SMD resistor of channel 4.
10K SMD removed.JPG
10K SMD removed.JPG (42.11 KiB) Viewed 2940 times
That means it now also acts as inverter.
ESP PWM control must compensate for that. As the PWM signal rises, the speed of the pump rises.
The PWM of the pump must be connected to 5V and the level shifter pin.
(Looks somewhat strange, 5V as reference, but it acts on potential difference, in theory it must work, not tested yet).

Speed control will be based on DeltaT between incoming and outgoing.
High speed at large DeltaT.
In this way an optimal emission from the floor to the room should be possible.
Another experiment in the future will be ... keep a slow flow in the floor all the time, because I think, getting the flow started after a stop, takes a lot of time/energy.
I see an impulse response of some 5 minutes (hot water in up-to change at output).
Last edited by Domosapiens on 19 Nov 2018, 10:06, edited 5 times in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#8 Post by Domosapiens » 22 Oct 2018, 00:45

Reserved for:
- ESP Tasks
Last edited by Domosapiens on 22 Oct 2018, 01:23, edited 1 time in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#9 Post by Domosapiens » 22 Oct 2018, 00:46

Reserved for:
- ESP Rules
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#10 Post by Domosapiens » 22 Oct 2018, 00:46

Reserved for:
- Known Issues

Delay on the project due to:
- many WatchDog reboots
- many NAN values from DS18B20
- NAN propagation in Rules?
- many "HTTP: C001 connection failed"

Currently #6 units under test

Solved HW issues:
- taming the RCWL-0516 (solved with 1K serial resistor in V3)
- re-order of GPIO's (solved with V3)
- TTP223: because of the bridge "A" for Active Low, the red LED is always on, unless touched. This red light shines trough the Plastic Project Box Case. Solution: just remove the LED with a solder iron.
- The LCD has stray light on left/right sides, that shines trough the Plastic Project Box Case. Use a thin layer of Black Melt Glue to block the unwanted light.
Black_glue_20190119_163201.jpg
Black_glue_20190119_163201.jpg (4.09 MiB) Viewed 2330 times

[edit 19-01-2019] 4 solved HW issues: RCWL-0516, GPIO re-arrangement,TTP223 and GPIO re-order.
Last edited by Domosapiens on 19 Jan 2019, 21:18, edited 4 times in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

vincen
Normal user
Posts: 89
Joined: 26 Jun 2017, 07:15

Re: Flow, temperature, energy measurement and PWM pump control

#11 Post by vincen » 22 Oct 2018, 07:30

Domosapiens wrote:
22 Oct 2018, 00:43
- Electrical scheme
Thanks a lot for all the details and scheme ;)

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Water measurement with inductive proximity sensor switch NPN NO LJ12A3-4-Z/BX-5V

#12 Post by Domosapiens » 19 Nov 2018, 10:09

Incoming fresh water measurement with inductive proximity sensor switch NPN NO LJ12A3-4-Z/BX-5V
Make sure you have the 5V version ! Then it can be connected via a standard level converter.

To mount the NO LJ12A3-4-Z/BX-5V, I have used a scrap piece of Acryl/Acrylic.
Drilled a hole and used a heater to bend it 90 degrees.
2# clamps of 80mm, used for rain drains, hold the support in place.
Make sure that the sensor is mounted as close as possible to the rotating metal indicator.
Check the red led when the indicator is rotating.
If needed, you can use a hand file to make the blue cover somewhat thinner without damaging the sensor.
Stop filing when you see an inner circle appearing. The inner sensor is than still protected.
(was needed for my 12V type prototype, not for the 5V version)
.
W1 sm20190121_160648.jpg
W1 sm20190121_160648.jpg (375.96 KiB) Viewed 2239 times
.
Additionally #2 DS18B20 sensor are used:
- one for the incoming water temperature (useful)
- one for the incoming gas temperature (curiosity)
I use Aluminum Foil Adhesive Sealing Tape to mount the metal shield of the DS18B20 on the pipe.
.
W2 sm20190121_160900.jpg
W2 sm20190121_160900.jpg (254.58 KiB) Viewed 2239 times
.
Use the Generic Pulse counter as device, named Flow:
- GPIO-12 (D6)
- Debounce time: 0
- Counter Type: Delta
- Mode Type: Rising
- IDX from Domoticz, create a General, Counter Incremental (adjust the meter offset there)
- Interval 60 sec
- Count: 1 decimal
- Total: 3 decimal

Display:
scan for I2C address: 0x27 OR 0x3F (Tools page)

Line 1: Wc [Flow#Count] Wt [Flow#Total]
Line 2: tW [TempL#TemperatureL] tG [TempH#TemperatureH]
Interval: 30 sec.

(with temperature task TempL value name TemperatureL and temperature task TempH value name TemperatureH)
.
W3 sm20190121_161025.jpg
W3 sm20190121_161025.jpg (1.63 MiB) Viewed 2239 times
The PWM plug (P3) is not implemented here
The front-side buttons are only to cover the standard holes.

With the IDX in the Flow task, Domoticz shows the hourly water usage: L/hour.

To get more than 1 value in Domoticz, I use this Rule:

Code: Select all

On Flow#Count do
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=171&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=122&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=123&nvalue=0&svalue=[Flow#Count]
Endon
This Rule distributes the Counter value to 3 other sensors in Domoticz:
- to test for the well known Domoticz peak-value bug, to 2# Type RFXMeter, RFXmeter counter: both have the same bug at the same time: now and then strange extreme values (useless!)
- to a counter Type General, Waterflow, that gives the water usage in L/min (useful! for peak usage, to check your shower)

I will use this L/min water meter also to calibrate the YF-B6 and USC-HS10TA flow sensors in a later stage.

To control the LCD for 1 minute On, the following rules are used:

Code: Select all

On System#Boot do
GPIO,15,1 //Enable RCWL-0516, disable=0
LCDCMD,on
timerset,1,60
Endon

On Detect#Switch=1 do
LCDCMD,on
//SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=switchlight&idx=147&switchcmd=On
timerSet,1,60
Endon

On Touch#Switch=0 do
LCDCMD,on
//SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=switchlight&idx=147&switchcmd=On
timerSet,1,60
Endon

On Rules#Timer=1 do
LCDCMD,off
//SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=switchlight&idx=147&switchcmd=Off
Endon
Last edited by Domosapiens on 21 Jan 2019, 21:24, edited 1 time in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

IR Floor thermostat with rotary encoder adjustment

#13 Post by Domosapiens » 19 Nov 2018, 10:10

IR Floor thermostat with rotary encoder adjustment (first impression)
IR sensor: GY-906 MLX90614ESF-BAA (opening 45 degrees)

This thermostat operates between a maximum Air temperature and a minimum Floor temperature.
f.i. "keep the floor at 24C while the air is below 22C"
No complicated PID control, but just: burn for 15 minutes with 35C, then wait for 7 minutes.
For my current set-up (heater only, no boiler) this results in 1 or 2 burn cycles per hour. Floor hysteresis less then 0.3C.

Some impressions of the test bench.
th1 sm20190121_000821.jpg
th1 sm20190121_000821.jpg (327.83 KiB) Viewed 2265 times

Note: protective LCD cover is still there.
The thermostat is not in the loop, just an offline test.
th2 sm20190121_000736.jpg
th2 sm20190121_000736.jpg (253.15 KiB) Viewed 2265 times

Topline is Air temperature and maximum Air setpoint
Bottomline is Floor temperature and minimum Floor setpoint

Sensor positions:
Th_3.JPG
Th_3.JPG (67.97 KiB) Viewed 2265 times

For test I added 2 DS18B20 sensors (red):
- bottom
- under the knob
They do not offer a more accurate solution then the MLX9061, so they will be skipped in the next version.

The IR sensor MLX9061 (blue) has an opening of 45 degrees and is mounted tilted under an angle of ~22 degrees (4mm).
With the thermostat mounted at 1.5m height, it has a floor coverage of a circle of 1.5 meter from the wall.
That needs an unblocked view on the floor.
Take care of your feet! They will influence the measurement (not so nice!).
The sensor MLX9061 works also, as secondary Task, as air temperature sensor.

Because of the close-by electronics, both tasks need some constant temperature adjustment.
Use an IR sensor and an air temperature sensor for that.

A rotation step gives a +/- 0.1C shown as third value on the bottom line (Floor temperature adjustment).
A push on the button includes the change into the Floor temperature setpoint and removes the adjustment value.

A long push on the TTP223 touch switch (on the top, left), switches to the Air temperature adjustment (top line)
A rotation step gives a +/- 0.1C shown as third value on the top line.
A push on the button includes the change into the maximum Air temperature, removes the adjustment value and ends the Air temperature adjustment.

Automated back light by the RCWL-0516 radar sensor (works pretty well!).
Fall-back for back light: a single push on TTP223 touch switch.

Remark: The mains cable is not optimal positioned, but space is limited!

Under study:
Current sensor:GY-906 MLX90614ESF-BAA (opening 45 degrees)
Compared to:
MLX90614ESF-BCC (opening 35 degrees)
MLX90614ESF-DCI (opening 2 degrees, ideal, but expensive and large size)

Rules will be published later.
Last edited by Domosapiens on 21 Jan 2019, 21:39, edited 2 times in total.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: Flow, temperature, energy measurement and PWM pump control

#14 Post by Domosapiens » 20 Dec 2018, 01:42

Reserved for patent discussion/infringement.

I'm not a lawyer, but have some experience with patents as (co-)owner of 3 patents.

Electrical scheme Version 3 claim:
Offers a solution for a thermostat with continues compensation for heat loss by a pump with variable speed (0-100%)
where the pump is triggered by a minimal floor temperature and restricted by a maximum air temperature, where the pump is fed by a heat buffer.
I will not claim a patent for this, but as for today, I claim this idea is mine.

See for reference:
- https://tinyurl.com/comparable-patent
- https://tinyurl.com/comparable-USpatent
(please do not use the patent numbers in reply's, don't wake the lawyers)

EU citizens are allowed to use patents for personal use.
US citizens are not allowed to use patents for personal use.

Background documentation: How do I read a patent? - the Claims
http://www.bpmlegal.com/howtopat5.html
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Boiler thermostat, NTC adaption

#15 Post by Domosapiens » 19 Jan 2019, 23:38

Reserved for:
- Boiler thermostat by NTC adaption
- with automated timed rule
- with manual rotary encoder adjustment

Heating concept:
De-couple heat-producers from heat-consumers. Let producers and consumers run in their optimal "sweat spot" and "shave the peaks"

Idea:
My future boiler contains domestic water for shower and washing.
My future heater has a 12K NTC resistor (@20Celcius) sensor to control the boiler temperature.
The heater will be adjusted to a boiler temperature of 35-45℃.

During day and night, the boiler will be used for the floor-heating via a heat exchanger and mixer (down to 25℃).
The PWM pump control will take care of the room temperature control (see post 7)

During the morning (shower rush time) the boiler will have during 1 hour, a higher temperature (50℃).

Concept design:
part of NTC curve, temperature versus resistance (red line):
12K_NTC_curve.JPG
12K_NTC_curve.JPG (25.99 KiB) Viewed 2327 times

In series with the NTC, I will use a X9C103P Nonvolatile Digital Potentiometer, a 10K potentiometer with 100 steps of 100 Ohm
https://www.renesas.com/en-eu/www/doc/d ... 04-503.pdf

This seems easy to control: a GPIO for Up/Down and a GPIO for pulse per step, with optional Chip Select (for power down).

Image
[Not tested yet]

The NTC curve is described by an approximation of y = 17091e-0.1841x
where x is temperature and y is resistance (see blue line).
ESPEasy can not do such calculation.

So I will use a set of rules to increase/decrease the temperature per 5℃ with steps of 100 Ohm.
f.i.
- 11 steps to go from 40℃ to 45℃.
- 9 steps to go from 45℃ to 50℃.
- 7 steps to go from 50℃ to 55℃.

Example:
NTC is 5500 Ohm @ 45℃
NTC is 4600 Ohm @ 50℃
Setpoint heater = 45℃, so heater will burn until it measures a resistance higher than 5500 Ohm.
If the X9C103P contributes 900 Ohm, the NTC has to be 4600 Ohm before the heater stops. NTC is 4600 Ohm @ 50℃
Result: the heater thinks that the boiler is 45℃, while the boiler is actual 50℃.

A timed rule will be used to increase the temperature a half hour before "shower rush time" to heat-up.
A timed rule will be used to decrease the temperature one hour later.
Manual adjustment per 5℃ can be done with rotary encoder adjustment and push to accept.
The display shows Actual temperature, Setpoint and adjustment.

Robustness:
- At boot, the X9C103P will be set to zero value.
- A Let statement will define the upper bound (maximum steps between heater setpoint and 65℃)
- A TaskValue will guard the upper bound (remaining steps to 65℃)
- In case of a loop error, worst case the X9C103P will go to 10K and the boiler temperature will be 10℃. (=WAF problem)
- The manual rotary encoder adjustment will be reset after 1 hour.
- The manual rotary encoder adjustment will be per 5℃ with an upper limit of 65℃.
- Special attention has to be given to a spontaneous re-boot during "shower rush time": restore increased value
- In case of a cable disconnection, the heater will report an error (assumption, to be validated)
- In case of a cable short-circuit, the heater will report an error (assumption, to be validated)

more to follow ...
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests