Sanity check please. I've purchased and received the Weather Rack sensors, The RJ11-Grove Interface Board and an ADS1115. I'm using a RPi model 3. I'm pretty sure I've got the software and RPi parts covered. The SwitchDoc stuff that has me a little confused. I've scoured the intarwebs, your tutorials, and support forums...but I'm not sure it has clicked for me.
I did some poking around with my multimeter. My first guess above is wrong. The RJ-11 pins are not straight through to the grove connectors. Below is the pinout for the RJ-11 -> Grove Interface Board. Things are starting to click a little...I'll keep at it!
Last Edit: Jan 26, 2019 17:52:38 GMT -8 by T3chDad®
def rain(): global rain_count rain_count += 1 print("rain" + str(rain_count))
rain_sensor.when_pressed = rain
The output should look like this. Every time the rain bucket is tipped or the anemometer completes one revolution, you will see the number increment.
To test the Wind Vane I used a script I found on SwitchDoc's git: github.com/switchdoclabs/SDL_Pi_Grove4Ch16BitADC This was by far the simplest way I found to test the Wind Vane and the ADS1115. It didn't require editing the scripts or installing libraries. Just download the zip or clone the git and extract/run.
#SwitchDoc Labs May 2016 # reads all four channels from the Grove4Ch16BitADC Board in single ended mode # also reads raw values # import time, signal, sys sys.path.append('./SDL_Adafruit_ADS1x15')
# Select the gain gain = 6144 # +/- 6.144V #gain = 4096 # +/- 4.096V # gain = 2048 # +/- 2.048V # gain = 1024 # +/- 1.024V # gain = 512 # +/- 0.512V #gain = 256 # +/- 0.256V
# Select the sample rate #sps = 8 # 8 samples per second # sps = 16 # 16 samples per second # sps = 32 # 32 samples per second # sps = 64 # 64 samples per second # sps = 128 # 128 samples per second sps = 250 # 250 samples per second # sps = 475 # 475 samples per second # sps = 860 # 860 samples per second
# Initialise the ADC using the default mode (use default I2C address) adc = SDL_Adafruit_ADS1x15.ADS1x15(ic=ADS1115) while (1): # Read channels in single-ended mode using the settings above print ("--------------------") voltsCh0 = adc.readADCSingleEnded(0, gain, sps) / 1000 rawCh0 = adc.readRaw(0, gain, sps) print ("Channel 0 =%.6fV raw=0x%4X dec=%d" % (voltsCh0, rawCh0, rawCh0)) voltsCh1 = adc.readADCSingleEnded(1, gain, sps) / 1000 rawCh1 = adc.readRaw(1, gain, sps) print ("Channel 1 =%.6fV raw=0x%4X dec=%d" % (voltsCh1, rawCh1, rawCh1)) voltsCh2 = adc.readADCSingleEnded(2, gain, sps) / 1000 rawCh2 = adc.readRaw(2, gain, sps) print ("Channel 2 =%.6fV raw=0x%4X dec=%d" % (voltsCh2, rawCh2, rawCh2)) voltsCh3 = adc.readADCSingleEnded(3, gain, sps) / 1000 rawCh3 = adc.readRaw(3, gain, sps) print ("Channel 3 =%.6fV raw=0x%4X dec=%d" % (voltsCh3, rawCh3, rawCh3)) print ("--------------------") time.sleep(1)
The output should look like this. Every time you rotate the wind vane, the voltage should change.
Now it's time to write all of my code. I'm building a custom weather station for my RC aircraft club so members can check the conditions before they come out and see the real-time data on a 32" TV at the field.
Thanks for listening as I sorted through this learning experience. I hope this helps someone if they need this information in the future.
Last Edit: Jan 27, 2019 12:41:24 GMT -8 by T3chDad®