Help needed (and mu...
 
Notifications
Clear all

Help needed (and much appreciated) with reading a pulse output with ESP8266


notsogoodatcode
(@notsogoodatcode)
New Member
Joined: 2 years ago
Posts: 3
Topic starter  

I should have asked for help on this long ago.  I was trying to build off of Bill's video with the laser and ultrasonic distance sensors where pulse outputs are counted using an arduino, but I am using an ESP8266.

I'm trying to use an ESP8266 to read the pulse output from a water meter that I installed.  Critically, the meter output has only 2 wires.  This is a link to the water meter in case a picture helps.  Short story is that I don't know how to wire this up to read the pulse output.

What I have done to date:

The water meter is in a location over an hour from me so I bought a cheap electric pulse generator to work on the project and test it at home.  I got everything working well with the pulse generator standing in for the water meter.  The pulse generator also has 2 output wires (a ground and a signal).  However, I somehow overlooked the fact the pulse generator has another two wires that are used to supply power to the pulse generator itself.  The pulse output sensor on the water meter has no equivalent input to provide power.  The wiring setup that worked with the pulse generator did not work with the actual water meter output wires.

After much searching I came across a wiring schematic online that I thought might work.  The diagram is towards the bottom of this page just under the heading for Reed Switches.  I interpreted this diagram as saying to connect one end of the water meter pulse output to ground and split the other between power and an input pin.  I tried this using a reed switch that I bought but it just seems to short out the ESP8266 unit.  For completeness, I used D8 and 3.3V for the side of the circuit not connected to the ground pin.  I also activated the pullup resistor on pin D8.

Any suggestions for how to connect this 2-wire pulse output to a ESP8266 would be much appreciated.  I have a variety of meters that I want to read and all have the same 2-wire pulse output setup.  I have a feeling this is some very basic misunderstanding on my part, but I haven't been able to piece this together on my own through web and youtube seaches.

Thanks!

 

Josh


Inst-Tech liked
Quote
DaveE
(@davee)
Reputable Member
Joined: 12 months ago
Posts: 355
 

Hi Josh @notsogoodatcode,

   Welcome to the forum ... hopefully we can help you get started.

I am pleased to see you have carefully prepared your question above, and hope you won't mind if I suggest you add a schematic diagram of the test circuit you are trying to get to work.

I am only imagining a photo of a very basic pencil sketch - you might already have done one for your own purposes - it will make it much easier to follow your text.

Thanks. Best wishes, Dave


ReplyQuote
notsogoodatcode
(@notsogoodatcode)
New Member
Joined: 2 years ago
Posts: 3
Topic starter  

Dave,

Thanks for the response.  I fell ill right after the prior posts and am just getting back to it now.  BTW, how do I upload a picture to the forum?  All I see is a notice saying no more uploads are allowed today.

Also, I think I've had a bit of a revelation on this.  I was trying to implement the circuit in this diagram. However, I am doing this on NodeMCU-32 instead of an Arduino.   I now think I misunderstood the diagram and the resistor pictured is actually the pullup resistor on the NodeMCU.

I think I can reframe the question now. Assume that I am going to use GPIO22 on the NodeMCU to read pulses.  The water meter has a simple reed switch pulse output (2 wires).  One side of the reed switch will connect to GPIO22.  Would it be best to: (A) connect the other side of the reed switch to 3.3V and use the pulldown resistor on GPIO22 or (B) connect the other side of the reed switch to ground and use the pullup resistor on GPIO22?  I believe that I've found different diagrams with both configurations.

Thanks,

Josh


ReplyQuote
Will
 Will
(@will)
Noble Member
Joined: 11 months ago
Posts: 1764
 
Posted by: @notsogoodatcode

Thanks for the response.  I fell ill right after the prior posts and am just getting back to it now.  BTW, how do I upload a picture to the forum?  All I see is a notice saying no more uploads are allowed today.

You might not be able to post a picture until you've made a few more posts. I think there's a "trial period" before you become fully accepted; during that period your posts have to be vetted by an administrator before they show up here.

To re-state the obvious, to post a picture you can either use the "Attach Files" icon below and navigate to the file you want to add as an attachment or just drag and drop the file onto the post you're creating.

Note that not all file types are acceptable to the drag and drop option, so you may need to resort to the icon method.

I was kidnapped by mimes.
They did unspeakable things to me.


ReplyQuote
Ron
 Ron
(@zander)
Noble Member
Joined: 1 year ago
Posts: 1824
 

@notsogoodatcode Pullup on 22 via the builtin pullup, INPUT_PULLUP vs INPUT in the pinMode statement. 

No actual resistor needed.

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote