Detecting a sensor when it disconnects

hi, i am on a project. i am using a "seat occupancy sensor" which has 10M ohm resistance when no one sits on it. if anyone sits it has around 2k ohm depending on how much pressure on it.

I can use this sensor perfectly. but now i want to detect if sensor is connected properly or there is a broken wire between sensor and Arduino Nano. for this purpose i am planning the add 500k ohm paralel the sensor and so i can read around "20" out of 1023 with analogRead() function. and if i read below 20 this means the cable is broken.

is my approach correct? if yes my resistor values are ok? if no what is ur recommendation thank you.

circuit

So easy to try!

i tried it worked. but i am not sure if it is correct way to do it or not. i mean i never saw adding resistor to a sensor. it is claver or stupid?

IF it works, it's clever. But if this is for other than just testing, then you need to do the test over a long time period and various environments.

thats why i asking here. before long run maybe someone comments ,positively or negatively, or share their experiances

Sounds fine to me

At the sensor itself. Sounds fine.

It sounds as if you are using a 10k pull-down resistor. If using a Nano - or the less appropriate UNO - you should be using a pull-up resistor and the sensor connected between an analog input and ground.

The obvious approach here is to use the internal pullup with pinMode of INPUT_PULLUP. 470k would then read about 950. :+1:

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