Noise and grounding problem

Q: Do I need to isolate the ground of the Pi from the ground of an external power supply powering multiple servos?

7777ale7777I have a Pi 3 Model B (powered by its ac adapter) sending multiple PWM control signals to up to 5 servos (SG5010). These servos draw usually 300 mA when they move and up to 1 A each when stalled so I plan to use an external power supply for them. I know that for the servos to work their power an…


If by “noise” you mean flyback you should use a zener diode on the ground from the servo(s). This is not essential with small servos, but OTOH, that doesn’t mean you are guaranteed safe without one.

The back emf should be taken care of inside the servos’ control IC (again, this is what is suposed to happen, I don’t know if some servos don’t take measurements against it). I say noise because I’ve been told that servos are usually noisy (“electricly” speaking).

So I’ve been paranoid this whole time?!?? Actually I don’t use diodes, and I prefer to power servos independently, with a common ground and I don’t have problems (at least, not that I’d attribute to ground noise). These are mostly little SG90s with very little load though (pan/scan camera etc).

Hi @7777ale7777, Welcome and nice to meet you. (1) I agree with you that the back EMF from the servos should be “absorbed” by the MCU (eg TowerPro MG99x has a 4 bit Amtel MCU) (2) Yes, you can connect servo power ground to (a) Rpi signal ground, ie, the duPont pins at the Rpi 40 pin connector, (b) Rpi power ground, ie near (before or after) the micro USB connector giving power to Rpi. (c) As further as from Rpi, eg, near the PSU supplying power to Rpi.
(3) To play very safe, you can do the following: (a) Use optical isolator to isolate Rpi signal, perhaps also at the same time shift up Rpi 3V3 GPIO signals to 5V to interface with servo. (b) Even the 4 bit Atmel MCU circuit inside the TowerPro servo takes care of the back EMF of the DC motor inside the servo, there may be still some back EMF leaking out and flying back to optical isolated cricuit to the Rpi GPIO pins driving the servo. Of course you can add a Shottky diode some where to further absorb the even tiny back EMF.
Now something IMPORTANT: for Rpi, even using with optical isolator, controlling 5V relays driving inductive loads such as DC motors and solenoids, there are beside back EMF, other stuff, like spikes, which generate EMI (Don’t ask me about EMI, which I don’t know nothing) noise which escapes through the grounding wire connecting servo and Rpi logical ground, and triggers Rpi to reset (I did experience, through very every rarely.)
The get around is TOTAL OPTICAL ISOLATION, which means not connecting servo ground to Rpi logical ground. See the following posts for details on total optical isolation using the Forbe relay as an example: (1) (2) raspberrypi.stackexchange.com/questions/98250/… raspberrypi.stackexchange.com/questions/99988/…
This is the picture showing the optical isolation for relays idea which I think also applies to servo: imgur.com/gallery/YeEa8i3. WARNING: No guarantee that no nothing won’t melt down or blow up. By the way, I learned the noise reducing trick of optical isolation from the EE guys. You might like to move this question to EE StackExchange to see what the EE guys out there think about it! 🙂
VERY IMPORTANT: (1) I strongly recommend PCA9865 PWM module: Ref: (a) Adafruit PCA9685 I2C 16-Channel 12-bit PWM/Servo Driver – US$15 adafruit.com/product/815 (b) PCA9685 16-channel, 12-bit PWM Fm+ I2C-bus LED controller datasheet – NXP 2015 nxp.com/docs/en/data-sheet/PCA9685.pdf. The reason is the following: (c) The PCA9685 allows STAGGERED Led output on and off times to MINIMUM CURRENT SURGES… (Datasheet 1. General Description, Bullet point 1) (d) Example – DELAY TIME + PWM duty cycle … (Page 17). Good luck and good health to your SG5010s. Cheers.
13 hours later…

Wed 9:11
I forgot to mention that you need to use a “floating” psu to get “genuine” total optical isolation. For example, if you use a 18650 x 3 then LM2596 regulator, then every thing connected to Rpi is floating, and you do NOT connect your device ground to any point in Rpi, which only interface with the device optically.
2 days later…
Thanks @tlfong01 for taking your time and give such a detailed answer! I’ll look into everything you said
1 hour later…

@7777ale7777 You are welcome. I have been do Micky Mouse projects in various analog signal sensing and ADC applications such ECG or GPS which requires low noise environment. This is an example of ECG app using 18650 power bank for total optical isolation of line/grid noise. I also play with HX711 ADC which is designed with line noise filtering in mind.
One more thing before I forgot, I mentioned above using 18650 with LM2596 regulator. Actually LM2596 is a switching regulator with a switching frequency of orderr of 100kHz. So that is a source of high frequency noise. A get around is to use LDO, Low Drop Out regulator, which has less noise. Cheers.
:53254566 And the following are two of my answers including pictures of how I use 18650 power bank for low noise applications:
Raspberry Pi 3B+ interface with Heart Monitor AD8232 using MCP3008 and SPI pins (with 18650 power bank picture)
(1) raspberrypi.stackexchange.com/…

(2) Rpi UART to GPS Module Connection Problem (with 18650 power bank picture)
raspberrypi.stackexchange.com/… Cheers.

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s