element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum How to configure an Arduino GPIO as an input
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 34 replies
  • Subscribers 388 subscribers
  • Views 4682 views
  • Users 0 members are here
  • arduino best practice
  • arduino circuit
Related

How to configure an Arduino GPIO as an input

colporteur
colporteur over 4 years ago

What would you recommend to reduce the spurious triggers on the input of a Nano?

 

Up to now I have been using Arduino Nano microcontrollers for animation support on a model railroad without issue. With the recent completion of the airport scene, I started to experience issues of Nano's receiving spurious triggers. At first I thought maybe I set the input resistor to high, so I reduced the value from 100K to 47K. I got some relief but it has recently raised it ugly head again. Without the resistor the triggering is unpredictable.

 

Currently there are 5 animations that have button control.

  • Aircraft landing simulation (LED)
  • Hanger building Lighting (LED)
  • Simulate arc welder at bench (LED)
  • Compound gate open/close (28BYJ-48 ULN2003 controller)
  • Hanger aircraft engine startup/shutdown (L293 brushless motor)

 

The compound gate sometimes triggers the Hanger aircraft engine animation and vise versa. The input circuit I am using for the Nano is minimal.  These two animations did share the same twisted pair from the button panel. I have separated the animations button to different pairs and I have some relief. I'm thinking maybe there is a simple way to dampen inputs so they are not as sensitive?

 

I'm hoping someone might have a suggestion/best practice recommendation for connecting inputs, that is designed to eliminate the problem.

 

image

  • Sign in to reply
  • Cancel

Top Replies

  • baldengineer
    baldengineer over 4 years ago +9
    100K and 47K are very weak pull-down (or up) resistors. If you're in a known noisy environment, you probably want something in the 1K to 4.7K range.
  • wolfgangfriedrich
    wolfgangfriedrich over 4 years ago +8
    Try a small capacitor ( 10nF ) in parallel to the resistor. This is called de-bouncing an input. Can also be done in software, there might even Arduino libraries for that. - W.
  • dougw
    dougw over 4 years ago +7
    It sounds like you are getting cross-talk as well as switch bouncing. If you put a resistor in series with the switch and a capacitor at the digital input as wolfgangfriedrich mentioned, there won't be…
Parents
  • kmikemoo
    kmikemoo over 4 years ago

    colporteur  Forgive me for being "that guy", but you mentioned relays.  You do have anti-spike diodes installed on all of the relays, don't you?

     

    For those unfamiliar with the phrase, it has a lot of names.  These are the diodes installed typically right at the relay in reverse bias between hot and ground.  When the relay is turned off and the magnetic field collapses, the diode provides a low impedance path for the inductive kick to dissipate.  Without them, the inductive spike can cause quite a bit of trouble.

     

    Troubleshooting Mantra #1:  Never overlook the easy.          It only takes one relay to drive you crazy.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • kmikemoo
    kmikemoo over 4 years ago

    colporteur  Forgive me for being "that guy", but you mentioned relays.  You do have anti-spike diodes installed on all of the relays, don't you?

     

    For those unfamiliar with the phrase, it has a lot of names.  These are the diodes installed typically right at the relay in reverse bias between hot and ground.  When the relay is turned off and the magnetic field collapses, the diode provides a low impedance path for the inductive kick to dissipate.  Without them, the inductive spike can cause quite a bit of trouble.

     

    Troubleshooting Mantra #1:  Never overlook the easy.          It only takes one relay to drive you crazy.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
Children
  • colporteur
    colporteur over 4 years ago in reply to kmikemoo

    image

     

    Your question is reasonable and the answer is yes. If the relay module, I purchased from the Asian distributor, schematic reads correct, there are back EMF diodes installed on the relay.

     

    The 5VDC button press is detected on Arduino D8 which generates a D6 LOW, among other things to trigger the relay.

     

    If the relay was a do it yourself attempt, I might not have thought of the back EMF diodes.

     

    Break...Break...

    I have a common 12VDC power supply feeding the Arduino nest. The switching power supply output has a 2amp capacity. Should I be putting a decoupling capacitor at the power input to each Arduino? I see people include it in their designs. It is not something I have done but in light of recent false triggers I'm reflecting on best practices.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • kmikemoo
    kmikemoo over 4 years ago in reply to colporteur

    colporteur  I could see where that might help, but an odd thing that playing with the non-contact voltage tester was that my wall wart power supplies for Arduino and Raspberry Pi were noisy enough to set off the detector.  I'm thinking the power input to these must be pretty noise tolerant.  It certainly can't hurt to try.  Maybe a crowbar circuit as well?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Jan Cumps
    Jan Cumps over 4 years ago in reply to colporteur

    colporteur  wrote:

     

    ...

    Break...Break...

    I have a common 12VDC power supply feeding the Arduino nest. The switching power supply output has a 2amp capacity. Should I be putting a decoupling capacitor at the power input to each Arduino? I see people include it in their designs. It is not something I have done but in light of recent false triggers I'm reflecting on best practices.

    The Nano and UNO have local buffer capacity.

     

    Nano:

    image

     

    UNO :

    image

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • colporteur
    colporteur over 4 years ago in reply to Jan Cumps

    Sweet! Thanks JC. My knowledge level stops well short of this. Great share. Now why didn't I think of looking for a schematic?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • colporteur
    colporteur over 4 years ago in reply to Jan Cumps

    In reviewing the schematic I have a question I was hoping you might be able to answer. My understanding was that D13 was connected to an internal LED. In this drawing D1 appears to be connected to an internal LED. What board does the schematic reflect?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Jan Cumps
    Jan Cumps over 4 years ago in reply to colporteur

    This is a tiny part of a UNO schematic, just to show decoupling capacitors. It's the power LED.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • colporteur
    colporteur over 4 years ago in reply to Jan Cumps

    TKS for the response. I will and did a search for schematics for Nano. After culling a considerable number I found one that gave me further insight into the current boards I am using. Much appreciate the insight.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Jan Cumps
    Jan Cumps over 4 years ago in reply to colporteur

    I posted the Nano caps too. That's the first drawing in my reply, just under the word NANO image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube