I got a push button and some sensor that need 24V to run but arduino can’t take 24V so i want to convert them to 5V logic.
I need your help to know what is the best circuit for me.
I got 2 circuits in attachment.
Circuit 1, MOSFET and resistor, i think this circuit can work in both ways but i’m not sure, can the 2N7000 MOSFET can do this job ? Can this circuit draw to much current on the arduino ?
Circuit 2, optocoupler, i think this circuit is the safest but it don’t work on both way. Is the 4N35 is enough for me ?
If you have better circuit propose me. I don’t want only a voltage divider because you don’t have protection on overcurrent.
Thx for your help