False triggering on my Arduino Nano

I just realized I made an error in my drawing, The 9 volts DC input goes to VIN.

just to update you on the changes I’ve made;

  1. I am using pin 9 as an output instead of pin 1.
  2. I am now powering the relay board with its own power supply.
  3. I am now powering the nano with its own power supply.
  4. I have gone from external pull up resistors to internal pull up.
  5. I have changed my code for my outputs to the relays to read the following
  6.  digitalWrite(5, HIGH);
     pinMode(5, OUTPUT);
    

External strong pullup would be better.

In an industrial-like environment, it is necessary to apply strong filtering to the inputs. With the following circuit, we have:

  • Strong pull-down, 645 Ω
  • 14 mA of wetting current for the contact
  • 33 kΩ isolation between the input pin and the external world
  • RF bypass capacitor and debounce with a time constant > 3 ms.
  • 9 V for the contacts to minimize interference with the 5 V logic section.

NOTE: in this case, configure the pin as INPUT, not INPUT_PULLUP

2 Likes

Have your changes fixed the problem or do you still have interference from the AC?
What steps have you taken, if any, to help reduce the AC interference?