We buy several devices wich have a large cable extension, 4 mts. The cable should come mounted by the manufacturer but sometimes, the cable is not connected properly, so we have to unmount everything in order to connect the cable to the device.
To avoid this, I thought I could develop a simple arduino board to check if the wires of the cable are connected to the device or not.
By reading the resistance of the two cables of the
motor device, I get 2MOhm, so I imagined that connecting it to an input of the arduino, with a pull up resistor of 10MOhm I could get a 0 or 1 depending on the cable if it is connected or not.
When the cable is connected to the device, the arduino should read GND and when not, it would read VCC so, in theory, I know when the cable is connected and when it is not.
The problem I face is that I get false readings because it seems the cables get noise and the arduino reads a zero ( cable connected ) even though there is nothing connected in the other side. I readed in another post of the forum that a 10MOhm is too much, so I changed to a lower value, but, now I can't read properly as the pull up is too small.
Can you help me? Thanks in advance