I am in the process of making an Arduino powered Weather station, now it's time for Wind Direction.
I have what i think is a MAPLINS type Wind Vane which has 8 Reed switches, all with different resistor values, does anyone know how this works, i have had it on a DVM and there seems to be not only a signal from each Reed switch, but also from in between the switches, ie the magnet is making two switches simultaneously, can this be right?
Sensor in the wind vane diagram could be the same. It has 16 possible positions.
If it's highest resistance is ~40k (as in the editor table), then connect the sensor to an analogue input and ground, with a ~20k pull up resistor. And read the analogue values in all 16 directions.
map() or if() statements could translate those values into wind directions.
Leo..
Many thanks for the info, it looks identical to me. Just one other thing, my weather vane has 4 wires, Red, Black, Green & Yellow,would i be right in saying to disregard the Red & Yellow, use the Black for Ground and the Green for signal, if thi is right would you put the resistor on the Ground or the Signal, i have uploaded a ping, this is how i have been connecting it.
Many thanks for the info, i am slightly confused and would just like to clarify a couple of items -
In the first link you gave me, it does indeed show a similar PCB with 16 positions with the highest resistor value of ~40k where the second link you gave me shows the highest value at ~ 120k.
You mentioned using a ~ 20k pull up resistor, when actually the 2nd link you gave me shows a 10k pull up resistor, not being an expert on these things i just need a little clarification, my sketch now works about 80%, the problem i am having, i think, is that some of the voltage values given by the sensor are so close, i am getting strange readings on the LCD, can these resistor variables do that?
I don't know what's inside YOUR sensor.
You should measure it's resistance in all wind directions.
Value of the pull up resistor is not critical, but you get the best separation in values from the A/D if the pull up resistor value is about half of the highest resistance of the sensor.
Then you have to use a test sketch to see the A/D values you're getting in all 16 directions, so you can use them in the if() statements of the final sketch.
Leo..
I have measured the resistor values on my sensor, 16 positions i have uploaded a comparison with what's on the internet, and what i am getting in reality, please see if you can see anything obvious.
I use the wind direction sensor from Maplin in my weather station also. You can find my code & schematic here. I used a 4K7 pull-up resistor fed from an Arduino pin so that I can enable the pull-up for an instant, take the analog reading & disable the pull-up, to save battery power.
When we need replacements in the future, I'm not sure where we can get them. Other eBay vendors offer them, but not at such a low price.
Your sketch is well out of my league, as i am still learning this craft, i have tried your 4.7k resistor and Wawa's 50% of maximum installed Resistor (60k) neither has worked as each time i run the sketch with the different resistors the actual sensor does not point to where the LCD say's it is, would you kindly look at my sketch, and pick some holes in it please ?
Does your Maplin sensor have a NORTH position, mine is not marked?
I need help with my Wind Vane sketch for my Weather Station, it is powered by Arduino UNO R3, the sensor is ex, MAPLIN, i have got i think 80% of the sketch, there is a 20,4 i2c LCD include in my weather station.
The sensor does pick up 16 positions as per the heading of a compass, my problem is the sensor does not seem very sensitive, some of the voltages are so close together, i think the sketch is not good enough to give an accurate read out.
eg, East gives me 0.5 volts and reads East, East North East gives me 0.41 volts, but the LCD still registers East ?