1
\$\begingroup\$

Problem

I need to design an isolated analog front end to a Raspberry Pi which needs to work with either a 4-20mA or 0-10V transmitter. I've been studying existing analog input modules from major PLC manufacturers for inspiration.

Existing products

  • Allen Bradley Micro850 analog I/O module (datasheet) has for each input channel, a separate Vin, Iin and COM pins.
  • Wago 750 offers current input modules and voltage input modules. I didn't find any modules with analog channels having both current/voltage inputs for the same channel.
  • Industruino Ind.I/O seems to offer both 0-20mA/0-10V in the same pin on every channel, selectable in software as shown in the following image [Ind.I/O pinout](https://imgur.com/a/D710s)
  • UniPi S10x (datasheet), also seems to offer both 0-20mA/0-10V in the same pin.

Solution Attempts

With an ADC span of 2V, I know how to make either

  • a current receiver with a 100Ω resistor
  • a voltage receiver with a passive attenuator with source impedance >100kΩ

Precision in either is not required since I can do a software calibration with a calibrated current/voltage source.

I tried to understand how Industruino was able to software select between current and voltage input since voltage input requires high impedance while current input requires low impedance.

Their Indio I2C library tells me the following

  • MCP3424 is the 4-ch 18-bit ADC
  • 2xMCP4726 are the 1-ch 12-bit DAC
  • PCA9555 is a 16-bit I2C GPIO extender
  • 8 channels of the PCA9555 go to the 24V I/O through high side drivers
  • 4 channels of the PCA9555 are toggled HIGH for current input and LOW for voltage input by the analogReadMode() function; one for each analog input channel
  • 2 channels of the PCA9555 are toggled HIGH for current output and LOW for voltage output by the analogWriteMode() function; one for each analog output channel

Since it is a open hardware project, I tried to find the schematics on their website. It is neither there nor on any other website I came across. Their GitHub repository doesn't list it either. I tried emailing them with the query but they haven't responded.

I would be very grateful if anyone could shine a light on the solution.

\$\endgroup\$

3 Answers 3

1
\$\begingroup\$

You can switch the load resistor in or out with software using a solid state switch but you have to measure the voltage on the resistor side of the switch (so that the switch resistance does not affect the reading) so you need to multiplex the ADC input between the two. You also would need a PGA to accommodate the 10V voltage input vs. typically 5V (or less) burden from the current input load resistor. Maybe just a 2:1 gain selection which is easy with another 2:1 analog mux.

Make sure the switch you use is not too high resistance or it will affect the required compliance from the transmitter and take appropriate precautions (beyond the scope of this answer) to harden the inputs against transients etc., such as from long wires and a nearby lightning strike. Properly designed industrial process control equipment has a lot of such considerations included, especially compared to hobbyist open boards like the Pi.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
6
  • \$\begingroup\$ The MCP3424 has a 1,2,4,8 PGA so that won't be an issue. > You have to measure the voltage on the resistor side of the switch (so that the switch resistance does not affect the reading) so you need to multiplex the ADC input between the two. I'm having trouble understanding exactly what you mean. Do you have a schematic of that? For my purpose, I'm just going to have a Schottky diode clamping the input to a safe value. My environment isn't particularly harsh, so I'm not worrying about that initially. \$\endgroup\$
    – ghirlekar
    Dec 10, 2017 at 19:18
  • \$\begingroup\$ See edit above. \$\endgroup\$ Dec 10, 2017 at 19:23
  • \$\begingroup\$ I see what you mean. However, with both switches being floating high side drivers, I don't know if I can directly drive N-channel Mosfets from the PCA9555. How would you recommend I achieve this switching digitally? \$\endgroup\$
    – ghirlekar
    Dec 10, 2017 at 19:26
  • \$\begingroup\$ Depends on the specs you are after- analog switches, or similar to their internal circuitry, SSR-type circuits. Many options. \$\endgroup\$ Dec 10, 2017 at 20:04
  • 1
    \$\begingroup\$ @dim Yes. The switches have resistance. If SW2 is feeding a high-Z input the resistance doesn't matter, but resistance of SW1 is in series with the current measuring resistor R1. If the input is a current source and SW1/2 are in the current position then the voltage across R1 + SW1 will be higher than that just across R1, but SW2 picks the voltage off across R1 so it does not introduce an error (unless you run out of compliance). \$\endgroup\$ Jan 29, 2018 at 21:03
0
\$\begingroup\$

I would use a reed relay or other low power electromechanical device to switch the load resistor in and out. The rest can be accomplished with a PGA.

\$\endgroup\$
0
\$\begingroup\$

I have another possible solution: Why not use an SPDT Relay, using the common connected between the resistor and the ADC input. The Relay NO connected to voltage source #1 and the NC connected to voltage source #2.
Then use another relay (without resistor) between the current sources? The same trigger could operate both relays or as many combinations as required.

Using DPDT or greater would reduce your relay count. (Assuming all voltage sources use the same ground)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.