One power source to power arduino and servo

Hello, I'm fairly new with electronics and arduino's. I have a project that requires an arduino (uno), a servo and a 3-6V motor. I read that it was better if I powered the servo and/or the motor with an extra powersource but I dont want to use 3 plugs. I was wondering if it's possible to use one plug (12V or 5V) and split it to power the arduino and the little motors? and which component would I need to make this happen ?

You can power the Arduino, the servo and the motor from a single power supply as long as it can supply sufficient current, just don't power the motor and servo from the Arduino 5V pin, or any other Arduino pin for that matter

You will need to connect the GND of the Arduino, motor and servo together to give them a common point of reference

What will you be using between the Arduino and the motor to control the power to it ?

I wasn't sure yet, if possible a normal USB brick or 12V power supply like this :

Or what is the best way to do this?
btw thank you for helping!

Much better to use a 5V supply, which may be what you call a "USB brick" provided it can supply enough current, look for one that does 2.4A.

But that still doesn't tell us how you plan to CONTROL the 3-6V motor.

Steve

I think I'm going to use a 5V relay if this is what you mean, i'm sorry i am very new in the electronics/mechatronics world.

A relay will be fine if all you want to do is to turn the motor on and off and always rotate it in the same direction

yes I just need it to turn on and off nothing more, I don't need to have control over the speed or I don't need to switch rotation. Can I just strip a normal USB cable and connect 3 wires to it to connect it to the motor (relay), servo and arduino?

Yes, but don't forget about the need for a common GND connection

Is this correct?
I replaced the usb cable by a plug just for reference because i couldn’t find a cable.

No.

You need a 5 V supply to power the UNO (unfortunately poor choice, the Nano is much more appropriate as it is easier to make connections and one other reason as below) and you should just forget "Vin" or the "barrel jack" as a practical supply connection. It is too severely limited to be useful.

The 5 V supply supplies each of the four components including the UNO via the "5V" pin, but whenever you connect the UNO by USB to a PC for programming, you need first to disconnect the "5V" pin. The grounds must always be connected together. With a Nano, you would not need to disconnect the "5V" pin for programming.

1 Like

But I can load the code first by connecting the arduino to my pc. and can I do this afterwards than instead or..?

Well, you can power the Arduino via the USB jack, but if you disconnect that to program from the PC, you have disconnected the ground which is not a good idea.

The power ground should be permanently connected to the (one) "GND" pin and the 5 V supply to the "5V" pin except while you connect to the PC via USB. If your 5 V supply is switched on, you can operate it to execute your program while still connected to the PC.

so if i get it right, I have to power the arduino through the 5V pin instead of the usb and each time I want to connect the arduino to my pc I first have to disconnect the power with the 5V but keep the ground connected?

That's it! :+1:

Note - in contrast to the Fritzing diagram, it is very important to keep all the wires from one part to another, bundled together and not have any open loops in the arrangement. The exception is that with the relay you must have the control wires on the right in one bundle and the motor wires on the left in a separate bundle to maintain isolation.

is this also correct?

Well, there a few dubious things there. :grin:

You probably do not want to be powering the motor from a USB supply, though if that is a 2.1 Amp or better rated "Phone charger" it should be OK. The motor supply should be wired completely separately to the power source; a second socket on a "Phone charger" .

You show the power wires connected to the wrong two terminals on the USB adapter! :astonished: Power and ground are the outermost pins.

The contrast potentiometer on the LCD module should not be connected to the 5 V. If it is a 10k potentiometer, you should connect both ends to ground.

Apart from that, it should work. :woozy_face:

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