Wide GPIO input Voltage - Page 1
Forum section: electronics / beginners

author: mkothari25
author_rank: Newbie
timestamp: April 28, 2022, 06:42:06 am
content: HeyI am working on an automotive design where the requirement is specific for a "Wide input Range" GPIO which can consider very voltage beyond a threshold (3V-60V) to be Level High. and anything less than 1.2V is Level Low.I am using a MOSFET in an open-drain configuration as a 'Level-Shifter' and following it with an IO expander for reading the status. I think it may work, but still skeptical about long-term performance. I require 40 such input, therefore, avoiding any IC-based solution.

author: Zero999
author_rank: Super Contributor
timestamp: April 28, 2022, 06:52:28 am
content: Which is the MCU input and 3V to 60V input on your schematic?The circuit will work if the MCU is connected to the right hand side, in which case your schematic is drawn backwards. The convention is to have inputs on the left and outputs on the right.Why use a MOSFET? A BJT and suitable pull-down resistor will also do the job.

author: Romualds
author_rank: Contributor
timestamp: April 28, 2022, 06:57:21 am
content: I guess a resistor and TVS diode will do the job. You just need to limit any extensive voltage, that's it.

author: mkothari25
author_rank: Newbie
timestamp: April 28, 2022, 06:57:39 am
content: HeyThe I2C line from the IO Expander goes to the MCU.Drain is the high volt input and Source is the low volt output to the IO expander.MOSFET preference - To make sure the biasing and part to part change of gain doesn't impact the working + low current consumption.

author: Jeroen3
author_rank: Super Contributor
timestamp: April 28, 2022, 07:37:51 am
content: How are you going to deal with noise?Typically a IEC 61131 input requires some input current as well as voltage to be considering it a high to create immunity to noise and coupling. Are you going for 61131 compatibility?Eg: if you make your input 1Meg input impedance touching it could make it high 50 times a second.

author: Zero999
author_rank: Super Contributor
timestamp: April 28, 2022, 08:12:33 am
content: Quote from: mkothari25 on April 28, 2022, 06:57:39 amYou've missed the point about it being drawn backwards.Here's the correct way to draw it, with the HV input on the left and output to the MCU right.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 28, 2022, 09:26:52 pm
content: Indeed,For clarity always draw signals from left to right, and voltages from top to bottom.It does not matter for the circuit itself, but it makes your schematics easier to understand.I do not like the bare TVS on the input side. TVS diodes need some sort of resistance to limit the currentThe combination of high voltage input and low voltage switch thresholds is a bit unusual.With such circuits, switching high / low at around 5V is probably more common.I would probably just use 74HCT with schmitt trigger inputs, with 8 channels in an IC, and a series resistor as input, maybe add a capacitor for an RC filter. If you make the resistor high enough ( 60V / 1mA = 60kOhm) then the current is low enough to be handled by the ESD input diodes of the TTL IC. But it's imput impedance is quite high and you may be able to use 1MOhm resistors. If you do not want to rely on the ESD diodes, you can add a skottky diode.Or just omit the TTL IC and only use a resistor. Both Microchip (and later Atmel, before Microchip bought them) have released applicaton notes where a few resistors in series were used as a zero crossing detector for mains voltage. It is not very well specified in their datasheets, but apparently the ESD diodes can handle a DC current of some 2mA to 4mA without damage.