Looking for recommendations for local weather station. Ambient Weather recomendation?

The temperature and humidity sensor is a Sensiron SHT3C, which does not appear to be handled properly by ESPHome’s SHT3X-D platform. :frowning:

Fortunately, ESPHome has the SHTCX platform for this chip!! :slight_smile:
And it’s confirmed working perfectly. One chip down, just a few more to go…

i2c:
  sda: SDA
  scl: SCL
  scan: True
  id: bus_a
  
sensor:
  - platform: shtcx
    address: 0x70
    temperature:
      name: "Outdoor Temperature"
    humidity:
      name: "Outdoor Humidity"
    update_interval: 30s
1 Like

Decided to start tackling the wind vane / anemometer signals next. Broke out the Raspberry Pi for this one, figured it might be easier to sense and display the signals from a real operating system. Meanwhile, for anyone interested, here’s a picture of the anemometer signals as well as the rain gauge signals. The anemometer signals are GND, SOL, VDD, AN1, DEN, and AN0 that you see wired on the lower left. The rain guage is a flip-flop bucket that triggers a magnetic reed switch. That’s it on the bottom center where it’s labeled RAIN. Every flip or flop is so many CCs / cubic inches of rain. It will require a couple of counters that reset on the hour and/or day to measure the rainfall coming through the gauge.

Have you considered the alternative of receiving the 433MHz transmissions, and decoding them? A bit more SW oriented, and less HW oriented. Could hook up to an ESP at the weather station if you wanted the link to be WiFi, or you could use something in the house and let the link be 433 MHz.
A second alternative might be to intercept the digital data before it gets modulated onto the 433 MHz; just have to find the right traces on the board (unless that’s all done inside the unmarked chip).
This all assumes that the transmitter is autonomous - that it turns on and just starts transmitting data without having to get commands from the display unit.

That was definitely a thought. I opened the display/monitor hoping to find traces I could tap, but that was similarly devoid of any obvious opportunities. :frowning: I know others have previously intercepted a weather station wireless signal, but I was hoping to provide a strictly ESPHome solution. When the connections were so clearly identified for each sensor on the weather station, I decided for the 100% ESP32 solution. This is a fun side-project for a few weeks. If I can resolve another device connection every few days, it will be quite worthwhile. :slight_smile:

Thought I’d chase an easier target this morning. Using GND and the top connection of the RAIN gauge reed switch, ESPHome can easily count pulses when the gauge flip-flops. Still need to measure exactly how much rain/water causes the gauge to flip, then we can adjust the multiply filter accordingly. :slight_smile:

sensor:
  - platform: pulse_counter
    pin: 32
    name: "Rain Gauge"
    update_interval: 15s
    unit_of_measurement: 'Inches'
    filters:
      - multiply: 0.10
    
    total:
      unit_of_measurement: 'Inches'
      name: "Total rainfall"
      filters:
        -  multiply: 1.0
1 Like

How to measure Integration of rain pulse counter into daily value This earlier post provided a LOT of insight into configuring a rain gauge. Many thanks :heart: to the authors there.

I’m posting just so you can continue.
I think the limit to the forum is 3 in a row and then you can’t post in a thread until someone else does.

There is a thread here I think “DIY Zigbee rain gauge” that might give you some info.

1 Like

Tried chasing the wind direction vane yesterday, didn’t have any repeatable results. I’ve been trying to keep the station sensors connected to their original microprocessor, so I could read the values on the original display, but that doesn’t work for the anemometer and wind vane, as they are resistance/voltage readings and cannot be shared effectively. To remedy that, this morning the wind vane was removed and the signal points within were identified. SOL is the SOLAR PANEL positive lead. :man_facepalming: Not sure how I never guessed that one.

Here is a photo of the anemometer/weather vane circuit board, with signal lines labeled. The two small black integrated circuits appear to be Hall effect sensors, in the North and West locations. I’m searching for other ESPHome anemometer / vane YAML files, hoping to find something that works with this hardware. The best so far is this Reddit post from user bassicrob
Shoutout to @bassicrob :wave:

Those AN0 and AN1 signals? They have nothing whatsoever to do with the actual anemometer and wind speed. That’s on the opposite end of the weather station, using a glass reed switch as a pulse detector to calculate the wind cup rotations. Now, precisely how AN0, AN1, and DEN all combine to indicate wind direction is still unknown. I would expect either the voltage or resistance to vary according to the vane position, but so far the results are not making any sense to me. :frowning:

It MIGHT be as described by this article describing the trigonometry necessary to calculate the angle. However, it’s probably a LOT easier to use this Melexis MLX90316 integrated circuit to obtain the direction from the SPI bus. :wink: Details for using the chip.

I e-mailed info @ Sainlogic to ask which sensor they were using for barometric pressure, and the answer was as useless as you might expect. It was easier to simply order a BMP280 sensor and combine temperature, humidity, and barometric from a single SPI device.

Sunday morning: The BMP280 arrived this morning and is connected and working well. :slight_smile:

ESP32 is working with everything except the wind vane (direction) sensor. HUGE THANKS to user @bassicrob for his previous work in ESPHome with the ESP8266 and Sparkfun devices. His YAML provided a perfect example of the rain gauge bucket counter and wind speed pulse counter calculations. (Still need to perform tests/measurements for these particular devices.)

Here’s the ESPHome YAML so far:

esphome:
  name: weather_station
  platform: ESP32
  board: lolin_d32

wifi:
  ssid:     "mywifi"
  password: "mypassword"

#
# Enable debug logging
#
logger:
  level: debug

#
# Enable Home Assistant API
#
api:
  password: "mypassword"

#
# Enable over-the-air (WiFi) updates
#
ota:
  password: "mypassword"

#
# Global variable definition
# - How often do sensors update to Home Assistant?
#
substitutions:
  update_time: 20s
  
#
# I2C bus for BME680 temp/pressure/humidity sensor
#
i2c:
  sda: SDA
  scl: SCL
  scan: True
  id: bus_a

#
# SENSORS
#
sensor:
#
# BME680 temperature / pressure / humidity
#
  - platform: bme680
    address: 0x77
    update_interval: ${update_time}
#
# temperature is returned in Celsius/Centigrade by default
# use a lambda filter to convert to Fahrenheit
#
    temperature:
      name: "Outdoor Temperature"
      oversampling: 16x
      unit_of_measurement: "degrees F"
      filters:
      - lambda: return x * (9.0/5.0) + 32.0;

#
# pressure is returned in hectopascals (hpa) by default
# use a multiply filter to convert to inches of mercury
#
    pressure:
      name: "Outdoor Barometric Pressure"
      oversampling: 16x
      unit_of_measurement: "inches"
      filters:
        multiply: 0.02952998307

#
# humidity is returned in percent by default
#
    humidity:
      name: "Outdoor Relative Humidity"
      oversampling: 16x
      unit_of_measurement: "percent"

#
# RAIN GAUGE is a pulse counter from a 
# reed switch on the rain bucket flip-flop
#
  - platform: pulse_counter
    name: 'Rain Gauge'
    # pin ADC1_1
    pin: 
      number: 32
      mode: INPUT_PULLUP
    internal_filter: 13us
    update_interval: ${update_time}
    count_mode:
      rising_edge: DISABLE
      falling_edge: INCREMENT
    unit_of_measurement: 'pulses'
    filters:
      - multiply: 0.016666667

#
# ANEMOMETER (wind speed) is a pulse counter
# from a reed switch beneath the wind cup axis.
#
  - platform: pulse_counter
    name: 'Wind speed'
    id: wind_speed
    # pin ADC1_1
    pin: 
      number: 33
      mode: INPUT_PULLUP
    unit_of_measurement: 'm/s'
    icon: 'mdi:weather-windy'
    count_mode:
      rising_edge:   DISABLE
      falling_edge:  INCREMENT
    internal_filter: 13us
    update_interval: ${update_time}
    #
    # rotations_per_sec = pulses / 2 / 60
    # circ_m = 0.09 * 2 * 3.14 = 0.5652
    # mps = 1.18 * circ_m * rotations_per_sec  
    # mps = 1.18 * (0.5652 / 2 / 60) = 0.0055578
    #
    filters:
      - multiply: 0.0055578
      - sliding_window_moving_average:
          window_size: 3
          send_every: 1

Do you have pics of the other side of the board? Or what is under the vane? The Sparkfun sensors have an array of reed sensors that produce different voltages depending on their position. The datasheet explains this, but I found my readings to be different with my cable lengths. Yours looks to be using a similar principle but with open/closed circuits via those transistors as well as resistance readings maybe?

I can get that for you tomorrow. Not much there really. The Melexis IC arrived today, and WOW is that thing really small. Got it wired to a breakout board earlier, just trying to get it connected to the ESP32 now for debugging a custom SPI sensor.

Is this your unit? https://fccid.io/2ALHJ-WS020T

Yup, that’s the one. Sold as “Sainlogic” on Amazon.

Also, for the benefit of others, here is the SOIC-8 pinout for the SPI version of that Melexis chip:

Just an update. Tried converting some Arduino code to an MLX90316 sensor for ESPhome. The code worked as expected, but the 3.3VDC signals from the ESP32 would not trigger the 5VDC MLX90316 chip. Just received a level-shifter board tonight, but still no data coming from the MLX90316. Depending on how much free time I get, I have two approaches:
a) Continue with the MLX90316 effort, debugging, signal tracing, might get lucky
b) Take the AN0 and AN1 signals and do the trigonometry to calculate the wind direction

FYI, I finally figured out, ANx never referred to ANemometer, but to ANalog signals instead. AN0 and AN1 are 90-degrees out of phase with each other. Need to see what I can do with some lambda calculations based on those two signals connected to a couple of GPIO pins. I’ll get this thing figured out, sooner or later. :wink:

I chose option b) on Monday. Together with this PDF from Texas Instruments describing how to calculate the angle, I jumped to page 9 Section 4 which describes determining which quadrant is indicated. I connected AN0 and AN1 to ADC pins 32 and 33, and took the ratio of AN1 divided by AN0, and still couldn’t make any sense. The readings from AN0 and AN1 both come back close to the source 3.3V, and the ratio is close to 100%. It looks like I need to perform the calibration described on page 13, Section 4.2.1. That’s up next.

Being too unmotivated tonight, I instead used the atan2 function with that AN1 and AN0 values, which should return a directional value in radians. This multiplied by ( 180 / pi = 57.295791 ) should return a directional value in degrees. Unfortunately, AN0 and AN1 track each other too closely for this to be valid and the result is always high or low of 45 degrees. :frowning:

This is beyond my skill set but I can’t help but think the signal sounds like a rs485 binary wave.

As mentioned last night, I’m going to (eventually) walk through the four cardinal directions (N, E, S, W) and the four ordinal directions (NE, SE, SW, NW) and record the voltage values from both AN0 and AN1 signals. Sooner or later, I’ll probably just plot the whole thing and get it figured out. Trying to get daytime work, home project efforts, AND this trigonometry worked out is my limiting factor. Hope to be past some of that by next week.

Tuesday evening I found out just how non-linear is the ESP32 ADC circuit response, especially so above 3.1 VDC which is precisely what is coming out of the AN0 and AN1 signals. Two options: (a) apply a voltage divider resistor to each of AN0 and AN1, and reduce the voltage range coming into the ESP32 ADC circuit, or (b) wire in an ADS1115 external ADC chip to obtain more accurate readings. I’m a software guy, so I’ll go for the more accurate solution, (b). The ADS1115 is well supported in ESPHome, and easy enough to add to the configuration.

The ADS1115 certainly seems to provide more accurate voltage measurements. That’s the good news. I’m beginning to suspect the DEN line from the vane sensor board plays a significant role. I’ll have to wire that signal into the ADS1115 to determine what role that may be. Currently, with only AN0 and AN1 signals (plus Vcc and GND) I often receive voltage readings less that one-half volt from both AN0 and AN1, and the vane isn’t changing direction when this happens. Definitely a head-scratcher, and it really should not be so difficult. Oh, well. Just have to keep observing, possibly calibrating, and see what happens. I believe I’ve almost got it figured out. First, the voltages returned are from 0.000 to 3.300, which puts 1.650 VDC as the mid-point. Subtracting 1.650 from each AN0 and AN1 value returned will effectively assign a negative sign on one or both values when necessary. These signs determine whether the direction is in quadrant 1, 2, 3, or 4. In quadrant 1 (upper-right, or 0-to-90 degrees) there is no offset, the arctangent of the two values can be converted from radians to degrees and used. In quadrant 2, 90 degrees is added; quadrant 3, 180 degrees; quadrant 4, 270 degrees. The actual voltage values returned cannot be taken as absolute indicators. It’s only their trigonometric relationship that matters. Still need to re-assemble the entire device and perform final wiring/soldering to start comparing and monitoring the data for accuracy.

One final item. Apparently, it’s strongly beneficial to add a 100nF capacitor between GND and 5VDC on the ESP32. This seems to help stabilize the I2C devices (ADS1115 specifically) sourcing 5VDC from the ESP32 board.

1 Like

Perhaps i don’t understand the calculations, but my output is something around the 120-190 pulses/min with the rain sensor and around 50-80 mm sending to Home assistant. But , really? 50-80 mm? if i read the local weather authority they talk most of the times about 0,5 - 3 mm ?

or does the 'update_interval: 2s ’ which i have now need to be at 60 sec?

Any current recommendations for an Ambient Weather station to use with HA? Preferred under $300

It is not Ambient Weather,
it is not <$300
but it works well in HA (with a UDP2MQTT docker container)
Tempest from WeatherFlow
$330
I got mine a few months ago and I like it. There are no moving parts, I get wind speed, wind direction, rain type, rain rate, lighting detection, UV, Light levels, temperature, humidity, dewpoint, and others.
I do upload my data to WeatherFlow but all the info (except the forecast) is obtained locally and does not need any external source.

1 Like

I have been using the ws-1550-ip for a year now. Very satisfied and well integrated with HA. US $170