RS232 logging of well water level monitor

I’m currently using an ESP8266 interfacing with an Eno Scientific Well Watch 670 ( Well Watch 670 - Eno Scientific ) to monitor the water level in my well. I’m a beginner with all this so I started off by just using the 0-5v analog output, which works well enough, but the device offers an RS232 output through RX and TX terminals which would be more accurate than the analog output. I am trying to understand how to make this interface.

The device makes a reading every 1s and continuously reports that as plaintext RS232 output, do some light processing on that output, and report it as a sensor/store it. I do not need to transmit any data from ESP->Sensor, only read the continuous output. If I’m understanding correctly, I would want to use the ESPHome logger component with TX: GPIO1, RX: GPIO3, but that’s about as far as I’ve gotten. I’m not sure how to translate this into a sensor entity. Ultimately, my desire is for it to get the readings into InfluxDB as my current analog sensor integration does.

Can anyone help me take the next step?

Here Custom UART Text Sensor — ESPHome

Hey beehivemind,

I just purchased well watch 670. When you get it working, let me know your setup? I’m kinda a newbie. I never used ESP before. Thanks!

-g

I got it working and I love it. The WW670 is an excellent product and the Eno Scientific support very helpful.

One thing you need to know is that the RS232 output of the WW670 is higher voltage than the TTL interface of the ESP8266. So you will need something like this to convert between the two:

Many similar chips exist but this is the one I used and it worked well for me. I connected GPIO1, GPIO3, GND, and 3V3 from the ESP8266 to one side of this board and the other side to RS232 TX, RX, and GND on the WW670. Be careful to connect the Tx from one device to the Rx on the other and vice versa. If it doesn’t work the first time, this is probably why. I set the WW670 RS232 output setting to “Depth only” but if you want you can transmit more data, you’ll just have to parse it on the other end.

I used a 12v->5v converter ( https://www.amazon.com/gp/product/B08H89LTP5 ) jumped off the +/- terminals of the WW670 to power the ESP8266.

Here’s what I used for the ESPHome code, adapted from the link above in @nickrout 's post. You can remove the debug part after you get it all set up, but that will allow you to verify that it’s working in the logs.

esphome:
  name: well-monitor
  includes:
    - uart_read_line_sensor.h

esp8266:
  board: esp01_1m

# Enable logging
logger:
  level: VERBOSE #makes uart stream available in esphome logstream
  baud_rate: 0 #disable logging over uart

[...]

uart:
  id: uart_bus
  tx_pin: GPIO3
  rx_pin: GPIO1
  baud_rate: 19200
  debug:
    direction: BOTH
    dummy_receiver: false
    after:
      bytes: 150
    sequence:
      - lambda: UARTDebug::log_string(direction, bytes);

text_sensor:
- platform: custom
  lambda: |-
    auto my_custom_sensor = new UartReadLineSensor(id(uart_bus));
    App.register_component(my_custom_sensor);
    return {my_custom_sensor};
  text_sensors:
    name: "Well Watcher RS232 Output"
    id: "well_watcher_rs232"
1 Like

Thanks! Do you mind putting some pictures up of your setup?

Sure, it’s a little difficult to see here but you get the idea.
ESP + 232<->TTL chip go in a waterproof box, obviously.


Thanks! I should get my well watch tomorrow. Will give it a go.

Thank you for posting this. I bought a Well Watch and was happy to see someone had success integrating it into Home Assistant. This is my first experience with ESPHome and working with these small devices. I believe that I have everything wired up and configured correctly but things aren’t working.

I’m having a difficult time debugging. The EPS board (Wemos Lolin D32) is also configured with a sensor for the wifi signal strength and that is working as expected. I mostly get nothing from the RS232 accept for the occasional log message, so occasional that I can’t even get one now to paste it here. Something like << /EF maybe? That is all and that seemed to have more to do with me wiggling wires than anything else.

The Noyito TTL to RS232 module was not available so I have this one https://www.amazon.com/Module-Mutual-Conversion-Arduino-communicates/dp/B091TN2ZPY/ref=sr_1_5?keywords=rs232+to+ttl&qid=1678036385&sr=8-5

It has 1 less than glowing review. How do I know if it is working? The led indicating power is on, but I don’t see any activity of the Tx or Rx leds. Should those be lighting up?

Any pointers would be greatly appreciated.

Not sure about that module. You could always just use the analog out. It’s simple enough.

Turned out that everything was just fine. I was on the wrong set of pins at one time, then when I was on the correct set of pins I had them reversed. Works great but I need to find a more permanent way to mount things and get an outlet installed near the pump.

Thanks for doing the hard part.