Arduino UNO pin 2

Hello there, I currently bought my very own arduino uno board and it was working well until i noticed that the pin 2 is not working.
i connected a motor driver l298n in it but the motor driver would not turn on until i change the pin and code. is it a hardware issue? or is it normal in all arduino boards?

Not normal. Show code, to be sure you've got it right. Use code tags, please!

2 Likes

Write a simple piece of code like this:

void setup() {
  pinMode(2, OUTPUT);    // sets the digital pin 2 as output
}

void loop() {
  digitalWrite(2, HIGH); // sets the digital pin 2 on
  delay(1000);            // waits for a second
  digitalWrite(2, LOW);  // sets the digital pin 2 off
  delay(1000);            // waits for a second
}

Does pin 2 toggle high/low at 1 second intervals? No it is not normal but less a schematic of exactly what you have and knowing your code this is as good as it gets. Use a DMM to monitor pin 2 or just hang a LED with suitable current limiting resistor on pin 2.

Ron

1 Like

I moved your topic to an appropriate forum category @mr_minecraft.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Was PIN2 connected to ENA (or ENB) to be used for PWM?

@Ron_Blain I user the same code to switch on and off the motor driver repeatedly. But a strange problem occured after a while. I cleaned the code from the arduino and inserted a copper wire in pin 2 and in the GND pin. I kept the wires in my tounge and i felt electricity passing. I repeated it with other pins and i l could not feel elrctricity. Also i am beginner :sweat_smile::sweat_smile:

Remove copper wire. It makes short circuit and will damage pin 2.

@Railroader Ok. But why does the pin 2 gives off electricity as i mentioned above?

@Railroader does the pin 2 always emit electricity? Is it normal to occur?

@camsysca There is no code.

Having read this thread, I can answer your other question accurately:

It is clear to me that you have damaged your arduino and this is why it is overheating. You cannot request a refund or replacement.

1 Like

Why try to do anything without code? Put code into the controller.

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