3
\$\begingroup\$

I'm working on interfacing a relatively high-current pump (>1A) with a MCU. My plan was to just have the pump switching circuitry and MCU circuitry on the same board, and not take any measures to isolate the two besides physically spacing them out.

However, I was thinking about whether I should try to isolate the components instead, either by separating their respective ground planes + power traces, or by placing the components on entirely different boards. I came up with the schematic below as an example implementation, where I basically have a connector for each section that joins together back at the power supply.

schematic

simulate this circuit – Schematic created using CircuitLab

My question is basically: conceptually, will this circuit work as intended? or are there any problems with grounding or "gotchas" that I'm not accounting for/aware of? Would this implementation even give a increase in stability/protection of the MCU? Any help or advice would be appreciated.

\$\endgroup\$
2
  • \$\begingroup\$ Not sure what the optoisolation gets you in this case (vs a mosfet or similar). The GPIO is an output so you just need to make sure the current it needs is sufficiently low. \$\endgroup\$ Commented Feb 21 at 23:02
  • 1
    \$\begingroup\$ OT: Your U1 (7805) receives its input power reversed. \$\endgroup\$ Commented Feb 22 at 9:58

2 Answers 2

3
\$\begingroup\$

Your own block diagram espouses most of the ideas I will describe here. Your circuit, by accident or by design, is actually rather good. Rather than just saying "yes, your circuit will work", let me tell you why it's good.

There's no isolation if you are using the same 12V source to power both pump and controller, they necessarily have to share the same ground, and the same positive supply rail. Placing an opto-isolator between the two would do nothing to isolate them electrically.

If the power sources for each were different, then the opto-isolator would permit you to keep the grounds (and everything else) completely isolated. This is not the case here.

If there is appreciable distance between the controller and pump systems, and there is current flowing through the common ground conductor between them, then there will be a potential difference between its two ends, due to its resistance. The greater the distance, or current, the greater this "ground potential discrepancy" will be.

This is problematic if the control signal cables do not develop the same potential difference, as they would not, since they do not carry comparable current. Digital logic thresholds at each end, which are produced relative to one ground potential, but sensed relative to a different, remote ground potential, can be misinterpreted. A lot depends on the location of the supply:

schematic

simulate this circuit – Schematic created using CircuitLab

With power sourced near the controller (top), motor current has to traverse the long cables, which develop a significant potential difference, and the remote motor sees a control signal that looks like 4V, not 5V, as shown on VM1. VM2 (bottom) shows how this is mitigated by locating the power source at the end where most current is needed, the motor, since much less current traverses the connecting wires.

Pump motor current will be changing all the time, developing a "noisy" difference between ground potentials at each end, which will appear as a noisy control signal from the perspective of the receiver. On top of that, you may have currents in the signal wires induced magnetically from proximity to the motor's spinning magnets, and electromagnetically from motor commutation and RF pickup, and electrically from any number of other sources. The longer the signal wires, the greater these problems.

Therefore, the chief concern here is to what degree these issues exist for you, and whether an opto-isolator would even help.

By sharing the same 12V source to power everything, electrical influence of the motor on the +12V and 0V lines is of concern, since this will find its way to the controller via the supply lines, regardless of whether or not you isolate. There doesn't seem to be much benefit from isolation. The main measures you take will be to do with mitigating the motor's messing with that supply, or messing with communications, and isolation isn't much help with either, except in an unexpected way that I'll describe in a moment.

A lot of this is moot if the two systems are situated right next to each other, and power cables to the motor are fat enough, but you didn't tell us anything about that.

There are advantages to using an opto-isolator, which have less to do with isolation, and more to do with signal integrity. A 5V or 0V control signal sitting on a long wire will be disrupted, and at the motor end you are likely to see a lot of noise, and levels quite different from the 5V or 0V you expected, for the reasons I explained above.

A common technique to mitigate induced noise and level issues is to employ a moderately strong current loop, perhaps 10mA, using two wires instead of a single-ended (ground-referenced) potential on a single wire. An opto-isolator, like the 4N25 is ideally suited to this arrangement, if we power its LED with that loop of current:

schematic

simulate this circuit

Here the 4N25's LED is placed within the current loop, 10mA being enough to overwhelm any magnetically induced current. To prevent small induced currents from illuminating the LED slightly, I included R4 as a "preferred" path for such current.

The 10mA wire pair, as long as they are close and parallel to each other, will pick up the same electrically induced noise, and the LED will "see" only the difference, effectively cancelling any noise. It also doesn't care what the absolute potentials are, their relationship with any ground anywhere, since it is only potential difference that matters, not any absolute potential.

There is of course electrical isolation directly between the switching element (MOSFET M1) and controller, and this does provide a great level of protection to the controller, from anything that might go wrong at the motor end. While I have perhaps insinuated that electrical isolation is of no use, that's not strictly true; it does have this benefit, also.

I haven't drawn in any capacitors you might need for the 7805 regulator. Get that information from the datasheet, and follow those instructions to the letter.

I have included supply decoupling capacitors close to the controller and the motor/MOSFET elements. The motor must have a source of energy to comply with sudden changes in current demand, changes to which the inductive supply wiring cannot immediately respond. These are C2 and C3. Do not omit them. The same goes for the controller, and any other ICs or modules at the other end. C1 decouples the controller's supply, helping to keep voltage steady there in spite of fast current transients everywhere, even inside the controller itself. The rapid switching on and off of an LED is easy to overlook, I initially did, by forgetting C4. An LED seems so harmless, but a sudden increase or decrease of only 10mA demand can seriously perturb a supply rail with no decoupling.

Lastly, do not share any length of supply-current-carrying cable between controller and motor sections. The power supply cables for the motor and its switching element (MOSFET M1 in my example) should be directly from battery (or whatever source you are using) to motor/switch. Likewise, supply cables for the controller section should be directly to the battery. There should be as little "shared length" of power supply wiring as physically possible.

\$\endgroup\$
2
  • \$\begingroup\$ Thank you so much for your detailed answer! You cleared a lot of things up for me. I was additionally considering the use of an isolated DC-DC converter instead of a regulator (for the 5V supply). Is this generally a good idea in order to prevent pump noise/spikes on the MCU power line, or am I just fixating on isolation when heavy filtering can do the trick? Any help would be appreciated, I do realize this is getting to the point where I just need to build & test the performance though. \$\endgroup\$ Commented Feb 24 at 16:05
  • 1
    \$\begingroup\$ @George I'd stick with a linear regulator, just for simplicity. If noise on the 5V line is a problem, see this answer for ways to prevent input noise getting to the 7805 output. I doubt it would be necessary, though. \$\endgroup\$ Commented Feb 24 at 16:47
3
\$\begingroup\$

You really have two concerns: inrush current and inductive kick from the pump motor. When you turn the pump on, the instantaneous current can be quite high. The voltage at the positive pump terminal can drop due to resistance and inductance on the positive supply line. Similarly, the negative terminal voltage will increase at the pump's negative terminal, so your MCU ground will be instantaneously at a lower voltage than the pump terminal. Your opto-isolator should handle this. Of course, in any case you will want separate power and ground paths to the MCU circuit and the pump/switch circuit.

The second concern is the possibility of a high-voltage spike when the loaded pump shuts off - worst case if the pump is stalled. You might attack this with a TVS diode, or some type of blocking filter on the MCU.

If you have a scope, you can measure these two issues with respect to the MCU ground, and you may find that they are not necessary.

Good luck!

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for your response! I was planning on placing a flyback diode across the pump to suppress this spike, so would the TVS diode/ filter be placed across the MCU supply as additional protection? I was additionally thinking of using an isolated DC-DC converter instead of a linear regulator for additional isolation/protection. \$\endgroup\$ Commented Feb 23 at 23:58
  • 1
    \$\begingroup\$ A flyback diode is probably better if you can place it near the pump terminals. \$\endgroup\$ Commented Feb 24 at 16:51

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.