Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: Ustary on February 18, 2011, 02:52:23 PM
-
Hi. For my robot i need some contact switches working with an arduino. The switches are copper and alluminuim, and work pretty well, with barely any resistance at all. on the parts that shouldn't conduct, i use ductape. The problem is, sometimes the digitalred of my arduino returns 1 instead of 0 even if the contacts are seperated by ductape. Can someone help me solve this? these contacts are a vital part of my robot...
Thank you
-
Do you have a pull-down resister on the input pin to ensure that the logic level is 0 when the switch is open?
-
No, there is no said resistor. How would i go about doing this?
Thank you
-
No, there is no said resistor. How would i go about doing this?
Thank you
the resistor is there so that a logic level of 0 or 1 is always maintained. digital logic becomes unstable (hence the erroneous 1s) when pins arn't tied down to one or the other. if your switch ties the pin to ground lets say then the resistor (2.2k should work) would go to +5v
-
Thank you for the reply. I'll try to get some resistors, and experiment with them.