Raspberry Pi hat design

I am designing a Raspberry Pi hat that needs to be able to accept inputs from 3 different water meters. Two of the inputs are 4-20mA signals, the third input being a pulse signal. At the top I have two powered 4-20mA loops powered by 24VDC. These loops are connected to a 16 bit ADC (A0/A1) which is connected to the Raspberry Pi through the I2C communication ports. There are 200ohm resistors for each of the loops. Both 4-20mA output modules have a positive and negative wire as well as a ground wired to the water meter.

1.) Will a 24VDC power supply be enough to power both 4-20mA loops?

2.) Is 200 ohms for the resistors still sufficient?

On the bottom right, I have the pulse signal terminal. I have measured the pulse signal to be 24VDC. Because this is a pulse, I need to debounce it which I think I can do using a hardware debounce with a capacitor. The Pulse is then connected to pin 23 on the Raspberry Pi.

3.) Will this design of the hardware debounce even work? What problems are present in its design?

4.) How do I figure out what size capacitor I will need?

5.) Overall is the design sufficient for what I need?

I don't know much about electronics, so any help would be much appreciated.

• Software debouncing is generally far easier to get right and to repeatably tune - just ignore the input for a brief period after detecting the initial transition. That part of your drawn picture isn't really a debouncer at all - mostly it looks like a confused mistake. – Chris Stratton Aug 13 '17 at 22:45
• You appear to have your debounce cpacitor in series with the pulse input - the capacitor should be connected between signal and ground. The Pi will get very upset when given a 24 volts signal on one of its IO pins - you must reduce the pulse signal to 3.3 volts. – Peter Bennett Aug 13 '17 at 22:49

1) Sure. As long as there's >20mA available for each loop, they wont care what else is hanging off the same supply.

2) Sure, each loop will still only have 4-20mA flowing through it (during normal operation), so a 200Ω resistor will produce 0.8V-4.0V.

Double check that the "grounding" of the meters is correct. Be sure you have a "three-wire" 4-20mA device, and that the connections are supply, signal and ground.

3) No, for two reasons. Firstly the capacitor needs to be from signal to ground in order to filter the pulse, and secondly, the 24V needs to be reduced to interface to the Pi.

4) This is an RC circuit. Use $$V_o = V_i * e^{\frac{-t}{RC}}$$ where Vo is the voltage coming out (going to the Pi), Vi is voltage coming in (the pulse), t is time, R is the resistance and C is the capacitance. Consider all your possible Vi scenarios and see how C affects Vo. You'll probably find you'll struggle to find a satisfactory result! You might want to consider either a different debounce circuit or just doing it in software.

5) Provided you fix the pulse input, then it could be.

Generally speaking there is a lot going on here. It might be easier to get help if you focus on one problem at time.

• SCHEMATIC So I've switched up the design, is this what you're talking about what you say that the capacitor needs to go from the signal to ground? I also added a buck converter to convert down to 3.3V. many designs I am seeing have a resistor going to the GPIO pin is this necessary here? – Travis O'Neal Aug 15 '17 at 19:30
• Here is the Breadboard Design – Travis O'Neal Aug 15 '17 at 19:41
• Again, lots of questions. I think you're not going to be well served here, but I'll try. Yes for the capacitor to ground. Buck converter is horrible choice. Will throw your RC right out. Consider resistive divider or Zener regulator instead. Resistor is not necessary, but a good idea, in case of transients, start up behaviour etc. – Heath Raftery Aug 16 '17 at 0:42