Question about GND & Capacitors for multi voltage project

Hello all, Hoping that someone can help here because my internet searches on this topic have left me more confused than I was when i started.

I'm working on a project that uses the following components (not all are shown in the picture):

5V Components:
Arduino Nano
Limit Switch
Micro Servo
Photoelectric sensor
20x4 LCD Display with i2C

12V Components:
uLN2003 Stepper Motor Driver
28BYJ-48 Stepper Motor

Other Components:
5 Button Membrane Keypad
LM2596 Buck Converter (Step Down)

Power Supply:
12v 2A Wall Plug

My question is about how to wire the grounds and if ceramic capacitors are needed. When I first wired everything using the breadboard, it all was working fine. Then I went to assemble the permanent version soldering to a prototype board and whenever the limit switch was activated, it reset the arduino. This was not the intended function. When trying to understand what went wrong, the likely culprit was either a ground loop or noise in the wiring since all of the wires were close together and overlapping in a small design. I will eventually share the details of the entire project and hopefully be able to share a final build soon for others who might be interested in building it.

Anyway, back on topic, my understanding was that it is best practice for all of the components to share the a common ground regardless of some being 5v and some being 12v. My question is how to properly connect the grounds? Do i use the OUT ground from the buck converter to connect to the Arduino GND and then all component GNDs to the arduino GND? (like in the picture above? )

Or

Do I connect all the component GNDs, including the Arduino GND to the breadboard GND rail? And if this is the correct way, do I use the GND coming out of the 5v end of the buck converter? Or do I use the ground directly from the 12V wall plug?

Or

Are neither of those options correct and there is another way it is supposed to be wired?

Second question is... Where (if anywhere) do I need to use 100nf ceramic capacitors?

Thank you in advance to anyone who offers assistance. :slight_smile:

Once I get this part sorted out, i will post the fritzing diagram for the entire build.

Here is the entire project (Minus the ground connections for all of the components) in case this helps.

The Vin pin in your Arduino feeds a voltage regulator. It expects 7-12V. Configure you LM2596 to deliver 7V.

If you need 5V for other components you can feed the Vin directly with 12V and use the
LM2596 to supply 5V.

Or you can use the 5V pin on the Arduino to feed other low-current stuff. Do not use this pin for motors or coils.

That shouldn't happen unless your switch is mis-wired and "shorting out" the power, or it's "shorting" a pin programmed as an output. Nothing "weird" should happen to an input pin unless you connect it to something higher than 5V, or to a negative voltage.

Grounding usually isn't that critical in digital circuits. All of the grounds should be (somehow) connected together, unless you are using optical isolation (or some other isolation technique).

Ceramic "bypass connectors" should be connected physically close to the chip's power & ground leads, with short connections.

Anyway, back on topic, my understanding was that it is best practice for all of the components to share the a common ground regardless of some being 5v and some being 12v. My question is how to properly connect the grounds? Do i use the OUT ground from the buck converter to connect to the Arduino GND and then all component GNDs to the arduino GND? (like in the picture above? )
[/quote]

Please use a protoboard and soldering, not breadboards whenever motors and such currents are around.

@mancera1979 How does this look? Now the Arduino is being fed 7v and i am using the Arduino 5V out to power all the 5v components. Will the Arduino 5v Out be able to handle all of that? The only components that would actually be drawing power from the 5v is the LCD and servo motor. The limit switch and photoelectric sensor is just using the 5v for logic. I know you said not to use the 5v for motors but I am not sure how else to power that servo. If I understood you correct, I really need 3 different voltages (12v, 7v, and 5v). If i cant power the servo off of the Arduino 5v Out then do I need to add another buck converter to also convert 12v in to 5v just for the servo?

You can apply safely the 12V directly to the Arduino Vin.

https://docs.arduino.cc/hardware/nano

This may create some heat in the Arduino board builtin regulator, but it should not be a problem.

The Arduino 5V output is ok for the LCD. Then use the buck converter 5V to feed the motors.

yes, I will definitely be using the protoboard. I just used the breadboard in the diagram for easier visability.

Good! That will be much more reliable and durable, provided the soldering is done properly.

Shoe Dealer Wiring Diagram_bb.pdf (1.0 MB)

@mancera1979 How does this look? One more thing I noticed is that the 12v power supply is putting out slightly over 12v. (12.53). Any concern there?

@Railroader aside from the breadboard, i'd appreciate your feedback also if you wouldn't mind giving the overall wiring a lookover :slight_smile:

The voltage regulator in the Arduino Nano is a µA78M05 by Texas Instruments that can handle comfortably that voltage. Some clones (like mine :crazy_face:) carry an AMS1117, which will not have a problem either.

More of a concern may be electrical noise coming from the motors. If required, you may try adding a 1µF-10µF capacitor next to the Vin connection.

Fritzing pictures calls for lots of work to use. I would happily take on a properly made schematics but not this "bird nest". Too little time available.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.