Does something like a contact sensor exists?

Hi. Im looking for some kind of sensor of two parts that i can read two values from the arduino: 1 or 0, being 1 the value when those two parts are in contact and 0 when those parts are not in contact.
I feel that this is very simple to achieve, even with two copper terminals but i cant think of how would i read that from the arduino. Any suggestion?

If you did use two pieces of metal, you could wire one to ground and the other to an input pin and use digitalRead() just ,ike it was a switch.

And just like if it was a switch, you'd want to use a pull-up resistor or pinMode() INPUT_PULLUP.

So simpleit seems like I am surely missing something about your problem.

a7

That "sensor" is more commonly referred to as a switch!

Or are you saying that you have no idea how to read the status of a switch with an arduino?

1 Like

Another vote for "its a switch" !

Hi, @gzanotto

What is the application?
What are the two parts?

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

So sad I didn't figure this out at first. Thanks a lot!

Or are you saying that you have no idea how to read the status of a switch with an arduino?

:frowning: didn't realize

thanks!

It's just metal parts, and I only need to read if those are touching, so it was really that simple.
Thanks!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.