Using Pulse Count 1.1 w/ Flow Sensor

I have a Flow sensor from seametrics http://www.seametrics.com/sites/default/files/product_downloads/LT-65200067-SSeries-030113_0.pdf.
The Flow sensor has three wires: Red DC+(5-24), White Signal, Black DC-
In documentation it says that the PLC(here Pulse Count 1.1) must accept current sinking device, if PLC only accepts current sourcing devices then resistor must be added between Red and White(2.2 K Ohm for 24V application).
Question #1: What kind of sensor input is accepted by Pulse Count 1.1? {current sinking, current sourcing, 4-20 mA analog input, other}
I assume but can not find an answer on forum or documentation:
Question #2: Are the 5V 3.3V GND input or output? {they differ from the schematic 5v Vcc Gnd}
Question #3: what is the IN on the schematic? {I believe that it is the common for three wire encoders, but in this situation how is it used?

  1. I have no idea what they mean! But I would wire the power to 5V and connect the signal wire to the input on the pulse in module. It should work fine.
  2. They are out so you can wire 5V to your sensor
  3. Connected to an input on the processor. Useful if you have an encoded with a built in button.

Thanks. Got 2,3 and will experiment for final answer on one.

I looked at the manual and I think they mean this is an open drain input. I think the module already have a resistor so you are fine but you can add one if you like. Either way, you will not damage the module.

Manual Did I miss that in my order? :slight_smile:

How do you apply a pulse to A or B? Grnd to A or 5V to A
Also Am I missing some code?
do I need to tell pulse counter how to count pulse, or which A or B to watch?

In ProgramStarted()

pulseCount2.ResetCount();

then triggered off of timer:

int count = pulseCount2.GetCount();

I have no idea of your area(s) of expertise; so, please, forgive me if I link you to documents and tutorials that cover materials you already know (or tp web pages on our site that you’ve already found).

From my read of your post, most of your questions relate to the connections of the two devices you are using: Pulse Counter <–> Rotary Encoder.

Sources of examples and explanations.
[ol]Finding info about a GHI product, you got to our product catalog (use search at top of any page for your product name), once on the product’s general info page, click on the Resources tab. What you find there is product dependent. For the Pulse Counter module I noticed we didn’t have the counter chip’s datasheet, so I’ve linked it in.
using the Search Field at the top of the page, you can scan our catalog, the forum, our documents library (Tutorials, Explanations, …), or codeshare (code-snippets and/or whole projects submitted for use by ourselves and our community members.[/ol]

Source code for all GHI’s Gadgeteer Devices is found at gadgeteer.codeplex.com, in particular for the pulse counter: http://gadgeteer.codeplex.com/SourceControl/latest#Main/Modules/GHIElectronics/PulseCount/Software/PulseCount/PulseCount_42/PulseCount_42.cs

To get a list of the public accessible items in the Gadgeteer driver for a module, select the module in the Visual Gadgeteer Designer and press F1. Sometimes that information gets stale, the source code for the driver is always up-to-date and can be searched for the word “public”

If you want to get down to programming the modules chip on your own, take a look at the codeshare entry https://www.ghielectronics.com/community/codeshare/entry/256 . I’m not sure which version of NETMF the entry is written for; if it’s 4.1, you will probably have to change some USING statements and/or which assemblies are used (“Resources” in Visual Studio’s Solutions Browser).

I believe the datasheet details the use for A and B depending on Quadriture mode or not. Since you show one signal in your description, I believe that is a non-quadriture device (I’m not an expert on Rotary Encoders).

I am using the test app found at:
http://gadgeteer.codeplex.com/SourceControl/latest#Main/Modules/GHIElectronics/PulseCount/TestApp/Program.cs

I need to use the NoneQuad counting mode. How do I implement the get and set of public CountMode Mode, to set the mode to different modes?

If you are using the PulseCount module in the designer, NoneQuad should be applied for you. In this mode, setting ‘B’ to ground should increase the count.

So default it running in None quad, ok.
I jumped B to Grnd, then i ground A for 300 ms, display changes to neg 1, then back to zero, even if i pulse several times say 5 pulses at 150ms. I thought this was like a keypad that we pull pin voltage low by tying to ground and thus on falling edge register pulse?
Am I supposed to supply voltage to A like 3.3? Doesn’t seem right but would be willing to try it.
How do I use the mode get command to see what mode I am running in?

I hate to BUMP this again but I am at a loss and have hit a wall in my thinking. Need some new direction, or instruction. Just need this module to count how many times my switch opens and closes.

Ok so I played around with this and this is what I have come up with.
Total shows 0
pull B Low, then pull A low increment counter -1
then B high then A high counter remains unchanged to now shows -1
then B low then A low increment counter -1 tot now shows -2
then B high then A high counter remains unchanged to now shows -2
then B low then A low increment counter -1 tot now shows -3
then B high then A high counter remains unchanged to now shows -3
then B low then A low increment counter -1 tot now shows -4

if we reverse this order then count reverses
pull A low, then pull B low, then A high, then B high counter increments +1

so i am pretty sure i am mechanically creating the digital output from a three wire encoder non gray scale.

I am fairly new at this programming side so How do I call the setter, Like this?
PulseCount.CountMode = “NoneQuad”

And Finally where do i put this line?

I also found this code which i believe is the “source code” for this module

private void Initialize()
		{
			this.Write((byte)Commands.LS7366_CLEAR | (byte)Registers.LS7366_MDR0);
			this.Write((byte)Commands.LS7366_CLEAR | (byte)Registers.LS7366_MDR1);
			this.Write((byte)Commands.LS7366_CLEAR | (byte)Registers.LS7366_STR);
			this.Write((byte)Commands.LS7366_CLEAR | (byte)Registers.LS7366_CNTR);
			this.Write((byte)Commands.LS7366_LOAD | (byte)Registers.LS7366_OTR);

			this.Mode = CountMode.Quad1;

			this.Write((byte)Commands.LS7366_WRITE | (byte)Registers.LS7366_MDR1, (byte)MDR1Mode.LS7366_MDR1_4BYTE | (byte)MDR1Mode.LS7366_MDR1_ENCNT);
		}

I think this line sets the default mode to quad1
this.Mode = CountMode.Quad1;
so again how do i change this line of code or implement the get set method for the countmode?

“source code” is on codeplex, right ?

Here’s how you modify the driver : https://www.ghielectronics.com/docs/122/gadgeteer-driver-modification

Thanks that helped a bunch,
the way to change the mode that the counter operates in is:



And with a slight modification of the source even that line is not need now, thanks