Flow sensor reboots ESP E12

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Flow sensor reboots ESP E12

#11 Post by rayE » 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

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

Re: Flow sensor reboots ESP E12

#12 Post by grovkillen » 02 Nov 2017, 12:13

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
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...
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:

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Flow sensor reboots ESP E12

#13 Post by rayE » 02 Nov 2017, 12:20

My setup:
v2.0.0-dev12

Device = Pulse Counter
I/O = CH5
Type = delta/total/time
Mode = Rising
Delay = 10s

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Flow sensor reboots ESP E12

#14 Post by rayE » 02 Nov 2017, 12:31

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?

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Flow sensor reboots ESP E12

#15 Post by Shardan » 02 Nov 2017, 13:11

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
Regards
Shardan

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Flow sensor reboots ESP E12

#16 Post by Shardan » 02 Nov 2017, 14:37

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
Regards
Shardan

JackG
New user
Posts: 9
Joined: 16 Oct 2017, 18:21

Re: Flow sensor reboots ESP E12

#17 Post by JackG » 04 Nov 2017, 09:30

grovkillen wrote: 02 Nov 2017, 12:13
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
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 and @grovkillen

I understand you mean this scheme?
Image
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

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Flow sensor reboots ESP E12

#18 Post by rayE » 04 Nov 2017, 10:07

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

JackG
New user
Posts: 9
Joined: 16 Oct 2017, 18:21

Re: Flow sensor reboots ESP E12

#19 Post by JackG » 04 Nov 2017, 10:46

@RAy

I will check your wiring after I come back home.
THX

JackG
New user
Posts: 9
Joined: 16 Oct 2017, 18:21

Re: Flow sensor reboots ESP E12

#20 Post by JackG » 04 Nov 2017, 10:53

Shardan wrote: 02 Nov 2017, 14:37 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.
@ 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

JackG
New user
Posts: 9
Joined: 16 Oct 2017, 18:21

Re: Flow sensor reboots ESP E12

#21 Post by JackG » 04 Nov 2017, 10:57

rayE wrote: 02 Nov 2017, 12:20 My setup:
v2.0.0-dev12

Device = Pulse Counter
I/O = CH5
Type = delta/total/time
Mode = Rising
Delay = 10s
And what about DEBOUNCING TIME ?

themanfrommoon
Normal user
Posts: 48
Joined: 23 May 2017, 21:38
Location: Malente / Germany

Re: Flow sensor reboots ESP E12

#22 Post by themanfrommoon » 04 Nov 2017, 12:12

Today I increased frequency. Up to 50 Hz it works fine.
Are you really sure it makes no problems until 50Hz?

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.
PulseCounter17warmboots.PNG
PulseCounter17warmboots.PNG (138.03 KiB) Viewed 17068 times
IR Sensor.jpg
IR Sensor.jpg (162.27 KiB) Viewed 17068 times
PulseCounter11.jpg
PulseCounter11.jpg (97.94 KiB) Viewed 17068 times

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

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Flow sensor reboots ESP E12

#23 Post by Shardan » 04 Nov 2017, 16:01

I've set my test nodeMCU to 22Hz pulse from my signal generator and will monitor uptime.

Regards
Shardan
Regards
Shardan

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Flow sensor reboots ESP E12

#24 Post by Shardan » 04 Nov 2017, 16:03

themanfrommoon wrote: 04 Nov 2017, 12:12
Today I increased frequency. Up to 50 Hz it works fine.
Are you really sure it makes no problems until 50Hz?
No i'm not - i tested it for a short time only as i don't use counters myself atm.

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

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Flow sensor reboots ESP E12

#25 Post by rayE » 05 Nov 2017, 11:28

And what about DEBOUNCING TIME ?
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.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Flow sensor reboots ESP E12

#26 Post by Shardan » 05 Nov 2017, 12:25

rayE wrote: 05 Nov 2017, 11:28
And what about DEBOUNCING TIME ?
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.
Definitely.
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... :roll:

Regards
Shardan
Regards
Shardan

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Flow sensor reboots ESP E12

#27 Post by Shardan » 09 Nov 2017, 18:38

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
Regards
Shardan

Post Reply

Who is online

Users browsing this forum: No registered users and 58 guests