voltage input trigger

Status
Not open for further replies.

tonton81

Well-known member
i know people like myself have been using opticouplers, and voltage dividers (im not using those tho).
my project is in the automotive field and i was just thinking, rather than optos or resistors, what about just a N mosfet?

gate pulled low via 10k
gate to voltage input (12-16V)
drain to (mcu input (INPUT_PULLUP))
source GND

Any thoughts on if this is possible or not ?

in theory, just like a button, this should be able to pull the mcu pin to GND when activated
 
That might work if you have a stable and noise free or voltage spike free common ground for everything which is most times not the case in an automotive environment. That's why I would consider both variants, MOSFET and voltage dividers, being rather unreliable. That's where the optocoupler comes in because of the fully galvanic separation, so that voltage spikes either on the input signal or on the ground line do not risk to trigger accidentally the input or worse, to kill the ESD sensitive MCU.
 
not worried about the mcu, i try not to use any of the teensy pins as i have a bank of ~ 200 gpio pins on spi expanders which are 5volts powered, makes for mcu upgrades easier, didnt take long when i switched from mega2560 to teensy3.5, it took more time to figure out how to get the busses working, but it all fell into place, i was just thinking of that idea above since, even with the galvanic separation, with optocouplers, the grounds are still shared. all in all i havnt had issues and i only use optos with expanders, and N/P mosfets to trigger other peripherals. but heck if the mosfet worked it can make things alot easier by keeping just the gpio in input_pullup state :p
 
Status
Not open for further replies.
Back
Top