Moderators: grovkillen, Stuntteam, TD-er
-
ahlermi
- Normal user
- Posts: 21
- Joined: 19 Jan 2018, 16:04
#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
-
grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
#2
Post
by grovkillen » 01 Feb 2018, 15:39
Engelska tack...
-
toffel969
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
#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
-
grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
#4
Post
by grovkillen » 01 Feb 2018, 17:38
Thanks toffel!

-
ahlermi
- Normal user
- Posts: 21
- Joined: 19 Jan 2018, 16:04
#5
Post
by ahlermi » 02 Feb 2018, 09:09
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
-
toffel969
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
#6
Post
by toffel969 » 02 Feb 2018, 13:07
ahlermi wrote: ↑02 Feb 2018, 09:09
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
#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.
-
grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
#8
Post
by grovkillen » 10 Feb 2018, 13:27
Yes, as of now you need to use a dummy for that.
-
ahlermi
- Normal user
- Posts: 21
- Joined: 19 Jan 2018, 16:04
#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
#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
#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
#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
-
toffel969
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
#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
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
#14
Post
by ahlermi » 19 Feb 2018, 14:39
I got no Reaktion
You do not have the required permissions to view the files attached to this post.
-
toffel969
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
#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
#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.
You do not have the required permissions to view the files attached to this post.
-
toffel969
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
#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
Who is online
Users browsing this forum: Anthropic Claude Bot [bot], opensiteexplorer.org/dotbot [bot] and 22 guests