18-04-2019, 18:36
[attachment=1853]Hi all,
I have a problem with the wind speed sensor "SEN0170".
1)The wind speed value that i get all the time is '30" in m/s .
2)If i spin faster the anemometer or slower doesnt change.
3)If i dont spin anyway the anemometer and is not in motion, still show me the value of "30".Nothing changes.
4)I have connect it to the arduino uno with external DC power supply 12v.
5)I have test not only the sketch code that is posted below,but a lot different anemometer sketches.All sketches give the same wind speed of 30 m/s all the time!
What i do wrong? The connection diagram is below in Attach.
The sketch code is:
//Written by Jonathan Pereira on 21st November 2015 public domain
/*
Hardware Connections (Breakoutboard to Intel Edison):
-Pin1(Brown):VCC/5V
-Pin2(Black):Ground
-Pin3(Blue)(Signal):Analog Pin A0
*/
int adawind= A0;
void setup()
{
pinMode(A0,INPUT);
}
void loop()
{
adaanemometer();
float windspeed;
String stringMsg = "Wind Speed:";
char wind[10];
dtostrf(windspeed,1,0,wind);
stringMsg += wind;
stringMsg += "m";
}
// the loop routine runs over and over again forever:
void adaanemometer() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
float windspeed =map(voltage,0.4,2.0,0,32.4);
Serial.println(windspeed);
}
I have a problem with the wind speed sensor "SEN0170".
1)The wind speed value that i get all the time is '30" in m/s .
2)If i spin faster the anemometer or slower doesnt change.
3)If i dont spin anyway the anemometer and is not in motion, still show me the value of "30".Nothing changes.
4)I have connect it to the arduino uno with external DC power supply 12v.
5)I have test not only the sketch code that is posted below,but a lot different anemometer sketches.All sketches give the same wind speed of 30 m/s all the time!
What i do wrong? The connection diagram is below in Attach.
The sketch code is:
//Written by Jonathan Pereira on 21st November 2015 public domain
/*
Hardware Connections (Breakoutboard to Intel Edison):
-Pin1(Brown):VCC/5V
-Pin2(Black):Ground
-Pin3(Blue)(Signal):Analog Pin A0
*/
int adawind= A0;
void setup()
{
pinMode(A0,INPUT);
}
void loop()
{
adaanemometer();
float windspeed;
String stringMsg = "Wind Speed:";
char wind[10];
dtostrf(windspeed,1,0,wind);
stringMsg += wind;
stringMsg += "m";
}
// the loop routine runs over and over again forever:
void adaanemometer() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
float windspeed =map(voltage,0.4,2.0,0,32.4);
Serial.println(windspeed);
}