Flow sensor reboots ESP E12
Moderators: grovkillen, Stuntteam, TD-er
Flow sensor reboots ESP E12
Hi there I have problem with "pulse counter" feature in EasyEsp firmware 120
I heve got hall efect flow sensor - FS400A http://www.hotmcu.com/g1-water-flow-sensor-p-312.html
I tested it with arduino skatch from this link https://diyhacking.com/arduino-flow-rate-sensor/ and it works perfectly.
I decided to connect it to my ESP E12 like others sensors. Because I need ext 12VDC power....I used this schamatic from official site:
https://www.letscontrolit.com/wiki/inde ... ogic_input -> section HARDWARE "Please refer to this page for pulse levels that are higher than 3.3V (or 5V for some ESP units)"
I have two problems:
1. Esp E12 module reboot after few minutes, with diffrent period of time....after 5 - 38 minutes max
2. How I should config tihis dev in easyesp? Now I've got something like this and doesn't work soo good like @arduino
I heve got hall efect flow sensor - FS400A http://www.hotmcu.com/g1-water-flow-sensor-p-312.html
I tested it with arduino skatch from this link https://diyhacking.com/arduino-flow-rate-sensor/ and it works perfectly.
I decided to connect it to my ESP E12 like others sensors. Because I need ext 12VDC power....I used this schamatic from official site:
https://www.letscontrolit.com/wiki/inde ... ogic_input -> section HARDWARE "Please refer to this page for pulse levels that are higher than 3.3V (or 5V for some ESP units)"
I have two problems:
1. Esp E12 module reboot after few minutes, with diffrent period of time....after 5 - 38 minutes max
2. How I should config tihis dev in easyesp? Now I've got something like this and doesn't work soo good like @arduino
Re: Flow sensor reboots ESP E12
Hi,
I had the same problem, some others did not. Thread here. Hope it helps.
viewtopic.php?f=2&t=3647
Ray
I had the same problem, some others did not. Thread here. Hope it helps.
viewtopic.php?f=2&t=3647
Ray
Re: Flow sensor reboots ESP E12
Hello,
atm I'm testing a nodeMCU (ESPEasy 2.0.0-DEV12 normal) with four counters defined and getting "ticked" from a function generator with
different pulse clocks.
It is running now for a day without rebooting so I'm not convinced this is a problem of the counter plugin.
At first the circuit for voltage adaption you mentioned itches me a bit.
The diode and the transistor sum up to about 1 volt as "low" level which is on the limit the ESP recognizes as "low".
Second, theconnection to 12V might intriduce spikes to the ESP.
I'd suggest to change the circuit to this:
. .
A far more simple way to adapt the voltage level securely is a zener diode.
It might need a bit of testing with the resistor value:
. .
Please remember that GND must be connected to both sides, GND on sensor and ESP.
On another note check the power supply of the ESP.
It might help to filter the sensor and check the voltage regulation if you use the 12V supply for the ESP too.
https://www.letscontrolit.com/wiki/inde ... _positives
Voltage regulators usually need some capacitors around to prevent regulation oscillations.
The usual types (LM1117-3.3, LF-33 for example) need a 100nF ceramic type on input and output and
an eleectrolytic capacitor of about 100µF on the output. Make sure you use really ceramic types.
Film capacitors are not suitable here.
Regards
atm I'm testing a nodeMCU (ESPEasy 2.0.0-DEV12 normal) with four counters defined and getting "ticked" from a function generator with
different pulse clocks.
It is running now for a day without rebooting so I'm not convinced this is a problem of the counter plugin.
At first the circuit for voltage adaption you mentioned itches me a bit.
The diode and the transistor sum up to about 1 volt as "low" level which is on the limit the ESP recognizes as "low".
Second, theconnection to 12V might intriduce spikes to the ESP.
I'd suggest to change the circuit to this:
. .
A far more simple way to adapt the voltage level securely is a zener diode.
It might need a bit of testing with the resistor value:
. .
Please remember that GND must be connected to both sides, GND on sensor and ESP.
On another note check the power supply of the ESP.
It might help to filter the sensor and check the voltage regulation if you use the 12V supply for the ESP too.
https://www.letscontrolit.com/wiki/inde ... _positives
Voltage regulators usually need some capacitors around to prevent regulation oscillations.
The usual types (LM1117-3.3, LF-33 for example) need a 100nF ceramic type on input and output and
an eleectrolytic capacitor of about 100µF on the output. Make sure you use really ceramic types.
Film capacitors are not suitable here.
Regards
Regards
Shardan
Shardan
Re: Flow sensor reboots ESP E12
Hi Shardan
Thx for your reply
I made some changes before I read your post.
Firstly I switched to 5V - nothing change to me (resets stil are present)
Changeing of firmware also nothing change
In the evening I'll post some details and ad some charts from my counter.
Greetings
Jack
Thx for your reply
I made some changes before I read your post.
Firstly I switched to 5V - nothing change to me (resets stil are present)
Changeing of firmware also nothing change
In the evening I'll post some details and ad some charts from my counter.
How do you generate a pulse signal? With what?
Greetings
Jack
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Flow sensor reboots ESP E12
You could use a simple momentary switch or simply short 3.3V with the GPIO in order to get something pulsing.
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Flow sensor reboots ESP E12
Hello Jack,JackG wrote: ↑30 Oct 2017, 11:16 Hi Shardan
Thx for your reply
I made some changes before I read your post.
Firstly I switched to 5V - nothing change to me (resets stil are present)
Changeing of firmware also nothing change
In the evening I'll post some details and ad some charts from my counter.
How do you generate a pulse signal? With what?
Greetings
Jack
I'm using a cheap function generator with two independent channels so I'm able to generate two rectangle signals with different frequencies.
To be honest it was the cheapest function generator i could find - i need it very rarely and don't need high precision so i checked ebay and found this:
http://www.ebay.de/itm/Signalgenerator- ... SwhvFZDB9w
I tested with two frequencies, 10 + 13 Hz to simulate pulse sources with different clock ticks.
ESPEasy was set up with four counters, two for each pulse.
The test was stopped yesterday after about 50 hours without issues.
Regards
Shardan
Regards
Shardan
Shardan
Re: Flow sensor reboots ESP E12
HI
Like I said, I made some changes / tests:
1) I switched to 5V/1A power supply from USB connected directly to ESP. Wiring same as yours, but R1=1kohm. Below 24h chart with 12 down peaks (resets) Soft: dev10
2) Next option - an old Nokia charger 7,2V/890mA connected to Vin / gnd ESP pins. The same wiring. Below 24h chart with 35 down peaks (resets). Soft : dev12
3) Last option: LED's power supply 12V/6000mA connected to Vin / gnd ESP pins. The same circut as yours R1=22kohm. Below 24h chart with 43 down peaks (resets). Soft : dev12
I think wiring diagram in my case is not good. I think there are lots of noises and "trashes" in signal. This in not a pure and fine rectagle signal.
I found diagram on web site to this flow sensor but in this shape it would kill esp
ehhh......
Like I said, I made some changes / tests:
1) I switched to 5V/1A power supply from USB connected directly to ESP. Wiring same as yours, but R1=1kohm. Below 24h chart with 12 down peaks (resets) Soft: dev10
2) Next option - an old Nokia charger 7,2V/890mA connected to Vin / gnd ESP pins. The same wiring. Below 24h chart with 35 down peaks (resets). Soft : dev12
3) Last option: LED's power supply 12V/6000mA connected to Vin / gnd ESP pins. The same circut as yours R1=22kohm. Below 24h chart with 43 down peaks (resets). Soft : dev12
I think wiring diagram in my case is not good. I think there are lots of noises and "trashes" in signal. This in not a pure and fine rectagle signal.
I found diagram on web site to this flow sensor but in this shape it would kill esp
ehhh......
Re: Flow sensor reboots ESP E12
Hm....
At first: Make sure your power supply is clean.
Many problems result from power supply.
I'd try to use separate power supplies for ESP and the flow sensor for a test.
Let the ESP run for a while without sensor to make sure this is stable, then start the sensor.
I'm not sure but i doubt that the signal itself from the sensor reboots the ESP.
Some unstable ground connections or spikes on the power line is more likely.
If the power supply is clean you may try a Schmitt-Triger to shape the signal,
I'll see if i can make a drawing then.
Regards
Shardan
At first: Make sure your power supply is clean.
Many problems result from power supply.
I'd try to use separate power supplies for ESP and the flow sensor for a test.
Let the ESP run for a while without sensor to make sure this is stable, then start the sensor.
I'm not sure but i doubt that the signal itself from the sensor reboots the ESP.
Some unstable ground connections or spikes on the power line is more likely.
If the power supply is clean you may try a Schmitt-Triger to shape the signal,
I'll see if i can make a drawing then.
Regards
Shardan
Regards
Shardan
Shardan
Re: Flow sensor reboots ESP E12
Definitely restarts are causes by signal from the flow sensor.
ESP itself works stably.
The same ESP attached to development board with sensors: 4x DS18B20, BME260, 4x relays and soil moisture - works perfect.
I checked the flow sensor itself. Pinned under arduino UNO works perfectly - accuracy of measurements is + - 40-60mL.
Regards
Jacek
ESP itself works stably.
The same ESP attached to development board with sensors: 4x DS18B20, BME260, 4x relays and soil moisture - works perfect.
I checked the flow sensor itself. Pinned under arduino UNO works perfectly - accuracy of measurements is + - 40-60mL.
Regards
Jacek
Re: Flow sensor reboots ESP E12
I will second that. My ESP12E has adequate decoupling and built on a PCB. It's been running non stop now for 3 weeks with a different application and no reboots. Start up the pulse counter device and it reboots at least every 30 seconds.
Re: Flow sensor reboots ESP E12
Hi Jacek,
What value pull up resistor is on the flow sensor? i take it the capacitor is 0.1uF ceramic? I use this type which gives nice square waves with 3K3 + 0.1uF, works fine on a PIC BUT not with the pulse counter device, iv also tried a signal generator and it still constantly reboots, a firmware problem i think.
https://www.google.com.ph/search?q=flow ... Hnqrm6gYUM:
Ray
What value pull up resistor is on the flow sensor? i take it the capacitor is 0.1uF ceramic? I use this type which gives nice square waves with 3K3 + 0.1uF, works fine on a PIC BUT not with the pulse counter device, iv also tried a signal generator and it still constantly reboots, a firmware problem i think.
https://www.google.com.ph/search?q=flow ... Hnqrm6gYUM:
Ray
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Flow sensor reboots ESP E12
What versions are you on? I tried a self compiled version (code base 2017-10-16) which did not work correctly with the pulse counter plugin. Downgraded to dev7 (which I use for another pulse counter unit) and it worked...rayE wrote: ↑02 Nov 2017, 11:43 Hi Jacek,
What value pull up resistor is on the flow sensor? i take it the capacitor is 0.1uF ceramic? I use this type which gives nice square waves with 3K3 + 0.1uF, works fine on a PIC BUT not with the pulse counter device, iv also tried a signal generator and it still constantly reboots, a firmware problem i think.
https://www.google.com.ph/search?q=flow ... Hnqrm6gYUM:
Ray
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Flow sensor reboots ESP E12
My setup:
v2.0.0-dev12
Device = Pulse Counter
I/O = CH5
Type = delta/total/time
Mode = Rising
Delay = 10s
v2.0.0-dev12
Device = Pulse Counter
I/O = CH5
Type = delta/total/time
Mode = Rising
Delay = 10s
Re: Flow sensor reboots ESP E12
Just a thought, if the pulse counter device digital input from the flow sensor is configured as a D/O (in the device driver) that would cause current sink problems and probably reboots. Look at the horrible scope graphs previously presented?
Re: Flow sensor reboots ESP E12
Hello,
I've been testing dev12 these days with four counters on a two channel signal generator without issues.
Anyways i have a suspicion.
Can you please test different settings with "Falling" - "Raising" - "Low" settings?
I tested here for some hardware things and that's something i did not try.
On another note i'm thinking about an active filter/schmitt-trigger gate but thats
somewhat complex and will not help if there is a firmware bug so it's senseless at this point.
Regards,
Shardan
I've been testing dev12 these days with four counters on a two channel signal generator without issues.
Anyways i have a suspicion.
Can you please test different settings with "Falling" - "Raising" - "Low" settings?
I tested here for some hardware things and that's something i did not try.
On another note i'm thinking about an active filter/schmitt-trigger gate but thats
somewhat complex and will not help if there is a firmware bug so it's senseless at this point.
Regards,
Shardan
Regards
Shardan
Shardan
Re: Flow sensor reboots ESP E12
So. I did some tinkering with signal generator, nodeMCU (dev12) and one single counter task.
No reporting to any homecontrol or such (Controller deactivated), no other tasks configured.
I've found some behaior to higher pulse frequencies that might bring troubles with a flow sensor.
I think the pulse counter was originally made for energy meters.
My energy meters give 2 pulses per wh. At maximum (16A) we get:
16 A * 230V * 2Pulses = 7360 pulses/h or 2.04 pulses/s.
So i tested frequencies up to 15 Hz first - that worked.
Today I increased frequency. Up to 50 Hz it works fine.
Higher frequencies slow down the web frontend, but main page says memory is OK.
From about 150...200 Hz and higher it gets really into trouble, blocking, crashing and so on.
So the question is: Which frequency does your flow sensor give?
Sadly i don't have a sample to test with so i can't say.
Regards
Shardan
No reporting to any homecontrol or such (Controller deactivated), no other tasks configured.
I've found some behaior to higher pulse frequencies that might bring troubles with a flow sensor.
I think the pulse counter was originally made for energy meters.
My energy meters give 2 pulses per wh. At maximum (16A) we get:
16 A * 230V * 2Pulses = 7360 pulses/h or 2.04 pulses/s.
So i tested frequencies up to 15 Hz first - that worked.
Today I increased frequency. Up to 50 Hz it works fine.
Higher frequencies slow down the web frontend, but main page says memory is OK.
From about 150...200 Hz and higher it gets really into trouble, blocking, crashing and so on.
So the question is: Which frequency does your flow sensor give?
Sadly i don't have a sample to test with so i can't say.
Regards
Shardan
Regards
Shardan
Shardan
Re: Flow sensor reboots ESP E12
@rayE and @grovkillengrovkillen wrote: ↑02 Nov 2017, 12:13What versions are you on? I tried a self compiled version (code base 2017-10-16) which did not work correctly with the pulse counter plugin. Downgraded to dev7 (which I use for another pulse counter unit) and it worked...rayE wrote: ↑02 Nov 2017, 11:43 Hi Jacek,
What value pull up resistor is on the flow sensor? i take it the capacitor is 0.1uF ceramic? I use this type which gives nice square waves with 3K3 + 0.1uF, works fine on a PIC BUT not with the pulse counter device, iv also tried a signal generator and it still constantly reboots, a firmware problem i think.
https://www.google.com.ph/search?q=flow ... Hnqrm6gYUM:
Ray
I understand you mean this scheme?
I do not use it. At the moment I'm using the exact schema proposed by Shardan in post # 3.
The flow sensor was tested on revisions from R147 to 2.0.0 dev12.
Regards
Re: Flow sensor reboots ESP E12
The above diagram is the way im using the flow sensor. Vcc is 3.3V, decoupling capacitor is 0.1uF ceramic and pull up resistor is 10K. Looking at the pulse O/P on a scope it is VERY clean and works on a PIC MCU with no problems.
Here is the sensor
https://www.google.com.ph/search?q=flow ... Hnqrm6gYUM:
the data sheet says Vcc = 5V BUT iv been running 2 of these on 2 seperate PIC's @ 3V3 for around 2 months and NO problems, accuracy is +/-3% which is adequate for my application. Also i do NOT think it has anything to do with the pulse input as iv seen the reboot problem on both the flow sensor as well as a signal generator. I understand that the ESP module has no hardware pulse counter so presumably it is driven by software polling meaning the system will probably slow with increasing frequency. So for a flow rate of 10 liters per minute that would equate to 7.5 * 10 = 75Hz.
Ray
Here is the sensor
https://www.google.com.ph/search?q=flow ... Hnqrm6gYUM:
the data sheet says Vcc = 5V BUT iv been running 2 of these on 2 seperate PIC's @ 3V3 for around 2 months and NO problems, accuracy is +/-3% which is adequate for my application. Also i do NOT think it has anything to do with the pulse input as iv seen the reboot problem on both the flow sensor as well as a signal generator. I understand that the ESP module has no hardware pulse counter so presumably it is driven by software polling meaning the system will probably slow with increasing frequency. So for a flow rate of 10 liters per minute that would equate to 7.5 * 10 = 75Hz.
Ray
Re: Flow sensor reboots ESP E12
@RAy
I will check your wiring after I come back home.
THX
I will check your wiring after I come back home.
THX
Re: Flow sensor reboots ESP E12
@ Shardan
Unfortunately I do not have an oscilloscope to check it out .... BUT !!! theoretically ........
I have checked the actual flow of water. I poured a certain amount of water eg 800ml through a flow sensor and verified with a properly functioning scatch on Arduino UNO. This gives me confidence that the flowmeter measures correctly.
At this moment, the flow meter is plugged into a closed water system with a small pump
which gives a 4.8L / m flow -> checked on Arduino UNO
The water hall-effect flow sensor output pulses are proportional to the water flow with: Pulse Frequency (Hz) = Flow (L/min) * Calibration Factor.
In my case calibration factor is 4.5 wich means that: My freq = 4,8 * 4.5 = 21,6 Hz
Greets
Jacek
-
- Normal user
- Posts: 48
- Joined: 23 May 2017, 21:38
- Location: Malente / Germany
Re: Flow sensor reboots ESP E12
Are you really sure it makes no problems until 50Hz?Today I increased frequency. Up to 50 Hz it works fine.
I have the same problems with 3 counters running around 10 to 30 Hz.
I have a very good strong short power supply with 3A.
If I reduce from 3 to 1 counter, or from 3 to 2 counters than I have less warm reboots.
I have 275 warm boots within 4 days.
These warm boots does not occur in the same period.
Sometimes it runs 1 hour withaut any problem.
And than within 10 minutes it has 3 warm boots.
And of course everything between these two extrems.
I'm using moules which give a very good frequency output signal.
So the problem I have is not causes by the power supply and not caused by the frequency signal.
I think it is a softwareproblem caused by the Interrupts of the three frequency counting channels and the ESP8266 core which needs time for the WLAN connectivity.
Any idea to solve it?
Thanks and best regards,
Chris
Re: Flow sensor reboots ESP E12
I've set my test nodeMCU to 22Hz pulse from my signal generator and will monitor uptime.
Regards
Shardan
Regards
Shardan
Regards
Shardan
Shardan
Re: Flow sensor reboots ESP E12
No i'm not - i tested it for a short time only as i don't use counters myself atm.themanfrommoon wrote: ↑04 Nov 2017, 12:12Are you really sure it makes no problems until 50Hz?Today I increased frequency. Up to 50 Hz it works fine.
As said i've just setup some testing and will monitor for longer terms.
If this is a firmware bug it makes the counter function somewhat useless.
Regards
Shardan
Regards
Shardan
Shardan
Re: Flow sensor reboots ESP E12
Im sure i would have set debounce time to a minimum setting as the pulse comes from a hall element therefore the waveform is clean. Debounce is only realy needed for things like relays and switches where you get mechanical bouncing of the contacts.And what about DEBOUNCING TIME ?
Re: Flow sensor reboots ESP E12
Definitely.rayE wrote: ↑05 Nov 2017, 11:28Im sure i would have set debounce time to a minimum setting as the pulse comes from a hall element therefore the waveform is clean. Debounce is only realy needed for things like relays and switches where you get mechanical bouncing of the contacts.And what about DEBOUNCING TIME ?
Debouncing is for mechanical contacts as they tend to generate noise on closing/opening.
With clean electronic signals it's just not necessary.
Anyways it should not crash ....
On another note:
I had to reset log - we obviously had some power outage over night so all my devices reset...
Regards
Shardan
Regards
Shardan
Shardan
Re: Flow sensor reboots ESP E12
Hello all,
after some time of testing i'm not sure if that is a firmware bug.
I've quickly nailed together a nodeMCU with a transistor on a GPIO and fed the transistor with 22Hz as this is what the sensor gives here at max.
At first i had a bunch of resets:
I changed to another power supply and then got these uptimes:
- 383 min
- 1195 min
- 80 min
- 31 min
- 83 min.
I changed to another power supply and then got these uptimes:
- 3127 min
- and now up and running for ~900 min and counting.
Regards,
Shardan
after some time of testing i'm not sure if that is a firmware bug.
I've quickly nailed together a nodeMCU with a transistor on a GPIO and fed the transistor with 22Hz as this is what the sensor gives here at max.
At first i had a bunch of resets:
I changed to another power supply and then got these uptimes:
- 383 min
- 1195 min
- 80 min
- 31 min
- 83 min.
I changed to another power supply and then got these uptimes:
- 3127 min
- and now up and running for ~900 min and counting.
Regards,
Shardan
Regards
Shardan
Shardan
Who is online
Users browsing this forum: No registered users and 0 guests