Best smallest MCU to control two unbalance motors

I have a project in mind. I want to control two unbalance motors independently of one another. The motors will be small, max 2cm. I want to attach the final thing to my wrist. Thats why the MCU should be as small as possible as well. I also need a connection to my PC with low latency. For this I will use a USB cabel. Which MCU would be the best for this project?

You will need a driver for each motor.

I forgot to mention one thing. I have same decades experience in software development, but in hardware development I'm a bloody beginner.

I assume, a driver is a board as well, right?

MCU output pins cannot directly power a motor. The driver can be a single transistor+resistor, or something more complicated, like an H-bridge for bidirectional rotation control.

Some MCU boards have motor drivers built in (Pololu has several).

For help with that aspect of the project, post a link to the motors you have selected.

Simple one-transistor motor driver (unidirectional), requires a logic level MOSFET.

dc_motor_driver

This one should do:

Are there drivers on chip/board? They would be way smaller than everything I create.

Those motors probably draw around 100 mA start current (20 mA when running), so any small NPN transistor will work.

In the following example the diode D1 is required to protect the transistor from the high voltage generated when the motor is turned off and C1 reduces the radio frequency noise generated by the motor.

I doubt you will find an MCU board with something like this built in:

NPN_motor_driver

It all depends on what you really want to do and what you have/wants to buy. If you're just using the motor as High and Low and they use low current you don't even need the driver. The driver is used for a few things, like control direction, torque/rpm and avoid to drain all current from your microcontroller using external power (you can search for H-bridge to learn more about motor drivers).
About the MCU you can use any. Your project is pretty simple and the only thing you need to care is current drain which can be solved with the driver, so any MCU can be used to your project. If you want to use your project as embedded system I would just recomend to buy a MCU with wifi/BLE integrated instead of buying modules to attach

I found some NPN transitors here:

Do all of them fit?

D1 is a diode, ok. Dig out is a pin on the MCU? R2 is a resistor with 180 - 470 ohm, I guess. The cycle in the middle is the motor? What are Q1 and C1? Its over 25 years ago I had electronics at school. :slight_smile: I already forgot these things.

I'm playing track mania with mouse (bloody beginner here as well, but its fun). Unlike other input devices the mouse doesn't go back to the center by itself. So I have to watch at the cursor all the time. The idea I got is to translate the mouse X movement to two unbalence motors. Each on one side of my wrist. The further I steer to the left the more the left one rumbles until the max steering point is reached. And other way round. If the mouse is in the center/dead zone both motors are off.

I wrote a tool in python which uses a virtual gamepad and traslates the mouse to one of its joysticks. This gamepad is used in TM for steering. Means: On the software side I already got all input I need. Now I "only" need the two motors get running.

I don't have nothing yet, but my old soldering iron. I thought, it depends to the MCU which motors I can use. So I started with this.

What is the smallest one then?

I need the lowerst possible latency. BLE I can exclude here. I don't know the latency of wifi, but I think cable has the lowest one of all options. Down side of wifi is also I needed an external power supply.

Yes.

R = resistor, C = capacitor, Q = transistor. For D1 a 1n4148 would work.

Yes, you do. Standard MCUs cannot safely power any motor from the digital output pins.

Are you looking for a MCU (and build a PCB around it) or are you looking for a small board?

Not all MCUs provide USB functionality; so that would require an additional component increasing the size. Therefore I would look at MCUs with native USB.

I'm assuming that you want a board.

Getting Started with Seeed Studio XIAO SAMD21 | Seeed Studio Wiki (note that it's a 3.3V board) or Beetle_SKU_DFR0282-DFRobot might fit the bill

Is there a reason why you want to use USB? If WiFi is an option, you can
consider an Espressif based board (ESP8266/ESP32, e.g. LOLIN D1 mini — WEMOS documentation). Again a 3.3V board.

If you don't want a board but want to design yourself, you can base your design on the processors on those boards.

Note:
There might be smaller boards, I'm do not know all of them.

Ok, maybe I confused the terms. I looking for a ready to use product in the best case. Something like the arduino boards. I want to avoid making cyrcits by myself as possible.
Before I posted here, I thought, it will be just plug in/soldering the motor's pluses and grounds on a PCB and everything else will be on the software side.

Just in that moment it comes into my mind, if I use a cable for connection to my PC, the board doesn't have to be as small as possible. A cable to my wrist is a cable to my wrist, it doesn't matter if its a USB cable or bundled pluses and grounds. The board can lay on the desk then. :thinking: But in case of wifi connection, the board should be small.

I think for a "prototype" I should start with a board which has both, USB slot and wifi. In case the wifi latency will be to high for my project, I can still use the USB slot. After I know more I can buy another board for the final result. The boards aren't expensive.

Then I believe jremington gave you the best approach in post #4:

But since the motors will be attached to your wrist, I like sterretje's idea of going wireless or even forgetting the mouse. But it's definitely a tougher project.