Good day HMS and many thanks for your post and suggestion
as a matter of fact , the switches are latched type and not momentary ,regarding the MosFet and the resistor configuration , i haven't used them before so i did some search and i believe you mean the CMOS compatible voltage divider, here another issue i would ask about , what if the voltage (24 VDC ) rise to 30 VDC for some reason ? would the output of the divider increase proportionally ? if this is the case i guess there might be moments that the input at the Micro pin will go above 5 vDC.
also thanks for getting my attention to the 6N137 i checked the datasheet again , the seen the truth table , it is no use as you said.
i also asked my friend who requested this module , the environment where he will use it is like machinery room , with alot of relays and contactors working on 220 , 380 VDC and 24VDC would this pose another challenge on the input module design ?
thanks again
Regards
i asked regarding the switches , they are outputs of some sensors , once a switch change state , this means an abnormal condition and the controller should react with flashing corresponding LED and a sounder will activate , a reset button should silent the alarm but keeps the corresponding LED lit , until the situation is corrected, however the controller should not reset it self if a switch toggled say for only few seconds and back to normal. i simulated this case for one switch and did the coding for it , so i will repeat the code for multiple switches.
also i looked around , i think what you meant exactly is using FET/MOSFET as constant current source , thus , the variation in DC voltage do not affect the output at the resistor,however im not sure yet about the thermal stability, any ideas ?
thanks again