Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ahlermi
Normal user
Posts: 21
Joined: 19 Jan 2018, 16:04

Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#1 Post by ahlermi » 01 Feb 2018, 15:20

Hallo Zusammen,

gibt es eine Möglichkeit mit EasyESP die Geschwindigkeit eines Lüfters auszulesen?

Mit Arduino würde ich das so lösen:

Code: Select all

// Konstanten
const int tachoPin = 2;        // Pin des Tachosignals des Lüfters
  
// Variablen
float rps = 0;                 // Variable mit Kommastelle für die Berechnung der Umdrehungen pro Sekunde
int rpm = 0;                   // Variable für die gemittelte Drehzahl
float umdrZeit = 0;            // Variable mit Kommastelle für die Zeit pro Umdrehung des Lüfters
float flankenZeit =0;          // Variable mit Kommastelle für die Zeit pro Puls des Lüfters
   
   
void setup()
{
  Serial.begin(9600);           // Baudrate für die Ausgabe am Seriellen Monitor
  pinMode(tachoPin, INPUT);     // Setzt den Tacho Pin als Eingang
}
   
   
void loop()
{
  flankenZeit = pulseIn(tachoPin, LOW);    // Abfrage der Zeit pro Puls in Mikrosekunden
  umdrZeit = ((flankenZeit * 4)/1000);     // Berechnung der Zeit pro Umdrehung in Millisekunden
  rps = (1000/umdrZeit);                   // Umrechnung auf Umdrehungen pro Sekunde
  rpm = (rps*6);                           // Schritt 1 zur Rundung auf 10er Schritte der Drehzahl
  rpm = (rpm*10);                          // Schritt 2 zur Rundung auf 10er Schritte der Drehzahl
  Serial.print(rpm);                       // Ausgabe der Drehzahl im Seriellen Monitor
  Serial.println(" RPM");                  // Ausgabe der Drehzahl im Seriellen Monitor
}
Gruß Michael

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#2 Post by grovkillen » 01 Feb 2018, 15:39

Engelska tack...
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#3 Post by toffel969 » 01 Feb 2018, 16:41

ahlermi wrote: 01 Feb 2018, 15:20 Hallo Zusammen,

gibt es eine Möglichkeit mit EasyESP die Geschwindigkeit eines Lüfters auszulesen?

Mit Arduino würde ich das so lösen:

Code: Select all

// Konstanten
const int tachoPin = 2;        // Pin des Tachosignals des Lüfters
  
// Variablen
float rps = 0;                 // Variable mit Kommastelle für die Berechnung der Umdrehungen pro Sekunde
int rpm = 0;                   // Variable für die gemittelte Drehzahl
float umdrZeit = 0;            // Variable mit Kommastelle für die Zeit pro Umdrehung des Lüfters
float flankenZeit =0;          // Variable mit Kommastelle für die Zeit pro Puls des Lüfters
   
   
void setup()
{
  Serial.begin(9600);           // Baudrate für die Ausgabe am Seriellen Monitor
  pinMode(tachoPin, INPUT);     // Setzt den Tacho Pin als Eingang
}
   
   
void loop()
{
  flankenZeit = pulseIn(tachoPin, LOW);    // Abfrage der Zeit pro Puls in Mikrosekunden
  umdrZeit = ((flankenZeit * 4)/1000);     // Berechnung der Zeit pro Umdrehung in Millisekunden
  rps = (1000/umdrZeit);                   // Umrechnung auf Umdrehungen pro Sekunde
  rpm = (rps*6);                           // Schritt 1 zur Rundung auf 10er Schritte der Drehzahl
  rpm = (rpm*10);                          // Schritt 2 zur Rundung auf 10er Schritte der Drehzahl
  Serial.print(rpm);                       // Ausgabe der Drehzahl im Seriellen Monitor
  Serial.println(" RPM");                  // Ausgabe der Drehzahl im Seriellen Monitor
}
Gruß Michael

Hallo Michael

in diesem Forum wird Englisch gesprochen, bitte daher zukünftig Deine Fragen und Antworten auf Englisch verfassen.

@ Grovkillen: He is asking whether it is possible to use ESPEasy to read the rpm signal on a fan. My swedish sucks (probably as much as your German ;-)), but I get you are asking Michael to speak Englisch, which I also did, politly, in German :-)

Zu Deinem Anliegen, das wurde hier schon besprochen:
viewtopic.php?&t=731&start=190
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#4 Post by grovkillen » 01 Feb 2018, 17:38

Thanks toffel! :D
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

ahlermi
Normal user
Posts: 21
Joined: 19 Jan 2018, 16:04

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#5 Post by ahlermi » 02 Feb 2018, 09:09

:roll:

ok, i undestand that there is no way to do it nativ on EasyESP, i could calc it to pwm with my buildin arduino.
Is it possible to get this pwm value, as it is possible to set pwm values?

best regards

Michael

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#6 Post by toffel969 » 02 Feb 2018, 13:07

ahlermi wrote: 02 Feb 2018, 09:09 :roll:

ok, i undestand that there is no way to do it nativ on EasyESP, i could calc it to pwm with my buildin arduino.
Is it possible to get this pwm value, as it is possible to set pwm values?

best regards

Michael
I think you could write it into a dummy device using the taskvalueset command via serial from arduino.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

ahlermi
Normal user
Posts: 21
Joined: 19 Jan 2018, 16:04

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#7 Post by ahlermi » 10 Feb 2018, 13:26

sorry, thats to high for me, please help.

now i have a PWM inputsignal on GPIO 4 and GPIO 10 build from my Fan Arduino. 0 to 1000 mapped from 0 to 2500 rpm of fan. (Fan1 and Fan2)

what have i to do to see this PWM signal anywhere? maybe dummy.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#8 Post by grovkillen » 10 Feb 2018, 13:27

Yes, as of now you need to use a dummy for that.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

ahlermi
Normal user
Posts: 21
Joined: 19 Jan 2018, 16:04

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#9 Post by ahlermi » 10 Feb 2018, 13:39

can you build a smal totorial?
i have no idea to get this value in the dummy

ahlermi
Normal user
Posts: 21
Joined: 19 Jan 2018, 16:04

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#10 Post by ahlermi » 10 Feb 2018, 19:19

OK, now i have enabled Rules in Advanced settings, have a Clock Event:

Code: Select all

on Clock#Time do 
TaskValueSet 5,1,100 //PWM Fan1
TaskValueSet 5,2,200 //PWM Fan2
endon
How can i get the pwm value from GPIO?
Last edited by ahlermi on 10 Feb 2018, 21:30, edited 1 time in total.

ahlermi
Normal user
Posts: 21
Joined: 19 Jan 2018, 16:04

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#11 Post by ahlermi » 10 Feb 2018, 19:40

is it necessary to use Raw commands?

ahlermi
Normal user
Posts: 21
Joined: 19 Jan 2018, 16:04

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#12 Post by ahlermi » 15 Feb 2018, 11:20

Is there anybody with an idea to read Pulse from an Input Pin an use it in rules?

Arduino

Code: Select all

pulseIn(<tachoPin>, LOW);

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#13 Post by toffel969 » 15 Feb 2018, 11:37

ahlermi wrote: 15 Feb 2018, 11:20 Is there anybody with an idea to read Pulse from an Input Pin an use it in rules?

Arduino

Code: Select all

pulseIn(<tachoPin>, LOW);
Hi

You can use the pulse device for that and use the count value.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

ahlermi
Normal user
Posts: 21
Joined: 19 Jan 2018, 16:04

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#14 Post by ahlermi » 19 Feb 2018, 14:39

I got no Reaktion
Attachments
Unbenannt1.png
Unbenannt1.png (65.1 KiB) Viewed 11175 times
Unbenannt.png
Unbenannt.png (53.7 KiB) Viewed 11175 times

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#15 Post by toffel969 » 19 Feb 2018, 17:10

ahlermi wrote: 19 Feb 2018, 14:39 I got no Reaktion
Ich schreibe Dir mal kurz auf Deutsch zurück:

Einige Deiner Einstellungen können so nicht funktionieren. Die Debounce-Zeit ist viel zu lang. Bei 3000 touren pro Minute gibts doch schon 50 impulse pro Sekunde, d.h. Debounce-Zeit muss unter 20msec liegen (versuchs mal mit 15). Versuchs dann nochmal. Außerdem, spiel mal mit dem Typ Delta/Total´/counter, ich bin auch immer verwirrt welcher jetzt der richtige ist.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

ahlermi
Normal user
Posts: 21
Joined: 19 Jan 2018, 16:04

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#16 Post by ahlermi » 19 Feb 2018, 17:49

Leider keine Verbesserung, nicht auf LOW/CHANGING/RISING/FALLING TOTAL oder Total oder Count lassen sich nicht abspeichern.

Ich habe jetzt meinen Arduino dazwischen, der mir ein PWM Signal von 0-1000 liefert, der Lüfter ist nicht mehr direkt angeschlossen.

Trotzdem kommt nix an. :-/
Unter Hardware stehen die Pins auf "Input"

Danke für die Unterstützung.
Attachments
Unbenannt2.png
Unbenannt2.png (44.98 KiB) Viewed 11164 times
Unbenannt.png
Unbenannt.png (32.61 KiB) Viewed 11164 times

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Mit EasyESP Geschwindigkeit eines Lüfters auslesen?

#17 Post by toffel969 » 19 Feb 2018, 18:10

Lass mal den arduino weg und stell den delay auf 1sec. Dann Poster mal ein Screenhsot des logs.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest