I have a anemometer (wind speed sensor) from an La Crosse weather station (WS-2300) (up to 16 wind directions) and
Rain Gauge for WAS 2300-16-series. I'd like to connect it to my arduino.
It uses a standard RJ11 jack to transmit data. I opened it (wind speed sensor)- photo, up and saw that the RJ-11 pin-out is as followed:
1 - serial I / O
2 - VDD
3 - Regulator CE (Chip Enable)
4 - GND
Rain Gauge used Reed switch RJ-11 pin-out is as followed>
1 - DATA
4 - GND
How would I go about connecting it to my arudino, and then reading what's being sent over the serial line?
1 - serial I / O
2 - VDD
3 - Regulator CE (Chip Enable)
4 - GND
There will be pulses from line 1, probably a square wave. You could use an interrupt routind to count these pulses. See - attachInterrupt() - Arduino Reference
The minimal code should be like this
volatile unsigned long counter = 0;
void setup()
{
Serial.begin(115200);
attachInterrupt(0, wind, RISING); // IRQ 0 == PIN 2
}
void loop()
{
if (millis() - last > 1000) // display counter once per second
{
Serial.println(counter);
last = millis();
}
}
void wind()
{
counter++;
}