Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiring Schematic clarification #1

Open
DP-M opened this issue Jun 5, 2019 · 2 comments
Open

Wiring Schematic clarification #1

DP-M opened this issue Jun 5, 2019 · 2 comments

Comments

@DP-M
Copy link

DP-M commented Jun 5, 2019

Hi, I'm hoping you can clarify your wiring schematic. I'm using an EKM water meter with pulse output. I have 3 wires, and according to this post (https://forum.ekmmetering.com/viewtopic.php?f=9&t=6115), there is a Common wire, pulse-output1 wire, and pulse-output2 wire. I believe, I can safely ignore the pulse-output2 wire, since I only have one device hooked up for reading.

In your wiring diagram, would I hook the Raspberry pi 3.3V output up to the common, then hook the pulse-output1 wire to RPI's pin 13/GPIO 27 with a 1k ohm resistor, and RPI's ground with 10k ohm pulldown?

Also, I'm confused about the order of the 1k, and 10k resistors. The schematic makes it look like they are not inline with each other, but the description says to put the 10k pulldown after the 1k resistor. Can you clarify?

My apologies if these questions are basic, I've never worked anything like this before. Thanks.

@localhost61
Copy link

@DP-M as you want to read the state of a reed contact, connect the black wire to Ground, and either Red or White depending the one you chose, connect it to GPIO 27 with 1kΩ and to 3.3V with 10kΩ.
That way, when the reed contact is open, the RPi sees 3.3V, due to the 10kΩ pullup. When the reed contact is closed the RPi sees 0V, because the reed resistance is lower than 1Ω and it will drain 330µA.
The 1kΩ resistor is not mandatory, and with an slight change in the source code:
GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP)
adding an internal 50kΩ pullup, the external 10kΩ could be removed too ;-).

@superfrink
Copy link
Owner

superfrink commented Nov 12, 2019

@DP-M, I am not familiar with that specific meter. I assume you can ignore pulse-output2 (white) and connect the common (black) and pulse-output1 (red) to the two points labeled Power Meter on the schematic. (https://documents.ekmmetering.com/EKM-SPWM-075-HD-water-meter-spec-sheet.pdf reads "You can disregard the white wire".)

The meter behaves like there is a switch inside between the black and red wires. Most of the time the switch is open and no current flows through it. After a certain amount of water flows through the meter the switch is closed for moment. We are wiring up a circuit to detect when the switch is opened and closed.

In the schematic I used, pin 13 is the input pin. Software detects when the value read by pin 13 changes. The 1k ohm resistor is there to limit current.

Pin 6 is at 0V ("ground"). When the power meter switch is open, pin 13 will see the 0V from pin 6 through the 10k ohm resistor.

Pin 1 supplies 3.3V to the black wire on the power meter. When the switch is closed, pin 13 will see the 3.3V from the white wire from the switch. The 10k ohm resistor limits the current between pins 1 and 6. 3.3V / 10k ohm = 0.33 mA.

Place the 1k and 10k resistors as shown in the diagram. The instruction to put the 10k "after" the 1k resistor meant to put the one end of the 10k on the power meter side of the 1k instead of the pin 13 side.

Notes on resistors:

As @localhost61 pointed out, the 1k ohm resistor isn't needed because input pins are high-impedance. I used it because if the pin were accidentally configured as an output pin and shorted without a resistor then it could be damaged.

The Pi does have 50k ohm internal pull up/down resistors that could be used instead of the external 10k ohm that was used in the schematic.

If you use the internal 50k ohm resistor (code change required) then also remove the external 1k ohm resistor. Using both the 50k ohm and 1k ohm would create a voltage-divider and pin 13 would see less than 3.3V when the switch is closed. It probably wouldn't make a difference in this case because the ratio is 1k/51k which gives a 2% drop. If it were a large drop, pin 13 might not properly detect whether the switch is open or closed.

By the way, related to the question about where to put the 10k ohm resistor, if the 10k were on the pin 13 side of the 1k then it would create the same kind of voltage-divider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants