This is a placeholder topic for “Weather HAT (HAT only)” comments.
Weather HAT is an all-in-one solution for hooking up climate and environmental sensors to a Raspberry Pi. It has a bright 1.54" LCD screen and four…
Read moreThis is a placeholder topic for “Weather HAT (HAT only)” comments.
Weather HAT is an all-in-one solution for hooking up climate and environmental sensors to a Raspberry Pi. It has a bright 1.54" LCD screen and four…
Read moreI have set this hat up with a raspberry pi zero 2 W. using the example scripts i can get all of the sensor data to read except for the wind speed and rain gauge. Wind direction reads fine so I would think speed would be ok too.
I have tried with an existing weather station I had and I have also just purchased Weather Meter Kit | Buy in Australia | SEN-15901 | Sparkfun | Core Electronics and have the same problem.
any ideas?
Cheers,
Chris.
Hey @Chris261572, welcome back to the forums!
The problem existing with the other two weather meters should exclude the board being defective.
Can you send through some images of your physical setup? Additionally, sending snippets of the code you’re using would be helpful, so anyone looking to help doesn’t have to track down the example code.
Hi Zach,
I’ll try get some pics of the setup tomorrow. I’m not convinced it’s not a defective weatherhat. given the anemometer and rain gauge I already had work with a separate system and I also purchased a new one from you guys as I said.
That been said, the onboard sensors (temp, humidity and pressure) all report fine. it’s only the external sensors connected to the RJ11 ports.
The code i’m using is coming straight from the Pimoroni github. here is the init.py that the main code calls. weatherhat-python/weatherhat/__init__.py at main · pimoroni/weatherhat-python · GitHub
Here is the code i’m running weatherhat-python/examples/weather.py at main · pimoroni/weatherhat-python · GitHub
interestingly, I just went a put a multimeter on the solder pins for the wind RJ11 to see if it was recording the reed switch closing in the anemometer while i have a consistent breeze and I was getting a reading. I also noticed my MQTT dashboard recorded a reading for wind and for rain when i put the probes on. so maybe an issue with the code in the end. maybe it’s looking at the wrong pins?
Hi Chris
Check your soldering also. Quite often the bit of pressure on a joint with the probe will correct a bad joint while the slight pressure is there and fail again when the probe removed.
Edit: Are you measuring volts or resistance. If resistance there will be a small voltage on the probe which your system will see and interpret into something.
Cheers Bob
Measuring voltage get a reading of just over 3v each spin.
The rain also records a reading when I probe the anemometer pins.
solder seems to be ok. I can put the probe on the small trace points from those pins on the board and still get a reading.
Hi Chris
Could it be that your meter resistance of 10MΩ is causing this. Is the 3V via pull up or is it driven by IO or similar? Is your rain gauge a tipping bucket type? If so would you only expect a reading when the bucket empties? I have not gone into these systems so I am not sure how it all works.
But don’t forget that 10MΩ resistance to ground with the DMM connected which may mask something else.
Cheers Bob
the voltage is been supplied by 10kΩ pull-up resistor is my understanding based on the schematics and code.
The code reading a pulse only when the multimeter is connected seems to indicate the meters resistance is what allows that pulse to be registers.
Given that I am using the exact setup that Pimoroni sells and has their guides for, and I’m using their proven code that should work, could this be an issue like a faulty resistor on the board?
weather_hat_schematic.pdf (44.8 KB)
Hi Chris
The only 10k “pull up” resistor I can see on that linked circuit is for the wind direction vane which would be some sort of variable resistor. They could be internal in the processor. I think they would have to be as the inputs are a simple switch closure. You say you see the operation with a DMM. I would not have thought that instrument would be fast enough. They are usually quite slow in responding and settling. An oscilloscope would be much faster and give a more meaningful result if you have access to one
Cheers Bob
Hey @Chris261572,
At this point, I would be checking to see if the code is working as it should. You could make a copy of weather.py and add a few debugging statements to check and see if the data from these sensors is being detected at all by the Pi.
For example you could modify the WindSpeedView class of the example code “weather.py” to include some outputs like this:
class WindSpeedView(SensorView):
"""Wind Speed."""
title = "WIND"
metric = "m/s"
def render(self):
SensorView.render(self)
latest_speed = self._data.wind_speed.latest().value
print(f"Latest wind speed: {latest_speed} {self.metric}")
history_speed = self._data.wind_speed.history()
print(f"Wind speed history: {history_speed}")
self.heading(latest_speed, self.metric)
self.footer(self.title.upper())
self.graph(
history_speed,
graph_x=4,
graph_y=70,
width=self.canvas_width,
height=self.canvas_height - 130,
vmin=self._settings.minimum_wind_ms,
vmax=self._settings.maximum_wind_ms,
bar_width=self.GRAPH_BAR_WIDTH
)
I’ve done a lot of testing and debugging with the code. and the code will actually work and produce wind speed IF the multimeter is connected (presumably due to the introduced resistance?)
after doing some troubleshooting this afternoon. it appears that the 2nd anemometer pin has a short to ground somewhere. ground to “ANE2” pin will always read 0v when stationary or spinning. I have tried forcing a pullup and setting the pin to a 3.3v supply in the code, all these changes work for ANE1 but ANE2 will always ready 0v and when testing continuity seems to indicate a short to ground.
This is the clearest guide I could find on how to implement the 10k ohm resistor.
It doesn’t look like this is included in the kit by default so maybe this is helpful to you?
Would you be able to send a photo of the ANE1 and ANE2 pins so we have a better idea what this all looks like?
Hi Chris
You have not stated anywhere but when you say you have the multimeter connected what are you actually measuring. Voltage or Resistance. This makes a difference as with Voltage you have effectively got 10MΩ to ground and if resistance there will be a small voltage present which may be interpreted as a reading.
Cheers Bob