SG90 Servo Motors Jumping

Hi information required.

I am running a model railway and I am using SG90 servos to change the points and this is all working fine. accept when I run a 12v train around the track the servos start jumping from open to closed. I know this is probably being caused by interference on the signalling channel and I have tried several methods including shielded cable but it is still happening.
The servos are independently powered using a 5v supply and controlled via a Arduino mega also on its own 5v power supply. the track is powered with 16v AC supply this is to allow for DCC control of the trains.
Does anyone have any advice that would stop the interference.

Welcome to the forum
How long are the wires from the Arduino to the servos ?

1 Like

This sounds like an EMI (ElectroMagnetic Interference) problem, these are usually very difficult to solve. Post an annotated schematic, the language of electronics, showing how you have wired it, not pictures such as frizzy (wiring) drawings they are useless for troubleshooting. Do include links to "Technical information" on the hardware parts, links to sales outlets like azon are next to useless. Doing this will have a big positive effect on your answers and will improve the accuracy of the answer a lot. Be sure to show all hardware such as resistors, capacitors, etc. Also note any wires over 10"/25cm.

Unfortunately I am not able to upload images as I am a new member not sure how to get around this.

To post images etc. you need trust level 1, you can get there by:

  • Entering at least 5 topics
  • Reading at least 30 posts
  • Spend a total of 10 minutes reading posts

Users at trust level 1 can...

  • Use all core Discourse functions; all new user restrictions are removed
  • Send PMs
  • Upload images and attachments
2 Likes

Thank you

Did the cable have 3 conductors, one each for power ground and signal?
Did you connect the shield to the mega ground and nowhere else?

@jdldigital Welcome! You'll find the forum heavily leans on the poster providing information, to help us provide you with relevant solutions.

  • a schematic(not a frizzy) - a photo of a pencil sketch on an envelope will do
  • a photo of your (presumably) test setup
    In some cases, providing code is also important, but at first glance you need to do the above first.

Are the grounds of both supplies connected together and to the mega GND?

Hi Jim-p thank you for responding
The servos have 3 conductors one each for power and one for single. I have taken a ground from the supply of the servos and put it to ground on the Arduino mega and this did not fix the issue. I am hoping to upload a diagram later to show all connections. I think I have stumbled upon the issue last night. I have disposed of the power supply for the servos and I am using the same supply as the Arduino to feed the servos and it appears to have resolved the issue but my concern is that sharing the same supply will not be enough to switch the servos when required.

That would be exactly counter to what most would advise. Keeping the servo power separate from the Arduino, but sharing a common ground, is the accepted way to go. That it doesn't work for you for some reason again indicates we need a schematic and assembly photo, to hopefully be able to tell you what you were doing wrong.

Were the grounds of the two supplies connected together and also the the Mega GND?
Was the shielded cable connectes as described in post #7

1 Like

I have tried connecting the grounds of both supplies together which are identical and taking that ground back to the Arduino this caused the servos to buzz which is not normal.

The shielded cable made no difference. I am sure it is definitely something to do with the power connections and the grounds. cannot post image from the device I am on so will move to another machine later.

Well that is the correct way to do it, so there must be something else wrong in your wiring.
A bad connection, wires too thin, wires too long ...
Maybe one of the identical supplies is bad.

Are all the power supplies connected to the same mains connection or are some connected to a different mains outlet. If different outlets, check the grounds with your DVM to be sure there is ZERO AC volts.

Hi Paul_KD7HB thanks for joining the conversation Yes both are connected to the same mains supply

Without seeing your whole circuit, have you considered using a PC ATX power supply to power up your whole layout? It may be an easier way than whatever you're doing.
Here's a video to see if maybe this would be good for you. Remember the higher the wattage PSU the better, if the price difference isn't a big concern.
According to the comments in this video (I'm not a model railroader), this power solution can be easily used on a DCC system as well with use of a step up converter.


Wiring diagram as promised

There should be a ground connection between the display and the Mega.
If it actually works without a ground connection, that would suggest that there is some unknown ground path somewhere that may be causing the problems

1 Like