element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
Arduino
  • Products
  • More
Arduino
Arduino Forum How to configure an Arduino GPIO as an input
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Arduino requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 34 replies
  • Subscribers 101 subscribers
  • Views 648 views
  • Users 0 members are here
  • arduino best practice
  • arduino circuit
Related

How to configure an Arduino GPIO as an input

colporteur
colporteur over 1 year 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.

 

  • Reply
  • Cancel
  • Cancel

Top Replies

  • baldengineer
    baldengineer over 1 year 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 1 year 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 1 year 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
  • phoenixcomm
    phoenixcomm over 1 year ago

    colporteur  Can youi feel the amount of pain that I AM IN???  please don't use any silly software, don't use waits. please see my blog NexGen: Fuel Load Indicator: Aftermath!  This shows you how to debounce your switches in hardware.  so how many switches are you going to look at?? after the Schmitt Trigger with its rc network its output should just go the  Arduino's GPIO pin. but wait also attached is a input to N-wat Or gate the output goes to your interrupt line.  This works very well for a rotory swich as well but the switch goes into a 7 to BCD priority encoder. the outputs go the the gpios and the encoders active line goes to the interupt line.

    at this point all you have to do is to read the 3 bits to determin witch switch. (also explanded in the Blog.)

    ~~

    happy laddings..LOL

    Cris

    • Cancel
    • Up +3 Down
    • Reply
    • Cancel
  • colporteur
    colporteur over 1 year ago in reply to phoenixcomm

    Much appreciate the input CH. I like the Schmitt trigger circuit. {Crap more stuff to add.}

     

    The jury is still out on my direction. A Nano circuit that has been in for months with no issue false triggered the other day. No one was near it and best I can tell nothing switched on or off in the environment. This Nano circuit is constructed the same as all the other. I had never gotten a false trigger on it but then it happened.

     

    I would not expected this issue being that I have deployed physical pull-down resistors. I need to find the source that is causing the triggers. Damn... I could really use the scope I donated to the Collage about now.

    • Cancel
    • Up +2 Down
    • Reply
    • Cancel
  • phoenixcomm
    phoenixcomm over 1 year ago in reply to colporteur

    colporteur  Sean,  {Crap more stuff to add.} Duh, for 6 switches its only 6 more resistors, 6 more caps, and one Hex Schmitt Trigger. and that's only 12 more parts + the IC plus you will need the pull-up resistor anyway. You can get a small PCB made for a few bucks. and stuff it yourself. Basically with ANY SWITCH PUSHBUTTON or ROTARY, or THUMBWHEEL SWITCHES WILL ALWAYS GIVE YOU A BOUNCE OR TWO!!! get over it. its life.  If you assume you are not going to get a bounce you most likely will. So err on the side of caution and always debounce them FIRST!

    ~~

    Cris

     

    Sorry for the CAPS but I needed to get your attention.

    • Cancel
    • Up +1 Down
    • Reply
    • Cancel
Reply
  • phoenixcomm
    phoenixcomm over 1 year ago in reply to colporteur

    colporteur  Sean,  {Crap more stuff to add.} Duh, for 6 switches its only 6 more resistors, 6 more caps, and one Hex Schmitt Trigger. and that's only 12 more parts + the IC plus you will need the pull-up resistor anyway. You can get a small PCB made for a few bucks. and stuff it yourself. Basically with ANY SWITCH PUSHBUTTON or ROTARY, or THUMBWHEEL SWITCHES WILL ALWAYS GIVE YOU A BOUNCE OR TWO!!! get over it. its life.  If you assume you are not going to get a bounce you most likely will. So err on the side of caution and always debounce them FIRST!

    ~~

    Cris

     

    Sorry for the CAPS but I needed to get your attention.

    • Cancel
    • Up +1 Down
    • Reply
    • Cancel
Children
No Data
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube