Wind Direction Sensor Problem

Hello

I have Wind Direction Sensor.Wind Direction Sensor datasheet code is 4.3129.10.712 and you can reach associated datasheet by clickling this link :4.31.29.10.712 Wind Direction Sensor Datasheet

I ve made necessary connection according to the datasheet.
And My code is

void setup() {
  // put your setup code here, to run once:
  
Serial.begin(9600);
}

void loop() {
 
  // put your main code here, to run repeatedly:

Serial.println(analogRead(A0));
delay(500);
}

You see a basic potentiometer reader code.
When i check Serial output there were irrelevant outputs.(outputs between 0-1023 but increases repeatly and decreases repeatly even my direction point is contant.) Can anybody check datasheet and make information me ?

smttrhn wrote

I ve made necessary connection according to the datasheet.

but I would like to see that for myself. For example, what was used for "an additional protective resistance"?

Post a circuit diagram, please. Post the Serial output, please. The code looks reasonable.

How are you providing the required 1 mA current limit on the power supply?

Electrical supply for potentiometer Voltage Us : 0V DC ... 24 V DC,
The supply must guarantee a current limiting to max. 1 mA – short cut at the North point!

I dont have any idea about limiting current.

I connected 1 and 2 to GND and 3 to A0 port and 4 and 5 to +5V

smttrhn:
I dont have any idea about limiting current.

Sounds like every time the wind goes past North the power supply will be shorted to Ground. If you use the 5V pin of the Arduino this will likely cause the regulator to fry or the USB power to disconnect.
One way to protect the power is to put a 2K resistor between +5V and the pot. This will cut the range of output to a maximum of about 512. With a little more work you could put in a resistor that would drop the maximum reading to 1.1V and then use the internal voltage reference. That would get the input range back up to 1024.

Hi,
Welcome to the forum.

What is your electronics, programming, arduino, hardware experience?

Have you tested your code by using a 10K potentiometer in place of the wind direction unit?

What model ARDUINO controller are you using?

Can you please post a picture of your project?

Thanks.... Tom.... :slight_smile:

Related: 10.3129.10.712 Wind Direction Sensor, ARDUINO UNO