# False triggering on my Arduino Nano

**URL:** <https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704>\
**Category:** General Guidance\
**Created:** [August 11, 2025, 4:33pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704 "2025-08-11T16:33:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmcappy53](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gmcappy53/32/1133213_2.png) [@gmcappy53](https://forum.arduino.cc/u/gmcappy53)\
**Post date:** [August 11, 2025, 4:33pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/1 "2025-08-11T16:33:22Z")

</div>

I need a little help with my Arduino project, I'm not brand new to Arduino however I have a lot to learn about it.

I'm using and Arduino nano, I have a start button and three limit switches as inputs.

I also have eight relays which I am controlling with those inputs and code-based timers.

In a simulator the project works flawlessly, on my breadboard it works flawlessly, but when I install it into the project it falls triggers and works very erratically. Something else I need to add to this, I also have two AC motors that are being controlled with relays which are controlled by this Arduino Nano.

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [August 11, 2025, 4:36pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/2 "2025-08-11T16:36:46Z")

</div>

- Welcome to the mix.

- **Always** show us a good schematic of your proposed circuit.  
Show us good images of **your** ‘actual’ wiring.

- In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the **complete sketch**.

- Use the **\< CODE / \>** icon from the ‘posting menu’ to attach the copied sketch.

---

<div class="post-metadata">

**Author:** ![oldcurmudgeon](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/oldcurmudgeon/32/1280882_2.png) [@oldcurmudgeon](https://forum.arduino.cc/u/oldcurmudgeon)\
**Post date:** [August 11, 2025, 4:48pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/3 "2025-08-11T16:48:23Z")

</div>

Reality is more brutal than a simulator. Switch bounce, EMI, inadequate power supply, real power dissipation, etc are possibilities.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [August 11, 2025, 5:05pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/4 "2025-08-11T17:05:59Z")

</div>

Try changing the REAL AC motors for either nothing or light bulbs. I am wondering if the AC motors are creating noise, so temporarily eliminate them.

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [August 11, 2025, 5:06pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/5 "2025-08-11T17:06:40Z")

</div>

> [@gmcappy53](#):
>
> it falls triggers and works very erratically.

Sounds like a power supply problem. Please post a wiring diagram with all pins, parts and connections clearly labeled (hand drawn is fine). Household AC wiring MUST be well separated from the Arduino.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [August 11, 2025, 6:40pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/6 "2025-08-11T18:40:11Z")

</div>

> [@gmcappy53](#):
>
> I'm using and Arduino nano

Which of the 20+ models of Nano do you mean?

---

<div class="post-metadata">

**Author:** ![gmcappy53](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gmcappy53/32/1133213_2.png) [@gmcappy53](https://forum.arduino.cc/u/gmcappy53)\
**Post date:** [August 12, 2025, 12:05pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/7 "2025-08-12T12:05:50Z")

</div>

here’s a copy of my sketch, not sure if I properly formatted it or not, however here it is I hope this works,

```arduino
// C++ code
//
int buttonstat = 0;

int debounce = 0;

int button_debounce = 0;

void setup()
{
  pinMode(5, OUTPUT);
  pinMode(10, INPUT);
  pinMode(7, OUTPUT);
  pinMode(1, OUTPUT);
  pinMode(11, INPUT);
  pinMode(6, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(12, INPUT);
  pinMode(8, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(13, INPUT);
  pinMode(4, OUTPUT);

  digitalWrite(5, HIGH);
  // BLOCKS LS. 3
}

void loop()
{
  // START BUTTON
  buttonstat = digitalRead(10);
  if (buttonstat == LOW) {
    digitalWrite(7, HIGH);
    // BLOCKS START BUTTON
    digitalWrite(1, HIGH);
    // CLAMP CLOSING
  }
  // LS.1, CLAMP CLOSED
  buttonstat = digitalRead(11);
  if (buttonstat == LOW) {
    digitalWrite(6, HIGH);
    // BLOCKS LS.1
    digitalWrite(1, LOW);
    // CUTS POWER TO CLAMP
    delay(1000); // Wait for 1000 millisecond(s)
    digitalWrite(2, HIGH);
    // POWERS MOTORS
    delay(6000); // Wait for 6000 millisecond(s)
    // LS. 3 IS NO LONGER BLOCKED
    digitalWrite(5, LOW);
  }
  // LS. 2, MOTORS FORWARD
  buttonstat = digitalRead(12);
  if (buttonstat == LOW) {
    digitalWrite(8, HIGH);
    // BLOCKS LS. 2
    digitalWrite(2, LOW);
    // TURNS OFF MOTORS
    delay(2000); // Wait for 2000 millisecond(s)
    digitalWrite(3, HIGH);
    // PUTS MOTORS IN REVERSE READINESS
    delay(1000); // Wait for 1000 millisecond(s)
    digitalWrite(2, HIGH);
    // STARTS MOTORS IN REVERSE
    delay(3000); // Wait for 3000 millisecond(s)
    digitalWrite(8, LOW);
    // LS.2 IS NO LONGER BLOCKED
  }
  // LS. 3
  buttonstat = digitalRead(13);
  if (buttonstat == LOW) {
    digitalWrite(5, HIGH);
    // BLOCKS LS. 3
    digitalWrite(2, LOW);
    // CUTS POWER TO MOTORS
    delay(1000); // Wait for 1000 millisecond(s)
    digitalWrite(3, LOW);
    // PUTS MOTORS IN FORWARD READINESS
    delay(1000); // Wait for 1000 millisecond(s)
    digitalWrite(4, HIGH);
    digitalWrite(1, HIGH);
    // STARTS CLAMP OPEN
    delay(15000); // Wait for 15000 millisecond(s)
    digitalWrite(6, LOW);
    // LS.1 IS NO LONGER BLOCKED
    digitalWrite(4, LOW);
    digitalWrite(1, LOW);
    digitalWrite(7, LOW);
  }
}

```

---

<div class="post-metadata">

**Author:** ![gmcappy53](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gmcappy53/32/1133213_2.png) [@gmcappy53](https://forum.arduino.cc/u/gmcappy53)\
**Post date:** [August 12, 2025, 12:11pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/8 "2025-08-12T12:11:11Z")

</div>

I actually did turn off the motors completely, I felt just seeing their relays pull in was sufficient,

yet the same problem occurred.

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [August 12, 2025, 12:19pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/9 "2025-08-12T12:19:19Z")

</div>

- We need to see your proposed schematic.

- The 1st thing to try is turning on the internal pull-up resistors.  
Example:  
`pinMode(10, INPUT_PULLUP);` **etc**.

- Wire inputs as **S3** is wired in the circuit below.

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/1/d/4/1d4074adaf408f4edb995c28cc604c09a6e0d19b.jpeg)

---

<div class="post-metadata">

**Author:** ![gmcappy53](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gmcappy53/32/1133213_2.png) [@gmcappy53](https://forum.arduino.cc/u/gmcappy53)\
**Post date:** [August 12, 2025, 12:28pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/10 "2025-08-12T12:28:30Z")

</div>

Here is the link to the board I’m using,

[https://www.amazon.com/LAFVIN-Board-ATmega328P-Micro-Controller-Arduino/dp/B07G99NNXL/ref=sr\_1\_1?crid=3QASVUFCWDRX8&dib=eyJ2IjoiMSJ9.6QPRL9EGieCqVheJYNSvYCP4nyMaBegrye565UbAFrxT4Lr2OZGdSH0sWidY9rgKtmXS93\_wPipsnYrN3K1TVcA8KdQKqKIc9EUYc12MkNr-iFpZtZO5lPyaBiWG071RFPNxFpR4z4bQwMYdVbUpFxcehk7r0P39xOwH5sdpcaURs3usTuc4kOVHj2qy7IPSpTWmp3ojPmwYj8X9Q8RVDrHBxSTdiBOLH3UJ-OMto5c.qClZ\_O9UNGzSqr2qUyqTwk-TPR80x7dQQ5yyrn-dxeQ&dib\_tag=se&keywords=arduino+nano&qid=1755001347&sprefix=arduino+nano%2Caps%2C250&sr=8-1](https://www.amazon.com/LAFVIN-Board-ATmega328P-Micro-Controller-Arduino/dp/B07G99NNXL/ref=sr_1_1?crid=3QASVUFCWDRX8&dib=eyJ2IjoiMSJ9.6QPRL9EGieCqVheJYNSvYCP4nyMaBegrye565UbAFrxT4Lr2OZGdSH0sWidY9rgKtmXS93_wPipsnYrN3K1TVcA8KdQKqKIc9EUYc12MkNr-iFpZtZO5lPyaBiWG071RFPNxFpR4z4bQwMYdVbUpFxcehk7r0P39xOwH5sdpcaURs3usTuc4kOVHj2qy7IPSpTWmp3ojPmwYj8X9Q8RVDrHBxSTdiBOLH3UJ-OMto5c.qClZ_O9UNGzSqr2qUyqTwk-TPR80x7dQQ5yyrn-dxeQ&dib_tag=se&keywords=arduino+nano&qid=1755001347&sprefix=arduino+nano%252Caps%252C250&sr=8-1)

and here is the link for the expansion board I’m using,[https://www.amazon.com/HiLetgo-Controller-Expansion-Extension-ATMEGA328P/dp/B073JGV87F/ref=pd\_ci\_mcx\_di\_int\_sccai\_cn\_d\_sccl\_1\_2/135-4773275-4952752?pd\_rd\_w=NNV0Q&content-id=amzn1.sym.751acc83-5c05-42d0-a15e-303622651e1e&pf\_rd\_p=751acc83-5c05-42d0-a15e-303622651e1e&pf\_rd\_r=NB0EHHF25JK6NM2J7TZC&pd\_rd\_wg=LSHlR&pd\_rd\_r=3f82fbd7-e6aa-4cda-a6aa-c8b0cfb624b1&pd\_rd\_i=B073JGV87F&psc=1](https://www.amazon.com/HiLetgo-Controller-Expansion-Extension-ATMEGA328P/dp/B073JGV87F/ref=pd_ci_mcx_di_int_sccai_cn_d_sccl_1_2/135-4773275-4952752?pd_rd_w=NNV0Q&content-id=amzn1.sym.751acc83-5c05-42d0-a15e-303622651e1e&pf_rd_p=751acc83-5c05-42d0-a15e-303622651e1e&pf_rd_r=NB0EHHF25JK6NM2J7TZC&pd_rd_wg=LSHlR&pd_rd_r=3f82fbd7-e6aa-4cda-a6aa-c8b0cfb624b1&pd_rd_i=B073JGV87F&psc=1)

---

<div class="post-metadata">

**Author:** ![gmcappy53](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gmcappy53/32/1133213_2.png) [@gmcappy53](https://forum.arduino.cc/u/gmcappy53)\
**Post date:** [August 12, 2025, 12:36pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/11 "2025-08-12T12:36:39Z")

</div>

Here is a wiring diagram, and I will also post a schematic.

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/4/8/0/480eb9b390151ca01313944834b76a207c008943.png)

---

<div class="post-metadata">

**Author:** ![gmcappy53](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gmcappy53/32/1133213_2.png) [@gmcappy53](https://forum.arduino.cc/u/gmcappy53)\
**Post date:** [August 12, 2025, 12:40pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/12 "2025-08-12T12:40:23Z")

</div>

![image](https://europe1.discourse-cdn.com/arduino/original/4X/1/0/1/10167a5eb3e8d781b7d40690d66065fb3942519f.png)

---

<div class="post-metadata">

**Author:** ![gmcappy53](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gmcappy53/32/1133213_2.png) [@gmcappy53](https://forum.arduino.cc/u/gmcappy53)\
**Post date:** [August 12, 2025, 12:46pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/13 "2025-08-12T12:46:53Z")

</div>

The following is the link for the relay board that I’m using,

> **[Amazon.com: AEDIKO 8 Channel Relay Module DC 5V Relay Board with OPTO-Isolated...](https://www.amazon.com/AEDIKO-8-Channel-Relay-Module/dp/B0B9X675NQ)**
>
> Buy AEDIKO 8 Channel Relay Module DC 5V Relay Board with OPTO-Isolated Support High or Low Level Trigger: Relay Control Module - Amazon.com ✓ FREE DELIVERY possible on eligible purchases

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [August 12, 2025, 1:22pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/14 "2025-08-12T13:22:18Z")

</div>

Hi, @gmcappy53  
Welcome to the forum.

Do you have a DMM? Digital MultiMeter?

Tom.... 😃 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![gmcappy53](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gmcappy53/32/1133213_2.png) [@gmcappy53](https://forum.arduino.cc/u/gmcappy53)\
**Post date:** [August 12, 2025, 1:28pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/15 "2025-08-12T13:28:23Z")

</div>

yes i do have DMM

---

<div class="post-metadata">

**Author:** ![kmin](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kmin/32/1147370_2.png) [@kmin](https://forum.arduino.cc/u/kmin)\
**Post date:** [August 12, 2025, 2:06pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/16 "2025-08-12T14:06:08Z")

</div>

> [@gmcappy53](#):
>
> I felt just seeing their relays pull in was sufficient,

So none of the relays are driving any load at the moment? What is clamp?  
How is the relay board powered?  
How long is your switch wiring? Are they running together with power wires?  
What is the exact misbehavior?

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [August 12, 2025, 2:35pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/17 "2025-08-12T14:35:27Z")

</div>

The wiring diagrams make no sense.

Please post an **accurate, hand drawn** wiring diagram with all parts clearly labeled, together with their actual values. Also post a picture of your setup.

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [August 12, 2025, 2:39pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/18 "2025-08-12T14:39:24Z")

</div>

- We need to see a schematic that fully and correctly represents your hardware, place holders are not sufficient.  
We need to see how your relay module is wired.

> [@gmcappy53](#):
>
> `pinMode(1, OUTPUT);`

- Pin 1 is the NANO’s TX communications pin, avoid using.  
You can use pin A0 (D14) as a digital output.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [August 12, 2025, 2:54pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/19 "2025-08-12T14:54:22Z")

</div>

Unless only one of the leds will ever be lit at the same time, you need one resistor per led.

You don't need the resistors or the connections to 5V for the buttons. Just have them connect the Arduino pins to ground and use INPUT\_PULLUP mode. The buttons will read LOW when pressed. Use 2 diagonally opposite pins of each button and leave the other 2 pins disconnected.

I don't see any relays in your schematic.

Do not use pin 1 on your Nano. Pins 0 and 1 are not available for beginners to use on any Arduino based on ATmega328 chip, which are the most common type.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [August 12, 2025, 2:58pm UTC](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704/20 "2025-08-12T14:58:06Z")

</div>

> [@gmcappy53](#):
>
> I will also post a schematic

It is really bad. Maze puzzles can be fun, but your schematic should not look like one. A schematic is supposed to look simple and easy to understand. The opposite of a maze puzzle.

[Next page](https://forum.arduino.cc/t/false-triggering-on-my-arduino-nano/1401704.md?page=2)
