Analog Voltage from anemometer

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ESPUliEasy
New user
Posts: 4
Joined: 24 Apr 2022, 15:41

Analog Voltage from anemometer

#1 Post by ESPUliEasy » 24 Apr 2022, 16:16

Hi,

I use ESPEasy on a D1 mini with ESP_Easy_mega_20210802_normal_ESP8266_4M1M.
I have an anemometer, it generates 0 - 2 Volt. How do I make the settings in ESPEasy so that the wind speed is displayed in m/s. 1 Volt corresponds to 25 m/s.
A0 connect to Output anemometer
GND connect to GND anemometer

Point 1: 0 = 0.000
Point 2: 1023 = 2.000

Formula
%value%*25

when I enter the above values, the result is wrong.
What am I doing wrong or where is my reasoning wrong ?

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Analog Voltage from anemometer

#2 Post by Ath » 24 Apr 2022, 17:21

What values do you get without having a formula set?
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog Voltage from anemometer

#3 Post by TD-er » 24 Apr 2022, 20:37

With the ADC plugin, you can let the calibration do its work.
You don't need to use a formula then, unless you need to apply some none-linear scaling of course.

So just apply some known voltage to the input and set the calibration value according.

Most boards already have some set of resistors present to extend the measurement range of the A0 input.
The ESP8266 itself can only read up-to 1V, but with these resistors you may get upto roughly 3.6V if I'm not mistaken.
Since those resistors have some tolerances, you need to test yourself to see what value is read.

ESPUliEasy
New user
Posts: 4
Joined: 24 Apr 2022, 15:41

Re: Analog Voltage from anemometer

#4 Post by ESPUliEasy » 24 Apr 2022, 21:28

It is a wind generator and I can only estimate (weather forecast) how strong the wind is. The display is at 0.05. But it should be 8-10 factor more.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog Voltage from anemometer

#5 Post by TD-er » 24 Apr 2022, 21:52

You know the anemometer outputs 1V per XX m/s
So you can put some voltage on the A0 pin (e.g. 1.00V) and then see what its reading is in the task.
Then you set this RAW reading value (e.g. "300" when you apply 1.00V) and add it as a calibration point where you enter the true wind speed as reported by the datasheet of the sensor.

ESPUliEasy
New user
Posts: 4
Joined: 24 Apr 2022, 15:41

Re: Analog Voltage from anemometer

#6 Post by ESPUliEasy » 25 Apr 2022, 17:32

With Arduino Nano and this program part works it.
int Wind=0;
int km=0;
int Sensor = A7; //Das Anemometer soll am analogen Pin A7 angeschlossen werden. Wir nennen den Pin ab jetzt "Sensor"
int sensorwert; //Unter der Variablen "sensorwert" wird später der Spannungswert des Sensors abgespeichert.
int t=500; //Der Wert für „t“ gibt im Code die zeitlichen Abstände zwischen den einzelnen Messungen vor.

void setup()
{
Serial.begin(9600);
}

void loop()
{
sensorwert=analogRead(Sensor); //Auslesen des Sensorwertes.
delay(t); // Nach jeder Messung ist je eine kleine Pause mit der Dauer „t“ in Millisekunden.
Wind= map(sensorwert, 0, 25, 0, 1);
km=Wind*3,6;
Serial.print("Windgeschwindigkeit: ");
Serial.println(km);
}

ESPUliEasy
New user
Posts: 4
Joined: 24 Apr 2022, 15:41

Re: Analog Voltage from anemometer

#7 Post by ESPUliEasy » 25 Apr 2022, 18:11

If I apply 1V from a power supply to the D1 Mini, the correct converted value is also displayed.
Conclusion: contact problems!
Thanks for the suggestions !!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Analog Voltage from anemometer

#8 Post by TD-er » 25 Apr 2022, 19:59

Great to hear it is solved and working :)

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests