Tri-state interrupt

Discussion in 'General Electronics Chat' started by Dritech, Jan 19, 2014.

  1. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Hi all,

    With reference to the attached diagram, I am driving a device (in this case a bulb) using the microcontroller at Point A. A switch 2meters away from the circuit will be used as an interrupt (point B).
    R1 is used as current limiter, R2 is used as a pull-down resistor to keep the transistor base low when the tri-state IC output is flow.
    Is this an efficient way or are there better methods to implement this?

    Thanks in advance.
     
  2. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi dr,
    Do you mean an 'Enable/Disable' rather than a Interrupt, from Point 'B'.?
    E
     
  3. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    digital Mosfet you can get rid of one resistor.

    Or, you can use only one resistor from the microcontroller, and short it with the switch.

    so you get rid of the tristate buffer, and one resistor.
     
    Dritech likes this.
  4. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Thanks for the replies.

    Yes. I called it interrupt since it will ignore the input when the switch is pressed.

    I used a tri-state to reduce noise which can come from the long distance wire which is connected to the switch. If I go for this option with a bypass capacitor connected to the transistor base, will it work?
     
  5. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi dr,
    Yes, use the B switch to short the transistor Base to 0V.
    Just twisting the 2 mtr wire [ 3 twists/inch] will be sufficient to limit noise.

    As takao suggests drop the buffer and Base to 0V resistor.
     
    Dritech likes this.
  6. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Hi again,

    If I use an opto instead of a transistor and I connect it as shown in the attached diagram, will it work?

    Edit: I noticed that if one of the disable switches is on and the micro output is high, it will create a short circuit. How can I prevent this?
    If I connect another resistor to the micro output, will it work?
     
  7. bertus

    Administrator

    Apr 5, 2008
    15,641
    2,344
    Hello,

    When you put an open collector buffer between the micro and the optocoupler, the circuit will work.

    Bertus
     
  8. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Thanks for the reply.

    Is there another option to eliminate including another IC?
     
  9. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi dr,
    This is one option, not very efficient.
    E
     
  10. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Can I connect another resistor as shown in the attached diagram? If all switches are open, current will only flow through the LED. When one of the switches is closed, the current will go for the easiest path i.e through the switch and to ground.
    Is it efficient?
     
  11. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    You don't need to worry about noise with this setup. The pulldown resistor will keep the transistor off without any issue.

    There would actually less noise without tristating the output.
     
  12. bertus

    Administrator

    Apr 5, 2008
    15,641
    2,344
    Hello,

    There is a big difference between the circuits in Post #6 and the ones in the posts #9 and #10.
    In the circuit in post #6 the led of the optocoupler will burn constant when one of the switches is closed.
    In the circuits in post #9 or #10, the led of the optocoupler will be off constant when one of the switches is closed.

    Bertus
     
  13. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Sorry that was a mistake.
    Attached is the new schematic. I want the LED to remain on when one of the switches is closed while ignoring the logic from the micro. When all the switches are open, the LED will turn on/off according to the logic present at the micro I/O pin.
    Will this work please and is it efficient?
     
  14. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi dr,
    If you can change the MCU program to make output pin active Low, ie: Low = LED On.
    Two 1N914 diodes would make a simple OR gate.
    Calculate Rs , allowing for a 0.7Vfwd drop in the diodes.
    D2 is required if you need to keep the Opto emitter current equal when selected by the MCU or Switches, if not omit D2.
    E
     
Loading...