thank you for your suggestion.
I have used transistor to invert the signal and now it is working fine.
I am facing a problem of noise.
Even if in the absence of the signal the alarms are generating. And this happens only when there is a switching.
Please suggest how to get rid of it.
thanks,
paddy