3
\$\begingroup\$

I am looking for help in replacing manual 10-way switch with MCU controlled schematic that will emulate those switches and resistor chain.

The third-party device is using constant current source to measure voltage on a connected resistance. Here is a circuit it is designed to work with.

schematic

simulate this circuit – Schematic created using CircuitLab

Using answers to the old question I've made first prototype with MOSFETs instead of switches. It worked flawlessly, but the isolation requirement made circuit too big for the space available on the board.

So I made another prototype with MCP45HV51 digital pots. It works, but in the given conditions the wiper's resistance is over 220 Ohm, which eliminates 6 bands out of 10.

Now I am thinking, what if use BJT in place of resistors and control it with OpAmp that makes sure the voltage at "sense" will be exactly the same as supplied by ADC. This way I can simply set ADC to the voltage they expect to see on the resistor for each band. Something like this:

schematic

simulate this circuit

Actual current source I1 is 5.32mA, so I think 0.18V to 1.8V from DAC should be equivalent to closing SW1 to SW10 of the original circuit.

My concerns are these:

  • I have no idea if this would even work due to the lack of knowledge of analog circuits.
  • The current source also needs a feedback to keep the current constant. I am worried that two feedbacks would oscillate without some dampening.
  • I don't see how I can simulate fail-safe 330 Ohm resistor that is supposed to keep resistance at 670 Ohm when all switches are open. I can do it later by programming DAC, but not on power up. This is optional feature though.

UPDATE

I just received a suggested circuit from device manufacturer. Not sure if I understand it right, but I am not fond of the situation with full V2 going into 10 Ohm load.

schematic

simulate this circuit

UPDATE 2

Removed transistor following Simon's suggestions. Added fail-safe resistor.

schematic

simulate this circuit

\$\endgroup\$
14
  • \$\begingroup\$ Does this question require intimate knowledge of the previous question and answers? If it does then you should make this question stand-alone rather than dependent on information in an earlier post. \$\endgroup\$ Commented Oct 21 at 10:20
  • \$\begingroup\$ What exactly, are you wanting to do with this circuit? \$\endgroup\$ Commented Oct 21 at 15:57
  • \$\begingroup\$ @Andyaka No, this is standalone question and I've copied relevant information (expected 10-switch schematic) into it already. I only mentioned old question to avoid "this already has an answer" kind of comments. \$\endgroup\$ Commented Oct 21 at 17:12
  • \$\begingroup\$ Well I read your question and could not understand what you were attempting to do. \$\endgroup\$ Commented Oct 21 at 17:23
  • 1
    \$\begingroup\$ @Andyaka the application is 10-button manual control of a wheelchair electronics, which we want to emulate with MCU. The dynamic performance is irrelevant, since anything faster than human pressing the buttons is sufficient. The drifts and accuracies are embedded in the design using 34R resistors. For example anything between 17 and 51 Ohm is considered "button 1 pressed", between 51 and 85 Ohm is "button 2 pressed". These correspond to median voltages at "sense" point of 0.17V and 0.34V respectively, and so on for the rest of the buttons. \$\endgroup\$ Commented Oct 21 at 20:49

2 Answers 2

2
\$\begingroup\$

While your circuit does indeed produce \$V_{SENSE}=V_{DAC}\$, I cannot see how it is any different from a voltage source (such as a voltage-output DAC) connected directly to SENSE:

schematic

simulate this circuit – Schematic created using CircuitLab

The only requirement of the source of the applied potential is that it must be able to sink 5mA of current, which perhaps your DAC cannot do. In that case, use an op-amp voltage follower to sink that current on behalf of the DAC:

schematic

simulate this circuit

Any op-amp that can sink 5mA (which is most of them) and output close to ground should be fine. Even the lowliest LM358 should work.

For all DC intents and purposes, both of the above arrangements behave no differently from a resistance between SENSE and ground. For instance, if you directly apply \$V_{SENSE}=1{\rm V}\$, that source becomes a load which will have exactly the same effect (at DC) as a resistance of 200Ω:

$$ R = \frac{V}{I} = \frac{1{\rm V}}{5{\rm mA}}=200{\rm \Omega} $$

\$\endgroup\$
12
  • \$\begingroup\$ Thank you for the suggestion and explanation. Could you, please, comment on the update I've added to the question? They seem to think transistor is necessary, but they lean heavily to emitter follower configuration. \$\endgroup\$ Commented Oct 22 at 7:32
  • \$\begingroup\$ @Maple The 10 Ω suggested is unsuitably low and requires more current than specified for a standard op amp. If using a resistor there at all, I'd suggest a standard value close to (330 Ω + 340 Ω)/2: 330 Ω, turning a requirement for 5 mA to zero without resistor into one from 5 mA to -5 mA. \$\endgroup\$ Commented Oct 22 at 8:04
  • \$\begingroup\$ @Maple that emitter follower suggestion seems garbage to me, all it does is add current to the 5mA already being sourced, which is why you need a lower (10Ω) resistor to sink it all. It doesn't make sense. If you look at the output stage of an op-amp, there are two transistors, one to source current from the positive supply, one to sink current to the negative supply. When sinking current, the lower transistor is on (to some degree), the upper is completely off. The result is a configuration closely resembling the one you proposed, but where the transistor is inside the op-amp IC. \$\endgroup\$ Commented Oct 22 at 14:53
  • \$\begingroup\$ Thank you for confirming my suspicions. I also was taken aback by it. Using so low resistor to bring the resistance almost to short, and then trying to raise voltage on a shunt by injecting more current seems incredibly wasteful to me. I understand what you are saying about transistor inside op-amp. What worries me is 10V supply of their current source that can be applied to op-amp output while it is not powered up yet. Booster transistor removes that concern, I think \$\endgroup\$ Commented Oct 22 at 17:17
  • \$\begingroup\$ @Maple that's a fair concern, but even with your outboard transistor, the op-amp's non-inverting input is still connected to SENSE, and is likely to sink significant current when un-powered. I would advise a kilohm or more between SENSE and the non-inverting input. \$\endgroup\$ Commented Oct 22 at 17:32
0
\$\begingroup\$

You can simulate your second circuit. Here is in Falstad circuit simulator. Use the slider to control the voltage (indicated by the yellow arrow). The current stays almost the same as the voltage is varied.

enter image description here

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.