Author Topic: Sanity checking my idea for extending the interrupt pin of an IC along a wire  (Read 752 times)

0 Members and 1 Guest are viewing this topic.

Offline MildInductorTopic starter

  • Contributor
  • Posts: 37
  • Country: au
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.
 

Offline Swaroop 21

  • Contributor
  • Posts: 47
  • Country: in
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.
« Last Edit: August 03, 2024, 03:48:54 am by Swaroop 21 »
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
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.
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4355
  • Country: nl
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 example https://electronics.stackexchange.com/questions/293728/2n7000-3-3v-to-5v

Offline MildInductorTopic starter

  • Contributor
  • Posts: 37
  • Country: au
Thanks everyone :)
 

Offline aeg

  • Regular Contributor
  • *
  • Posts: 110
  • Country: us
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.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6911
  • Country: fi
    • My home page and email address
I always have some unidirectional voltage shifters for this kind of use case.  Here, I would reach for a TI TXU0101QDCKRQ1 or a SN74LVC1T45DBV.  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.
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6254
  • Country: es
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.
« Last Edit: August 03, 2024, 12:19:26 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline aeg

  • Regular Contributor
  • *
  • Posts: 110
  • Country: us
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?

If 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?
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3908
  • Country: us
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?

If the sensor IC Vcc is 3.3V then he can't pull it any higher than that.

Many 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf