# Problem using code to activate reset pin on Mega

**URL:** <https://forum.arduino.cc/t/problem-using-code-to-activate-reset-pin-on-mega/1410362>\
**Category:** Programming\
**Created:** [October 23, 2025, 2:11pm UTC](https://forum.arduino.cc/t/problem-using-code-to-activate-reset-pin-on-mega/1410362 "2025-10-23T14:11:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![romeopacifica2021](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/romeopacifica2021/32/1126393_2.png) [@romeopacifica2021](https://forum.arduino.cc/u/romeopacifica2021)\
**Post date:** [October 23, 2025, 2:11pm UTC](https://forum.arduino.cc/t/problem-using-code-to-activate-reset-pin-on-mega/1410362/1 "2025-10-23T14:11:39Z")

</div>

/\*  
Expecting digitalWrite(armButtonRstPin, LOW); to send 0v to reset pin on uno. Not sure why I'm getting 5v reading on digitalRead(armButtonRstPin)

Thank You`Use code tags to format code for the forum`  
\*/

int armLedPin = 6;  
int armButton = 22;  
int armButtonRstPin = 24;

void setup() {  
pinMode(armButton, INPUT\_PULLUP);  
pinMode(armLedPin, OUTPUT);  
pinMode(armButtonRstPin, INPUT\_PULLUP);  
}  
/\* armButton is set floating/pulled high.  
The default state of the Arduino Uno reset pin is high-impedance (floating), but it is actively held high by an internal pull-up resistor to a default stable state. When the reset button is pressed, or when the pin is pulled low by an external circuit, it triggers a reset by sending a LOW signal to the microcontroller.  
\*/  
void loop() {  
Serial.begin(9600);  
if (digitalRead(armButton) == LOW){  
digitalWrite(armButtonRstPin, LOW);  
digitalWrite(armLedPin, HIGH);  
Serial.println(digitalRead(armButton)); // Serial.print = 0  
Serial.println(digitalRead(armLedPin)); // Serial.print = 1  
Serial.println(digitalRead(armButtonRstPin)); // Serial.print = 1  
delay(1000);  
}

}

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [October 23, 2025, 2:29pm UTC](https://forum.arduino.cc/t/problem-using-code-to-activate-reset-pin-on-mega/1410362/2 "2025-10-23T14:29:05Z")

</div>

The Uno does not have a pin 22 or 24.  
What are you trying to do?

---

<div class="post-metadata">

**Author:** ![MaximoEsfuerzo](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/maximoesfuerzo/32/923798_2.png) [@MaximoEsfuerzo](https://forum.arduino.cc/u/MaximoEsfuerzo)\
**Post date:** [October 23, 2025, 2:31pm UTC](https://forum.arduino.cc/t/problem-using-code-to-activate-reset-pin-on-mega/1410362/3 "2025-10-23T14:31:57Z")

</div>

In addition to what @jim-p rightly clarifies to you, remember that the pin armButtonRstPin is defined as INPUT\_PULLUP (and that's fine for what you want to do), but you must change it to OUTPUT to do the reset.

```arduino
if (digitalRead(armButton) == LOW){
  digitalWrite(armButtonRstPin, LOW);
  pinMode(armButtonRstPin,OUTPUT);

```

Keep in mind that whatever you do after this will not be executed because the micro restarts.

---

<div class="post-metadata">

**Author:** ![romeopacifica2021](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/romeopacifica2021/32/1126393_2.png) [@romeopacifica2021](https://forum.arduino.cc/u/romeopacifica2021)\
**Post date:** [October 23, 2025, 2:52pm UTC](https://forum.arduino.cc/t/problem-using-code-to-activate-reset-pin-on-mega/1410362/4 "2025-10-23T14:52:07Z")

</div>

Sorry, I'm using a Mega.  
I'm wanting to reset the Mega board by pushing the armButton. When pushing the armButton, expecting 0 volts to be sent to the Reset pin, resetting the Mega board. This is exert code (for testing) a single axis plasma cutter I'm building. My thought was to push the armButton which would in turn send a ground to the reset pin on the Mega, resetting it.  
Thanks

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [October 23, 2025, 2:56pm UTC](https://forum.arduino.cc/t/problem-using-code-to-activate-reset-pin-on-mega/1410362/5 "2025-10-23T14:56:16Z")

</div>

Then just connect the button to the RESET pin, no code necessary

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/7/f/b/7fbed7debe82d90a33ec812ce6523ff637560658.png)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [April 21, 2026, 2:56pm UTC](https://forum.arduino.cc/t/problem-using-code-to-activate-reset-pin-on-mega/1410362/6 "2026-04-21T14:56:41Z")

</div>

Closed on April 21, 2026, 2:56pm UTC

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