Sanity checking my idea for extending the interrupt pin of an IC along a wire - Page 1
Forum section: electronics / projects

author: MildInductor
author_rank: Regular Contributor
timestamp: August 03, 2024, 03:26:35 am
content: Hello, say I have a 2m wire running from my microcontroller to a generic sensor IC. The wire carries 5V from the microcontroller, which is reduced to 3.3V through an LDO before going into the sensor IC.Now, this sensor IC has an interrupt pin that needs to connected back to the microcontroller through the 2m wire. The interrupt is a 3.3V logic level. I want to convert this 3.3V logic level to 5V before sending it back through the wire. Would the best way to do this be with a FET? I realise this is a bit of an open-ended question as well. I am just interested to hear any opinions of how this is usually done.

author: Swaroop 21
author_rank: Regular Contributor
timestamp: August 03, 2024, 03:46:55 am
content: As per my thinking if your sensor interrupt pin is an output you could just connect it to the uC directly through the 2M wire ? As voltage drop will not be significant as there's almost no significant current passing through it. Or your can buy those "Bi-Directional Logic Level Translator" modules from ebay, for almost close to the cost of using 2 FETs, Here in my country they cost 20INR (0.24$). Those have 4 Ch or more so you could use two channels for what ever communication (i2c/uart) and one channel for the interrupt signal. It will translate your 3.3v outgoing to 5V and vice-versa.

author: moffy
author_rank: Super Contributor
timestamp: August 03, 2024, 03:52:25 am
content: A logic level MOSFET or transistor would be fine, it will invert the signal. An SN74LV07 run off 3.3V will also do the trick, there might be a single gate version. Use a lowish value load resistor for noise immunity.

author: pcprogrammer
author_rank: Super Contributor
timestamp: August 03, 2024, 05:52:35 am
content: A level converter made with a 2N7000 will also do the trick.Search for level converter 2N7000 yields a lot of results. See this one for examplehttps://electronics.stackexchange.com/questions/293728/2n7000-3-3v-to-5v

author: MildInductor
author_rank: Regular Contributor
timestamp: August 03, 2024, 08:04:54 am
content: Thanks everyone

author: aeg
author_rank: Regular Contributor
timestamp: August 03, 2024, 09:24:33 am
content: FETs as level shifters are goofy. Open-drain buffers as level shifters are also goofy, unless this is a wire-OR interrupt bus. The right way to do this is with a 74HCT04.

author: Nominal Animal
author_rank: Super Contributor
timestamp: August 03, 2024, 09:51:39 am
content: I always have some unidirectional voltage shifters for this kind of use case. Here, I would reach for a TITXU0101QDCKRQ1or aSN74LVC1T45DBV. The latter is in SOT23-6 package, and with careful hand-soldering and heatshrink, can even be dead-bugged directly to wires without any PCB for testing. The former has Schmitt trigger inputs (could help with coupled noise), and I'd use a tiny breakout board for the SC70 footprint (the spacing is too small/close for me to solder wires directly into).I always have SN74LVC1T45, TXU0101QDCKRQ1, TXU0202QDCURQ1 (RX+TX), TXU0204QPWRQ1 (RX+TX+RTS+CTS), and TXU0304QPWRQ1 (CS, SCK, MISO/DI, MOSI/DO) in stock, because they allow me to solve this kind of situation without worrying about it, and don't cost too much even for me: my hobby budget is tiny.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 03, 2024, 12:10:07 pm
content: Most IRQ outputs are open drain, active-low, so they can be connected to any logic level with just a pull-up resistor, have you checked this?In any case: Is it active-low or active-high?- Low: Just put a diode in series, so the sensor can only pull low, adding a 5V pull-up resistor in the PIC pin.- High: PIC inputs will already see 3.3V as "1", so no further action is required.PIC inputs draw nanoAmps, so they will pick anything in the air unless taken care of, and a 2m wire will pick up plenty of noise.Better to use low value pull resistors, so it draws 2-5mA when the irq is enabled, giving much better noise inmunity than Hi-Z.

author: aeg
author_rank: Regular Contributor
timestamp: August 04, 2024, 11:55:36 pm
content: Quote from: DavidAlfa on August 03, 2024, 12:10:07 pmIf the sensor IC Vcc is 3.3V then he can't pull it any higher than that.Other things to worry about: what is the edge rate of this signal? What will an edge look like at the receiving end of this 2-meter transmission line? Is the microcontroller OK being triggered a few times? If not, what are you going to do about it (termination, Schmitt trigger, slow down the edge)? Is this sensor exposed to ESD events, if so, what are you doing to do about that?

author: ejeffrey
author_rank: Super Contributor
timestamp: August 05, 2024, 03:15:29 am
content: Quote from: aeg on August 04, 2024, 11:55:36 pmMany open drain output pins are high voltage tolerant and would be fine with a 5V pull up. But this is all speculation without knowing the specific devices in question. These are questions that are answered by reading the data sheet.