Shop OBEX P1 Docs P2 Docs Learn Events
SparkFun weather station — Parallax Forums

SparkFun weather station

royaltyroyalty Posts: 3
edited 2012-03-10 22:45 in Propeller 1
I have a SparkFun weather station that I would like to use with the propeller. Being a retired carpenter I tried to nail the phone cable to the propeller without any worthwhile results. :lol:
I need some code to interface the anemometer, wind van and rain gauge. The only code on the SparkFun site concerns the arduino. I have the Programming and customizing book and have ordered Programming the propeller with spin and Getting started with the propeller. But do not know where to start with any of the sensors. The anemometer has two reed switches controlled by two magnets. The wind vane has various resistors connected to the cardinal directions on the compass giving 8 possible locations (two switch closing simultaneously giving the other four directions). The rain gauge just has bucket dump reed switch for each measured amount of rain.

Comments

  • SRLMSRLM Posts: 5,045
    edited 2012-03-09 14:50
    When you're reading through the various Propeller tutorials, pay particular attention to the sections on buttons and switches. The sensors that you mentioned are all electrically equivalent to a button, so any code that will work for a button will work for one of the sensors that you have. You can also take a look at the Arduino code to figure out how they do the logic, and copy that to Propeller spin.

    What a great project. I've planned on doing a weather station in the past, but I got sidetracked. Mostly because I'm terrible at committing to a physical layout. I'm interested in how your code comes out.
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2012-03-10 22:45
    Hey Royalty! Welcome to the forums! I would use RCDecay functions for the wind vane. I use them in the code for my Thermistor Tester. I learned how to use RCDecay from Chapter 7 of the "Propeller Education Kit Labs: Fundamentals Book" which is downloadable from Parallax's site through the PEKIT Page. Very easy to use and using simple case type methods can determine wind direction. For the counting of the reed switch pulses on the anemometer, I would think the same chapter on counter usage would lead you in the right direction. ( I only made it through the RC Decay lab for that chapter so far) It would be nice if someone else chimed in on counting pulses and utilizing that data to derive frequency, time between pulses, etc because I need to learn the exact same thing to add the heart rate monitor to my Polar Bear Plunge Logger. Good luck!

    (ps..... Hi Dad!)
Sign In or Register to comment.