Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
E16p Analog Inputs
#1
Hello,

I noticed there is a question already surrounding analog inputs but this doesn't relate specifically to the E16p Board, is Analog inputs (A01-A04) the same as CH1-CH4?

I have a couple of sensors i am using for water level measuring within a water tank, these run off 12v but the sensor returns values of between 0V-5V depending how full the tank is, the more full the tank the higher the voltage being sent down the signal wire. Is this an acceptable voltage range to be put into the CH1-CH4 (what i believe to be analog inputs) and how would i configure this in home assistant to show the water level based on the voltage just on a simple gauge or graph (5v from the sensor indicates 100% water level and 0v = 0% water 2.5v = 50% etc)

I am currently just using the home assistant config code 

with slight adjustments made to get temp and humidity information from an SHT31 sensor using SCL and SDA.

Any help would be appreciated.

kind regards,

Callum
Reply
#2
E16P have 4CH analog input ports. A1,A2 for dc 0-5v signal input. A3,A4 for 4-20mA signal input.
here is ESPHome config yaml deom for monitor analog sensor, you can check it: https://www.kincony.com/forum/showthread.php?tid=3432
if you want read SHT31 sensor, it's easy, just see SHT31 ESPHome config file at here: https://esphome.io/components/sensor/sht3xd.html
Reply
#3
(10-30-2023, 09:06 PM)admin Wrote: E16P have 4CH analog input ports.  A1,A2 for dc 0-5v signal input. A3,A4 for 4-20mA signal input.
here is ESPHome config yaml deom for monitor analog sensor, you can check it: https://www.kincony.com/forum/showthread.php?tid=3432
if you want read SHT31 sensor, it's easy, just see SHT31 ESPHome config file at here: https://esphome.io/components/sensor/sht3xd.html

That's great thanks,

I have managed to get both water and temperature/humidity sensors setup now cheers. Here is my Yaml, As you can see i have adapted the code for one sensor on pin 36 that works by returning a value between 0-2.5v and pin 35 that works by returning a value between 0-5v, this code is to convert values from both sensors so they are displayed as a percentage on a scale so i know what % of water there is remaining in my water tank.

# Individual sensors
sensor:
  - platform: sht3xd
    temperature:
      name: "Van Temperature i2c"
    humidity:
      name: "Van Humidity i2c"
    address: 0x44
    update_interval: 1s
 
  #analog sensor for water level
  - platform: adc
    pin: 36
    name: "Water level CH1 Voltage"
    update_interval: 1s
    attenuation: 11db
    filters:
      - lambda:
          if (x >= 3.11) {
            return x * 64.06640;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 60.40;
          }
 #ultrasonic sensor for water level
  - platform: adc
    pin: 35
    name: "Ultrasonic water level ch2 Voltage"
    update_interval: 1s
    attenuation: 11db
    filters:
      # - multiply: 1.51515
      - lambda:
          if (x >= 3.11) {
            return x * 32.03320;
          } else if (x <= 0.10) {
            return 0;
          } else {
            return x * 30.20;
          }
Reply
#4
good, thanks.
Reply


Forum Jump:


Users browsing this thread: