Weather Station

Ever since I was a kid, I’ve been fascinated by the weather.  For a LONG time now, I’ve been working on a weather station to be able to measure weather data.   After pricing the various commercial weather stations, e,g. Davis, I found they were pretty much beyond my means for home and hobby use.  Fortunately, many moons ago, I acquired a weather station made by MetOne Instruments that was going to be tossed (!).   The equipment is now somewhat obsolete, but it’s has been a great vehicle for learning programming using different languages: originally learning about 8051 assembly language, and now C++.  I thought developing weather station software based this chip in assembly language would be a fun learning project.  Yeah, I know I could have bought one and had it over with, but this was a challenge.  I did get the 8051 to bit-bang an I/O pin to get the 1-wire search algorithm to work for finding 1-wire devices on the 1-wire microlan, but doing all the other stuff in assembly would be pretty much insane!  So it’s still a challenge since I had to find a new way to obtain the wind direction since, for whatever reason, the “precision” potentiometer reads OPEN!  Fortunately, I found an Instructables article about using a Melexis angle sensor and a neodymium rare earth diametrically magnetized magnet for the wind direction.  It’s an ongoing project (can you say, “creeping featurism”? :-), but it’s getting there.

So I gave up on basing it on assembly language.  Sun Microsystems (now Oracle) Java Micro Edition, that worked on a Raspberry Pi looked very cool, but since many of the J2ME evangelists left Oracle, there basically was no support except for searching forums and such. Whatever I DID find was pretty old information or not really pertinent.   So, I gave up on using Java Micro Edition.  <sigh> But I learned a LOT about Object Oriented Programming!

Now I’m using Visual Studio Code (aka VSCode) with the PlatformIO extension to write firmware for the ultra-cheap ESP8266/8255/ESP32 chips.  So now I have Node-Red 2.2 working on a Raspberry Pi accepting messages from pieces of the station via MQTT and the dashboard looks pretty nice so far.   I modified existing code for the DS2482 1-Wire master (the original versions had a few issues) on GitHub, and released my own version.  So far, I have the Model 370 rain gauge counting bucket tips (using the DS2482 1-Wire master and DS2423 1-Wire counter/memory chip), the anemometer, and humidity/temperature from the 083B sensors.   

The wind vane is another issue: the 360 degree precision potentiometer for some reason reads OPEN!  I’m working on fitting it with a Melexis MLX90316 angle sensor from an Instructables article I saw on that web site.   So now, besides putting all the modules together, I’m learning KiCAD to build PCBs for the wind vane retrofit and the DS2423 counter mod for the 370 rain gauge.   UPDATE: Thanks to the KiCAD forum, I have a replacement PCB for the wind vane.  Now I’m working on a test board to fit in the housing so I can see if (hopefully) the MLX90316 will work on the end of a 10′ cable.  According to what I’ve read, SPI signals can work up to 30′.  We’ll see.  Check out my blog page for the testing of the MLX90316.