Wiring help!

Hi everyone!

I’m a little confused how to bet get this going - can anyone help?

I’m trying to measure water level depth using a ALS-MPM-2F water level trasmitter and ideally connecting it into the ADC of a M5 Atom Lite (G33 Pin). The datasheet talks to the “Power supply: 3-5VDC, 12-36VDC( standard)”. I’m wandering how i can connect this up to get a read-out from the current output and translate that into water depth.

I’m assuming I need a 24VDC power inverter??

Product is here: https://www.aliexpress.com/i/32876568163.html

Thanks in advance.

Edit: Tom’s answer below is correct. I shouldn’t post before coffee. :grin:

Have you bought the water level sensor already? They do make versions with 0-5 V output as well as RS485?
https://www.aliexpress.com/item/1005007369707085.html?spm=a2g0o.productlist.main.7.4a87heDiheDiTm&algo_pvid=07c624b3-71d0-4e01-8045-1520138d7485&algo_exp_id=07c624b3-71d0-4e01-8045-1520138d7485-3&pdp_npi=4%40dis!AUD!47.18!37.74!!!225.00!180.00!%4021032dc617217840353892275e6029!12000040462231429!sea!AU!133480197!&curPageLogUid=p1woVSFnjXqz&utparam-url=scene%3Asearch|query_from%3A

You don’t need an IC. A simple resistor will do, but yes the 0-5V version would be a lot simpler to connect if the 4-20mA has not already been purchased. However 4-20mA does have advantages, like low noise due to the low impedance of the current loop.

4-20mA:

4-20

The 130 Ohm resistor should be at least 1% tolerance and preferably 0.1%. Though if all you can get is 5% you can easily calibrate it in ESPHome.

1 Like

Thanks so much for your help, i thought I’d put this together before responding.

So I’ve bought a AC/DC converter and a 130ohm resister, connected it all up as per the above, the only readout I can get in Volts from the GND/AO is 1.06900 volts, this is consistent and not varying even though the tank level has increased over time. I’m not quite sure what I’m doing wrong!! If I look at the raw() value I’m receiving 4095. I’ve checked with a multimeter and I receive the same voltage so the M5 is reporting it back correctly.

What did you set the ADC attenuation to?

Share your ESPHome config.

Should be something like:

sensor:
  - platform: adc
    pin: 33
    name: "Water Depth"
    attenuation: 12db

Thanks Tom,

Been playing around with this a bit so had stripped it right back - i think :slight_smile:

sensor:
  platform: adc
  pin: GPIO33
  name: ${friendly_name}_Voltage       
  unit_of_measurement: volts
  update_interval: 5s

You need this:

Or the voltage will be too high.

Thanks Tom, Getting a more varied readout now :slight_smile: