Controlling a motor with an Arduino

Sorry for the simple question here... I'm still new to this world. I would like to control a motor through an Arduino. I am trying to understand when I need to use an external power source and when I can just use the 5v supplied by the Arduino. I'm assuming that if I have multiple components connected to the Arduino and they exceed the 40mA rating and are all running at the same time I can burn something up if I'm not using external power. I was also looking to connect the Arduino to my garage door opener so that I could open and close it through a sketch remotely. Would I need some type of transistor or relay because connecting up the Arduino directly to the push button curcuit from the garage door opener would be too much for it? I'm starting to really confuse myself and just need some direction. I am constantly on Youtube watching videos which have helped but I need more. Any direction would be greatly appreciated.
Thanks a lot!!

Simple answer - don't power ANY motor from an Arduino board.

The Arduino I/O pins are meant for digital signals not power. Work on the assumption that they can only source or sink 20mA. The 40mA is the absolute max figure.

Drawing power from the Arduino 5v pin for a motor (including a servo) usually overloads the Arduino causing it to reset and do all sorts of strange things that look like software problems but are not.

Servos contain their own control hardware so the signal wire can be directly connected to an Arduino I/O pin.

All other motors need some sort of motor driver that takes signals from the Arduino to control the separate motor power supply. The Arduino motor shields are one way of doing this. Or Google for Arduino motor driver.

Stepper motors and brushless motors each need their own specialised drivers.

...R

Are you saying I shouldn't even use a transistor or relay to power a motor on an arduino board? I Guess I'm a little confused because I see a lot of projects where people are connecting motors to arduino boards without a motor shield.

You can use several methods to control the speed and direction of a dc motor with an Arduino. You can use transistors, relays, or my preferred method, an h-bridge. The main thing to remember is the Arduino is used to CONTROL a motor not to power it. Transistors and relays can usually be purchased locally while h-bridges (for speed control) or dual h-bridges (speed AND direction control) might have to be purchased online. Good luck!

Tetris911 can I plug multiple servos into my arduino but power them externally with batteries? I see people using the "vin" pin for external power. Not sure how to hook it up using that pin. If I use external power I'm assuming it's ok to not use transistors, h-bridges, or relays?

welchsc:
Tetris911 can I plug multiple servos into my arduino but power them externally with batteries? I see people using the "vin" pin for external power. Not sure how to hook it up using that pin. If I use external power I'm assuming it's ok to not use transistors, h-bridges, or relays?

Re-read Reply #1. Do not draw power from the Arduino for any servo (or other motor) regardless of what you see elsewhere.

The servo signal wire should be connected to an Arduino I/O pin - the pin that you select with servo.attach().
The servo GND wire should be connected to the Arduino GND

The servo Power and GND wires should be connected to the servo power supply (perhaps 4 x AA batteries).

You don't need ant transistors, relays or h-bridges with a servo because all the necessary electronics are inside the servo.

You would need to use a transistor or h-bridge if you want the Arduino to control a motor or an electro-mechanical relay. Some solid state relays can be controlled directly from the Arduino.

...R