Digital pins not working

Hello,

I'm new to Arduino and I was trying out my new board (Rev2 WiFi) but I have discovered I am unable to make use of the digital pins for some reason.

I have tried the example Blink from the IDE and it works just fine, but when I try to use an external pin it doesn't work.

I've tried lighting an external LED and can't do it, nor I can activate a simple DC motor that I have. The weird thing is that if I connect the motor directly to the 5V output and GND of the board, it works perfectly; it's only when I try to use the pins that it doesn't work

Here's a simple code sample I used to test the motor:

Ground was directly connected to GND directly and the other side was connected to a pin (I tried different pins to no effect):

const int in1 = 6;

void setup() {
  // put your setup code here, to run once:
  pinMode(in1, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(in1, HIGH);
}


Edit: uploaded circuit schematic

Before asking questions, please read the posting rules.

Always show us a good schematic of your proposed circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.

That's wierd...

I tried to move the topic to a more suitable section and saw:

I apologize,

I have already edited the post with the wiring for that specific code, do note I have tried the same on several different pins

image

Arduino output pins cannot drive a motor directly.

Use a transistor driver between the motor and the Arduino output pin.

For example, circuit C1 .

I have also tried using a L298N motor controller with this code:

const int enA = 10;
const int in1 = 9;
const int in2 = 8;


void setup() {
  // put your setup code here, to run once:
  pinMode(enA, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(in1, HIGH);
  digitalWrite(in2, HIGH);
  analogWrite(enA,255);

}

And this circuit:

Hello alonsez

Keep it simple and stupid.
Run some tutorials for the hardware selected.
If you are happy with the results of the tutorials you can merge these to your project.

Have a nice day and enjoy coding in C++.

The Arduino 5v pin cannot be used to power motors.

Use your UNO.


Use this connection. (9 to 12v)

:woozy_face:

The motor is less than 5V so why does that not work?

I do not have a power source like that at hand but I will try that as soon as I can get one, I appreciate the help and apologize for my lack of knowledge, it's really my first time using an Arduino board :slight_smile:

Again, thank you!

The 5v pin can only power small loads and NEVER inductive loads like motors !

What is the resistance of your motor ?

A 6 cell AA battery pack gives 9v.

You will probably have 2v across the 298N leaving 7v on the motor; probably can be handled by your 5v motor.


In the passed, I have used a battery pack of (4 AA cells) 6v that worked with the 298N and a 5v motor.

No, don’t apologize !

1 Like

Because the current is excessive, not anything to do with the voltage.

It's a 3V motor with 590ma current so if I'm not mistaken it should be around 5Ω.

Due to the nature of my project I wanted to power the Arduino board from a socket directly and then power 2 of the 298N, but seeing what you explained I understand that could be not possible

Hi, @alonsez

Lets get back to basics, have you been able to get the LED to glow?
If not can you please post your circuit and/or a picture of your connections?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

Oh! Yes, sorry it seems that specific LED I was using was faulty and didn't work, it was not an issue with the pins. I got so focused on the motor part that I forgot to mention that.

Thank you :slight_smile:

Hi,
Do you have a DMM?

Tom.. :smiley: :+1: :coffee: :australia:

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