Building an ESP8266 with multiple pressure sensors (using ADS1115 and ESPHome)

It would probably be helpful if you told us exactly which esp board you are using, and a link to a schematic if possible?

Thanks i will do so, unfortunately my son has come 3 weeks early so things are upside down at the moment.

Hi Nickrout, Hopefully this would help.

The Nodemcu micro controller im using from what i can tell is the Lolin NodeMCU V3. Should be this one below.


Which should have the same specs as
https://docs.zerynth.com/latest/official/board.zerynth.nodemcu3/docs/index.html.
And here is simple schematic
https://imgur.com/a/hExQLjc
This is the pressure sensor
https://wiki.dfrobot.com/Gravity__Water_Pressure_Sensor_SKU__SEN0257.

So In theory im wanting to use the pressure transducer to send its 4.5V max output signal to the trimpot to adjust it for the 3.3v max signal of the Analog pin.
Then from there Use Esphome to adjust any offset and mulipliers for the to get the reading which in turn turns on the pump to pressurize and turn off when full pressure is reached. The solenoids will then be operated on a timer. Im not sure if my wiring would be correct though for the pressure transducer? or if i need another resistor with the trim pot. The A0 pin does seem to have a 10k and 220k resistor on the board between pin and esp8266 chip leading me to think this does the 0-3.3v to 0-1v conversion needed for the esp8226 chip? Thanks again . any help would be greatly appreciated. Im just having trouble getting the correct readings and want to make sure everything is wired correctly first. from there i can adjust trim and try again with the readings. The solenoids and timers i have working fine.

Are you sure they aren’t 100k and 220k? That would make sense to drop 3.3v to 1.0v.

To drop the 4.75v input to 3.3 you’ll need another 100k/220k combination.

In any event you need a voltage divider.

Hi, Yes im starting to understand that the chip will only provide 0-1V, the pin will provide 0-3.3v stepped down to 0-1V and the sensor will provide 0-4.5V stepped down to 0-3.3V.

Apologies , yes its 100k/220k on the A0 Pin.

Would the 2k trim pot not work as an alternate divider to drop from 4.5V to 3.3V.?
Is my thinking correct that the 2k trimpot can provide a 533.3 Ohm and 1466.575 Ohm resistances to drop the 4.5 to 3.3v
Thanks for all the help

@R3plic8 did you keep going with this and if so did you get a working solution or stuck / need some help?

Hi Daniel.

I did not get it working as i wanted it to, but i managed to get it working enough that it did what it needed to.

I got as far as receiving the pressure data in voltage and cross referencing that to a physical inline pressure gauge. from there i set the voltages(pressure) i wanted the relay to turn off an on at.

1 Like

Another option is what I did switch to an ESP32 it simplifies this alot!

 - platform: adc
    name: "Pressure"
    pin: GPIO35
    id: pressure
    update_interval: 60s
    unit_of_measurement: "PSI"
    accuracy_decimals: 2
    attenuation: 11db
    filters:
      - calibrate_linear:
        - 0.5 -> 0.0
        - 2.5 -> 30.0

This uses a level shifter 5V high side 3V3 low side and you have multiple Analog pins also

3 Likes

@DrJeff amazing!

Don’t know if it can be useful for anyone but I’ve build an esp32-based 5-port pressure and power socket controller with pressure sensors from aliexpress (exactly like that TS shown) and voltage dividers.

It shows current pressure on an LCD and manages two 220V power sockets (via two SSRs) depending on min\max pressure settings and max on / min off time, I’m using it to control my air compressor and lights (the last one TBD) in my air-atomized aeroponics farm.

Here is the code:

2 Likes

With regard to the voltage drop, is there any reason not to just add a 180kOhm Resistor in series to modify the built in 100/220 divider to 100/400?

As per: https://www.letscontrolit.com/wiki/index.php/Analog_Pressure_sensor

I’m a complete noob so given the negligible cost difference, and ability to add further sensors later I’ve decided to try a ESP32 (Thanks for the suggestion @DrJeff), but watching these topics with interest.

Can you provide the wiring diagram for the sensor and the level shifter? Also is the sensor the dfrobot gravity SEN0257? Does the sensor signal go to the 5V side and steps down to 3.3V or is it the other way around? Apologies for the thread revival as well.

also interested needing to measure my air pump pressures

I think its the same sensor ? apart from I went for .5MPa

sensor:
  - platform: adc
    pin: A0
    name: "Pressure Sensor 1"
    id: 'PressureS1'
    unit_of_measurement: "MPa"
    filters:
    - offset: -0.16895
    - multiply: 3.3
    - lambda: return x;
    update_interval: 1s

currently not using voltage divers because pressure is only 1m of water and should be under 1v
and the air pumps should not go over .5v pressure

now the air pump should be 0.042 Mpa and with a little leak its reading .11Mpa and rests 0.00195 Mpa and with sensor removed its -0.51564
so I am assuming this D1 mini clone does have a voltage divider I do see a 224 resistor after the ad0 pin and I just have to find some math to match these up ? I was thinking * 3.3 / 10 would be believable readings ?

also not sure why I seem to need to divide /10 but until I get another pressure gauge its all guess work
or do I do 0.11 / 3.3 = 0.0333 Mpa also believable reading

other sensors I have are

these are what I have been using with the Arduino but can not seem to get them to work with my esp
it uses ad0 and sclk but unsure how to add the sclk pin as esp will not allow me to set another pin ?

so here is my 2 cents,
I am using the same pressure transducers 2 ways , in fermenter’s to calculate co2 pressure, and in my kettles to calculate volume. The esp8266 can not take over 3.3v. however the ADS1115 is not sending voltage to the esp3266 it is sending a digital number. There is no need to use a stepdown in voltage to utilize the 16 bit Analog to Digital converter. I do not know how to code much for arduino ide, so I use Tasmota.
In conjunction with node red. I can utilize the digital number to calculate psi, and then for the vessels needing volume I use the formulas for Water column height. x surface area x .004329(that’s 1 cubic inch of water) and that gives me my volume.
hope this helps some of you since this is an old post. cheers,

1 Like

Can someone provide wiring diagram for two pressure sensors, ads1115 and wemos d1?

I could really use a wiring diagram for the esp32 if someone is willing to share. Am trying to hookup 4 pressure transducers with one of them having a rather long (10m+) rj45 wire (if that has any bearing in the whole setup) back to the controller module

So all these ESP boards and pressure inducers are a little bit different. I have a spreadsheet set up for each board so I can work out which pins I am going to use. I have a two pressure sensors; one is running 24m but powered at 24v and running into ADS115 to give more accuracy. Let us know what you have

I have D1Mini and this transducer: 5V 0-1.2 MPa Pressure Transducer Sensor Oil Fuel Diesel Gas Water Air Sensor Sale - Banggood USA Mobile

I understand now that I need to get an ESP32 as the D1Mini has a single ADC and my project involves 4 transducers! Any one in specific you would recommend?

Or you could put your sensors through an ADS1115. It has 4 inputs that then are passed through your single ADC pin.
Pat

1 Like