Flow sensor - ESP not starting-up if connected?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
JR01
Normal user
Posts: 260
Joined: 14 Feb 2016, 21:04
Location: South Africa

Flow sensor - ESP not starting-up if connected?

#1 Post by JR01 » 29 Mar 2016, 22:54

Hi all, I have a nice project with ESP-01, which measures a) rainfall via a tipping bucket gauge, and b) water flow into my geyser with a YF-S201 flow meter. I am so excited, got it working over the weekend, lots of effort to install the flow meter in-line to the geyser.

See attached the schematic for the project. The PROBLEM I have, is that the project only works if I startup the project without sensor 2 attached. Once started, I can plug the 3 wires of the flow meter into the board, (VCC 5v, Gnd, D), for which D goes into the logic level shifter. I can only assume it has something to do with GPIO0 in Low-mode - which puts the ESP01 in Flash mode, thus preventing proper startup. However, the Blue-light on the ESP-01 stays ON when the 3 wires from the flow meter is plugged into the board when it starts up, does not seam to be Flash mode then?

<<Picture removed to correct after suggestions, see post further down with corrected circuit>>

Question: what causes the ESP01 not to boot properly, and what to do about it (without needing manual intervention to remove the 3 wires for boot up, and then to put them back after boot)?
Last edited by JR01 on 31 Mar 2016, 21:23, edited 1 time in total.
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: Flow sensor - ESP not starting-up if connected?

#2 Post by kr0815 » 30 Mar 2016, 09:27

GPIO0 has to be high during boot sequence, so you need at least a pull-up resistor

I don´t know if this is possible with the YF-S201, if not you´ll need a transistor, optocoupler,...

JR01
Normal user
Posts: 260
Joined: 14 Feb 2016, 21:04
Location: South Africa

Re: Flow sensor - ESP not starting-up if connected?

#3 Post by JR01 » 30 Mar 2016, 17:06

Thank you, will try with pull-up. I am new to all this, not sure how to use transistor, already have it working through optocoupler, not working on that.
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: Flow sensor - ESP not starting-up if connected?

#4 Post by kr0815 » 30 Mar 2016, 19:47

I would try to take the level shifter out, use 2 resistors, so you have about 3 V when the flow meter is logical high, hopefully it will pull it down to almost zero when water is puring

But i don´t understand why so many people use the ESP-01, for like one € more you get an ESP-12 which has much more IO Pins

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: Flow sensor - ESP not starting-up if connected?

#5 Post by costo » 30 Mar 2016, 20:02

kr0815 wrote: . . . . . i don´t understand why so many people use the ESP-01, for like one € more you get an ESP-12 which has much more IO Pins
Why would you use a ESP12 when it is much more convenient to use a NodeMCU.
No USB/Serial adapter needed for programming and no problem with powersupply, it gets power via a USB connector.
Besides it usually is more stable than any bare ESP module.

JR01
Normal user
Posts: 260
Joined: 14 Feb 2016, 21:04
Location: South Africa

Re: Flow sensor - ESP not starting-up if connected?

#6 Post by JR01 » 30 Mar 2016, 23:51

Thank you all, pull-up register got it working on the ESP-01. And, I replaced the ESP01 with ESP12E, now probably have more stable solution. Still running on breadboard in my roof, have ordered D1 WeMos dev boards. But, nice = I got the ESP01 working !!!!
Thanks for comments / support / suggestions. Implemented all. Will post updated diagram for others to re-use.
(PS - did you know a shower consumes 29L of hot water only ???)
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.

andy
Normal user
Posts: 65
Joined: 26 Jan 2016, 23:07

Re: Flow sensor - ESP not starting-up if connected?

#7 Post by andy » 31 Mar 2016, 01:47

JR01 wrote:...snip...(PS - did you know a shower consumes 29L of hot water only ???)
I bet my granddaughter uses more than that!!! :shock:

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: Flow sensor - ESP not starting-up if connected?

#8 Post by kr0815 » 31 Mar 2016, 08:19

Why would you use a ESP12 when it is much more convenient to use a NodeMCU.
A NodeMCU is also a ESP12, just already delivered with a PCB :-)
Only Problem with NodeMCU is, it´s not that fast / cheap available in germany

bennybubble
Normal user
Posts: 44
Joined: 31 Jan 2016, 21:05

Re: Flow sensor - ESP not starting-up if connected?

#9 Post by bennybubble » 31 Mar 2016, 08:40

Looking at your diagram, I see a cap between +5 and +3v3 at the top-left corner.
Personally I would place the cap between either
a) +5 and gnd
b) +3v3 and gnd
c) 2 caps for a) and b)

-ben

JR01
Normal user
Posts: 260
Joined: 14 Feb 2016, 21:04
Location: South Africa

Re: Flow sensor - ESP not starting-up if connected?

#10 Post by JR01 » 31 Mar 2016, 21:25

Thank you all for suggestions, here is the corrected circuit, this one works as well. tested with ESP01, but as per suggestions, I changed it to an ESP12E - in my roof now counting hot water litres, rain, and I added a DS18b20 to measure outside temp.
JR01 - ESP8266 Project for Rain- and Flow meter sensors.png
JR01 - ESP8266 Project for Rain- and Flow meter sensors.png (164.41 KiB) Viewed 11259 times
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.

User avatar
beic
Normal user
Posts: 142
Joined: 18 Aug 2016, 18:19

Re: Flow sensor - ESP not starting-up if connected?

#11 Post by beic » 21 Oct 2016, 19:51

Hi there,

Yeah, same here, with that blue led, the ESP-01 wont start up if the YF-S201 Water flow Sensor is attached.

I made it exactly how is it described on the posted image bellow, now the blue led is not ON at the power-up. but the ESP-01 wont start again...

I'm using only the circuit part marked in red shape.

Using firmware R140.

Image

Used logic level converter from the image bellow:
Image

Any help please?! :oops:

Kind regards

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: Flow sensor - ESP not starting-up if connected?

#12 Post by costo » 22 Oct 2016, 02:06

beic wrote: Yeah, same here, with that blue led, the ESP-01 wont start up if the YF-S201 Water flow Sensor is attached.
The datasheet says this sensor produces short pulses, so apparently most of the time the data_pin is low. This means GPIO-0 is most of the time at a low level when the flow sensor is attached as in your schematic. This will force the ESP into the flash-mode when powering up.
Using a level converter does not change anything to this.

I think the solution is to use a inverting transistor.
Image
The data-pin of the flow-sensor may need a pull-up resistor of 10k connected to the powersupply of the sensor (5V-18V)
The sensor-datapin is connected to the input of the circuit. The output is connected to GPIO-0.
+V = 3.3 Volt, Rl is 10k, Rb is 10k (Rb may be lowered if the pulses are fast, meaning a lot of flow)

User avatar
beic
Normal user
Posts: 142
Joined: 18 Aug 2016, 18:19

Re: Flow sensor - ESP not starting-up if connected?

#13 Post by beic » 22 Oct 2016, 20:22

costo wrote: I think the solution is to use a inverting transistor.
Image
The data-pin of the flow-sensor may need a pull-up resistor of 10k connected to the powersupply of the sensor (5V-18V)
The sensor-datapin is connected to the input of the circuit. The output is connected to GPIO-0.
+V = 3.3 Volt, Rl is 10k, Rb is 10k (Rb may be lowered if the pulses are fast, meaning a lot of flow)
Thank you for your help! It worked like a charm! You are awesome! ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests