Water pressure sensor for central heating

Ok the internal ADC seems to be 12bits, while the ADC1115 has 16 bits. Not sure at the moment how much I need. I assume it depends also on the precision and the noise of the sensor itself. I assume for my purpose 12 bits is enough, because 2^12=4096 different value seems quite a lot for my pressure of my radiators hot water pressure measurements. But I might be mistaken...

Yes indeed that is something I was wondering also. Don't know if @dynamicdave has somehow taken into account the impedance of the sensor itself, but not sure at all if that is required?

Can you please explain that a bit more?

Is that both valid for the ESP32 and the ADC1115? And is there any easy way to add some protection?

Good to know!!

@dynamicdave,
Can you explain how you calculate that value please? And then my ESP is protected during most common circumstances I assume....

You can actually get a 3.3v diode zener-diode-3-3v that would allow you to use a larger range, this link also has a good explanation of how it works in this case.

1 Like

Ok last question for today. Much too late again...
I was looking for some ESP32 development boards on Aliexpress, but there are a lot of different types. And I see some reviews that they have bought clones with bad drivers and so on...
Would be nice if somebody could share a link to esp's that are ok to buy...

I got 3 of these - esp32 , like you I wasn't sure about getting them from china, also didn't want to wait ages :wink:
They work fine with Tasmota.

If it is just for the boiler sensor then you could use a cheaper wemos D1 mini, they have less I/O pins but you only need the 1 analog D1 mini

Bart if you are going to order the sensors etc from ALixexpres then i would suggest you get some ESP8266 as well - the libraries for things like Tasmota and EspEasy, ESPHome are much more developed and bug tested on those chips than the newly support ESP32.

The cost of a Wemos D1 mini or a ESP2866 Dev board is nearly nothing nowadays.

Craig

2 Likes

To answer some of the questions above.

Here's how to calculate the division ratio for a voltage-divider.
vi-div-calc
As you can see the formula is R2 divided by the sum of R1 + R2.
If R1 and R2 have the same resistance value, then it's a 2:1 divider.
The trick is finding suitable values for the resistors using the preferred range of resistors.
As mentioned in the above thread, you need to take the impedance of the transducer into account as you don't what to load it - as that would affect the results. Probably use 10K resistors in this situation.

I must have 40 or more Wemos D1 Minis (for my students), most of them flashed with ESPeasy, others with C++ using Platformio and some with Arduino sketches. As was mentioned above, these devices have been around for ages and people have done all sorts of things with them - so lots of material is available to be shared. I like using the Wemos D1, flashed with ESPeasy, as I find it is dead-easy to get a sensor up and running and send its values (using the rule facility in ESPeasy) via MQTT to Node-RED. This is purely based on the fact I discovered ESPeasy a few years ago and have stuck with it ever since. Other people on the forum have had different journeys, and like me, are happy with what they are using. I certainly don't want to get into a battle over which mouse-trap (i.e. firmware) is better than another.

First question is how many pressure sensors are you planning on using?

If it's one, then a Wemos would be suitable - just use the A0 input.
If it's up to four, then an ADS1115 and a Wemos would work.
The other option is an ESP32 Dev Board as I think you have 18 ADC channels available.
The ADS1115 is a 16-bit ADC with 4-channels and can run from a supply voltage of 2V to 5.5V

I used them with my IoT students when they built some solar-powered weather stations. Here's part of the schematic showing the resistor-divider networks and connections between the ADS115 and the Wemos.

2 Likes

Hi Bart,

For what you are planning to do even 8Bit would be fine. As the ADS1115 is so cheap and versatile I use it because it gives me everything I need (and will ever need). 15€ for a pack of 5 from a bigger German supplier (china is becomming less interesting in the last years with higher shipping fees - so support your local heroes)

As you do your research right it is worth to take a look into the datasheet (always a ton first hand information)
image

Although for your application the ADS1115 might be a total overkill it might be beneficial to get familiar with one ADC which you can use with every micro (and the PI) on the market.

But As I said the internal ADC is fine too (and one component less) and a zener diode (one component more to specify and source) as @dynamicdave suggested is fine too.

Again a quick read in the datasheet about the analog input pins:

image

So you run your ADS1115 on 5V you can scroll (or follow the link) up and read under 7.1

image

Your maximum Anlaog Votage is 5V + 0.3V = 5.3V! I can't see how you will be able to exceed this with your circuit. (and the minimum is -0.3V)

I don't see any need of more protection (more components). If you check your circuit before powering on there is no potential problem other than human error. (BTW: ! have 20+ ESPs and only fried one by inserting it 180° reverse into the socket of my motherboard - shit happens)

Last but not least as there is a lot of controversy on the net about 5V inputs pins on an ESP: Is ESP8266 I/O really 5V tolerant? – Digital Me

But this does not apply to the one ADC of the ESP8266. It works from 0-1V of the chip. Most boards come with a build in voltage divider to allow inputs from 0-3.3V. You have to take this into account when designing your voltage divider for ESP8266 boards. One Resistor to widen the range might be enough.

Simply speaking: I run 5V i2c (digital) buses on 2 devices since 3 Years with ESP8266 now with no problem. good signal stability (perhaps better than on 3.3V)
As i2c is a bus all your devices on one 5V bus have to be 5V tolerant. But you can have multiple i2c buses as i2c is a so basic protocol that the arduino drives can emulate i2c on all I/O Pins via bit banging in software (think they do this anyway even on the official D1/D2 pins). So @dynamicdave circit is absolutely correct running on 3.3V as he has a BME280 on the same bus.

Last but not least why not throwing a couple of DS18B20s in the mix to measure some temperatures of your heating system
image

They run on the so called DALLAS 1Pin Bus with individual addresses for each sensor. BUT: This is again a bus topology! Running many in a star configuration is at least unreliable. If you have cables longer than lets say 30cm you better connect each on its own I/O Pin (but there are some left over as your 4 ADCs only use 2 I/O pins :slight_smile:

The packaging is easy to strap on pipes or simply pushed under the isolation. And you even could drown them into water (I have 3 in my pond for years one at -1.5m)

2 Likes

What a bunch of useful info... Love you guys :heart_eyes:
Only from a scientific point of view of course! So don't get high hopes :rofl:

Hey @craigcurtin,
You are right. Those Wemos D1 mini devices are more than enough for my purpose.
Ok I will go for Wemo D1 mini...
Seems that amazon.de only offers nodemcu, so I think I will buy them here.

Ok now I finally am getting somewhere...
Bit off-topic so I will create two separate discussions:

  • Discussion 1: How should I power a large series of those wemo d1 mini devices.
  • Discussion 2: How can I use wired ethernet on a wemo mini. Because that perhaps limits the firmware that I need to chooce?

Then we can keep this disussion focussed on analog water sensors...
Hope to see some of you guys also in that other discussion :wink:

And how do you install those? Because they seem to have no screw like the pressure sensors, to install them into a tube...

If you want wired ethernet then I think the D1 Mini is not what you want. Get a board with Ethernet built in. You may be able to find one that can be powered over the ethernet (POE) which might be useful to you.

1 Like

As I wrote ... stuff them under your isolation and/or use straps to make good contact with the metal of your pipework. Worst case you might have a small temperature offset, but who cares. If you care you will need a calibrated sensor to calibrate your sensor. Do you trust the thermometer of your heating controller to be accurate? I wrote this before: Even the beloved BME280 in my experience comes with a huge offset of 1-3°C on most boards as it might loose its "promised" factory calibration during re flow soldering.That is a known issue (as the adafruit library even has an option for setting an offset) but not obvious until you put a good old Mercury thermometer or different sensors side by side.

What you don't want is your sensor influenced by something else i.e. components on the same PCB or inside a case heating up as these factors are non predictable and have a non linear influence.


I pulled it out a bit ... Yes "Limeprotection" is a big problem here eating away all valves.
or

I agree with Colin - Wemos D1 Mini is not suitable for wired ethernet applications.

Might be worth looking at the Raspberry Pi Pico range as they do a Ethernet HAT or a combined Pico.

EDIT: Oops sorry - this response was meant to be a general comment (not just to Colin).

Apologies! Overlooked that somehow.
Thanks for the pictures! So stupid and yet genius, I love it and must have it :wink:

Hey Colin,
If you should have any suggestions, don't hesitate to share it in that discussion 2!

Yes if that pico does the job, fine for me! Can you also please share that in discussion 2 please? Thanks a lot for the pointers!

Sorry, no, I use entirely wifi (and zigbee) for such things and have had very few problems with that.

1 Like

I would suggest to focus on one micro family ... The pico is cool (if you are able to buy one).

As Dave (EEVBlog) once said: There is not such thing as a bad micro. You only have to choose the right micro for your project.

I love the ESP family as it provides a scale able range of models ... Hardware | Espressif Systems

and great support from board manufactures and software. The even announced a zigbee and thread model of there ESP32 the ESP32-H2 Announcing ESP32-H2, an IEEE 802.15.4 + Bluetooth 5 (LE) RISC-V SoC | Espressif Systems. Think about native DIY zigbee or homekit devices.

So it is beneficial to choose your platform and stay on it as long as possible. The gained knowledge and code is then easy to "upgrade".

I tipped my toes into the STM32 platform and loved it in a way. But the community around the ESPs is in general bigger and open for thinkers like us where the STM32 is more "professional" (with all the habits against us being unprofessional kids)

2 Likes

Here's a copy of the project I'm working on for my hybrid car. It wakes up every hour, takes a reading of the car's auxillary battery voltage, sends it via a remote MQTT broker then goes back to sleep. I've programmed it using C++ to select a WiFi network from a list which means you could use it in different places.
I reckon it could be adapted for your situation. It also includes a DS18B20 - temperature sensor.

Schematic_Car battery monitor_2022-01-29.pdf (47.1 KB)

EDIT: There is an option in my design/PCB (using a jumper) to only send a reading if it is below a certain threshold, thereby saving power by not switching on WiFi (which takes the most current 140mA). That option could be used in your situation as I think you only wanted to know if the pressure was incorrect.

1 Like

I looked in this topic some years ago and asked a question on Stack Exchange: image recognition - Reading a value of a real gauge - Artificial Intelligence Stack Exchange

My assumption was, that reading a simple value of a gauge should be feasible with a Raspberry Pi or cheaper hardware, some software and little configuration. But it seems we are deep in AI here.

I'm still interested in a noninvasive solution for reading analog Gauges without installing sensors. Of course postprocessing is done with NodeRED! Ideas are welcome.

Hi @wolfred,
That is indeed a very interesting approach. Can you please create a new discussion about it, because it is a completely other approach. Then I will meet you over there :wink:

ok, @BartButenaers, done. Thank your for your image :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.