5V External Switching power supply + USB

Hello,

I have a quick question, I have an Arduino Mega 2560 connected to a PC (to communicate via serial to a software). I use a few digital input pin to monitor Switch position (ON-OFF) and also some high power LEDs using digital output from Arduino to a Mosfet and then an external 5V Power supply to supply the servo motors with the required current.

Since I'm using an external 5V power supply for the LEDs I'm wondering if I could use the same 5V for wiring every switch that goes back to their Digital Input pin of the Arduino (I'm using pull down resistors for each digital input). Doing so would required me to connect both ground together I suppose?

The reason is to use only 1 wire from each switch that would go to the arduino. (the 5V coming from the external power supply located next to the servos).

Would it work ? I was thinking of using the maybe Pull-up resistors instead so it would avoid receiving +5V to the Input pin as the Pullup would be from the Arduino Power supply and the switch activation would ground it to the common ground.

Thanks!

A schematic is always better than a written circuit description.

If the Mega is controlling the servos and the MOSFETs, the ground of the external 5V servo and MOSFET supply must be connected to the Mega ground.

I would wire the switches to ground and use the internal pullups. That way you do not have to run 5V to the switches as well as ground.

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