by support » Sun Dec 07, 2014 11:18 am
What status sensing strategy have you configured in your .INO file?
STATUS_STRATEGY_3VCLOSED_5VOPENED // initial approach - uses analogRead combined with STATUS_OPEN_TRESHOLD (opened == +5v, closed == +3v)
STATUS_STRATEGY_5VCLOSED_3VOPENED // alternate approach - uses analogRead combined with STATUS_OPEN_TRESHOLD (opened == +3v, closed == +5v)
STATUS_STRATEGY_NORMALLY_CLOSED // classic door sensor - uses digitalRead to interpret door/device status (opened == high-impedance, closed == GND)
STATUS_STRATEGY_NORMALLY_OPENED // alternate approach - uses digitalRead to interpret door/device status (opened == GND, closed == high-impedance)
Ideally, to avoid situations such as the one you are describing, you should be using one of the strategies that uses a digital read instead of an analog read. If,
for any reason, you must use a strategy that relies on an analog read, you can fine tune the sensitivity by tweaking with the STATUS_OPEN_TRESHOLD value
which by default is set to 1000. It can be adjusted to any value between 0 and 1023.
But definitely switch to a digital read strategy if you can. It's 0 or 1 ... No ambiguous reads.