Vibration motor problem

Hello all,
I am trying to connect a vibration motor to an arduino nano 33 BLE. I am connecting the motor to D6 and GND. The arduino is powered by the usb to the laptop, which should not be a problem.
But after uploading a code, which I am also uploading here and changing digital pins the motor does not vibrate.

Code:
int motorPin = 6;

void setup()
{
pinMode(motorPin, OUTPUT );
}

void loop()
{
digitalWrite(motorPin, HIGH);
delay(1000);
digitalWrite(motorPin, LOW);
delay(1000);
}

Are you trying to drive the motor directly from the output pin?

Hi @stekinho;
What voltage and current of this motor?

RV mineirin

Yes, I don’t have any other equipment or power source

Would it surprise you to learn that a simple ERM vibra can draw two and half times the absolute maximum current you can draw from an AVR output pin?

Edit: ah, yes, there it is in black and white
'" * Power consumption: 42mA(2V), 65mA(3V), 92mA(4V)"

Edit: except, it's not an AVR, is it, and the maximum current per pin is 15mA, so that's over six times the safe current...

you connected to pin 5 judging by the photo

Yeah I saw that later, that was not the problem

Yeah it would surprise me as a matter of fact. So how should I connect it?

Why would it surprise you?
It's right there in the spec of the item you bought.

Use a transistor.


This is the circuit I built. Still does not work

Please draw your schematic

Have you checked the output pin for damage from your previous mishap?


I have tried changing pins, did not work

@stekinho, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project. See About the Installation & Troubleshooting category.

Hi @stekinho
I'm not understanding anything.

In the first image (#1) the motor is connected GND to pin D5,
but the sketch sets "int motorPin = 6;" .
Thankfully, it didn't burn pin 6.

In the next image (#12) the motor is connected to the collector of a transistor, (I can't see it well), and what I assume is the base of the transistor (I can't see it well) is connected to pin D3 (or D2. I can't. visualize well), and I don't know how it looks in the sketch.

In the next image (#13) on Fritzing the motor is connected to a transistor and the base of the transistor is connected to pin D3 , ​and I don't know how it looks in the sketch.

In the photo the motor is connected to a transistor and the base of the transistor is connected to pin D8, and I don't know how it looks in the sketch.

I recommend that @stekinho review your project and sketch.

RV mineirin