Motors are everywhere! From robots to remote-controlled cars, any DIY hobbyist will very quickly find themselves trying to control a motor with a microcontroller. Luckily, simple control of a brushed DC motor is easy, and only requires a few components. Have you ever tried spinning a motor with the contacts connected together? Or seen sparks as you connect and disconnect your motor? What consequences do those things have on how you control the motor and protect your other circuitry? There are instructions out there that allow you to build a complicated motor controller that might work, however in this video tutorial we take a step back and go over some of the very basic things you need to think about when using motors, because so much is dependent on understanding the details of your specific situation. From stall current, to back-EMF, we present 9 small experiments you should try to get a better sense of how the motor is going to behave in your circuit. The tutorial also goes over how to connect a simple motor to a microcontroller, and turn it on and off using a 2N7000 n-channel MOSFET and a few other parts. The topic of power electronics goes much, much deeper. Often times, it is necessary to consider power dissipation, switching frequencies, gate capacitance, and when trying to drive a motor in both directions, an H-bridge is required. However, we have to start somewhere, and there is nowhere better to start than with experimentation!
Using motors with microcontrollers - [Link]