Arduino mega: cant activate motor from digital PINS, but it works from vcc

i have a 12v motor, which is connected to 12v power source and there is signal pin on motor (check image) wich activate the motor, and if i connect it with any of 5V pins from arduino( there are 4 of them) or the 3.3v pin the motor works - so it activate

but if i connect with any of digital pins the motor dont work
digitalWrite(PIN,HIGH)

when i measure voltage on digital pin its 4.9v but motor dont start,

ground of arduino and 12v motor is connected together

I connect arduino via usb to pc so its powered from usb

Is the voltage on the GPIO pin 4.9V with or without the motor connected?

Maybe show us your current code so we can see what you are doing and some more details of the motor? Is it Arduino compatible?

If you are using digitalWrite for simple ON/OFF switching, then you must first set the GPIO pin for output with pinMode(pin, OUTPUT). I expect that the signal pin will probably handle a PWM signal to control the motor speed, in which case, using a PWM capable pin with analogWrite(dutycycle), where dutycycle is a value between 0 to 255 might give you more control.

pin is HIGH coz i meansure with voltmeter,

i need to controll 40 DC motors( 1 at a time)

but the strange is how 3.3v pin and 5v pin in arduino mega can start the motor but digitalPIN high cant, in voltmeter i dont notice any differenve between 5v and other digital pins

I don't doubt that, but did you measure it with the motor connected or disconnected?

What motor is it please? Could we have some more detail on it please?

Also, could you please show your sketch?

its vending machine motor, sketch is simple im just testing it,


void setup() {
   pinMode(21, OUTPUT);
   digitalWrite(21, HIGH); 
}

with motor activated, i see 4.6v on 5v pin and 1.1v on digital pin,

i meansure digital pin and its 4.9v or 5v and then once i connect motor there it drops to 1.1v

Your so-called signal pin is NOT a signal pin.

Indeed and the GPIO pin is not going to supply enough current to drive it. It will require a transistor or FET, or suitable controller board. When using discrete components It will also be necessary to deal with the back EMF. A purpose made controller board should already have that designed in.

I may be wrong (and am sure someone will correct me if so) but I suspect that 'signal' pin expects 12V PWM. Further information regarding what PWM is can be found here:

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