Connect with us

555 or is there an easier way?

Discussion in 'General Electronics Discussion' started by Seismic, Feb 14, 2011.

Scroll to continue with content
  1. Seismic


    Feb 13, 2011
    Hi all,

    I've been building simple circuits with relays, LEDs, resistors and otherwise
    passive components for years now and built some pretty complex switching networks
    and "pseudo-logic" circuits out of interconnected relays - but I've decided it's
    time to grow up!

    This is really the first time I'll have used an IC or for that matter a transistor
    outside of a predesigned kit (of which I have built quite a few) - so be gentle with

    The task:
    I have a garage door opener that has two LEDs on the opener unit. A red LED
    indicates that the door is closed and a green LED indicates that the door is open.
    During the 10 seconds or so that the door is in transit, the LED for the door's
    destination will flash. So while the door is closing, the red CLOSE LED will flash
    and so on.

    What I want to do is build a circuit that will report 1 of 3 states on an external
    panel using LEDs labelled "Open", "Closed" and "Transit". The outputs that drive the
    LEDs will also have provision for reporting to another device allowing me to monitor
    the door remotely.
    I plan to use an optocoupler connected in parallel with each LED to export it's
    state from the door opener safely, but the bit that's challenging me is differentiating the "pulsing" of the LEDs from the OPEN and CLOSED states where the LEDs are solidly lit. I'm sure by this point you may already have the solution in mind and are thinking "Duh" but I want to learn something here, so let me share my thinking first ...

    Keen to get my hands dirty with a 555 (or 556 since there are two signal sources to work with) I got to thinking that I could invert the signal and connect it to the trigger input of the 555 so that when the LED turned on, the inverted signal would go low and begin the timing interval. Meanwhile, the raw signal would connect to RESET so that when the LED turned off, the timing interval would be interrupted, ready to accept the next LED pulse. So far the output of the 555 would mirror the raw signal. When the LED stays on though and therefore the timing interval is allowed to complete, at the end of the interval when the 555 output goes low there is now a difference in the logic states of the 555 and the original signal, so some comparator (like a NAND gate?) could be used to indicate that the LED has remained steady, confirming that the door is open or closed (ie no longer in transit).
    It all sounded great in my head until I realised that while the trigger input of the 555 is held low by the inverted signal, the timing interval will not actually complete - its output is held high (correct?). Meaning that the output of the 555 completely mirrors the original signal which is of no use at all to the NAND gate.

    Desperate to cure my oversight I began thinking along the lines of using a small relay in series with a capacitor, activated by the optocoupler, to simulate a momentary switching to ground as the trigger input to get around this. But I am sure that this is making it way to complicated when the whole point of my trying to implement the 555 was to break out of my "relays can do anything" box!

    Perhaps taking the 555 out of the equation altogether, using an RC network to act as a filter would be the simplest solution but I have absolutely no knowledge in this area so am way out of my depth (if I wasn't already!)

    I'd be grateful for some guidance :)
  2. Laplace


    Apr 4, 2010
    It appears that either LED goes through the same cycle. First it is off, then it begins to flash, and finally it is steady on. Can we assume that an LED turns off when the other one begins to flash? So the only problem is to detect when an LED begins to flash (easy) and when it stops flashing to become steady on (less easy). The obvious solution is to use a retriggerable monostable, such as the CD4538 dual precision monostable, triggered by the leading edge of the LED turn-on. Just make the monostable period longer than the time between successive leading edges of the flashing LED. The logical-OR of the two monostable outputs will be the transit signal. The logical-AND of the LED signal with the complement of the transit signal will be the respective open or closed indicator. Even using an LM324 to sense the LED drive voltage, you should be able to build this with just 3 chips.
  3. Seismic


    Feb 13, 2011
    Thankyou! This sounds exactly like what I need! Let me think this through out loud to make sure I understand why this is your suggestion ...
    The CD4538 is retriggerable meaning that the output high interval can be extended by a valid trigger being received after the initial trigger that began the interval. So by selecting R and C to set the interval period to a duration longer than the period of the LED flash, the output high state can be maintained until one whole interval after the LED stops flashing and remains steady.
    You correctly assume that only one LED is in operation at any given time, making the logical operations simple. One thing I neglected to mention is that while the door is opening (in transit with the OPEN LED flashing) and the button is pressed, it will stop and remain at that position. In this instance, the OPEN LED will flash but more rapidly than if it were still opening. As far as I can see this won't have an effect on the monostable since the rising edge triggers will still be within the timing interval, and I am happy to have the "Transit" status LED lit when this is the case.
    In fact, I plan to have a "Cat" button on my wall plate which will only be available from a door closed condition and it will send two pulses to a relay to begin opening the door and then stop it just high enough for the cat to get in and out (perhaps I can play with a 555 or 556 for this part?) - and so indicating that the door is neither open nor closed with the transit LED will be fine in this scenario.

    The OR makes sense to me, but by "complement of the transit signal" do you mean inverting the transit signal?

    Two questions regarding the 4538:

    * Will the RESET need to be held low during power-on to prevent a false trigger?
    * Since leading edge triggering will be used, when the LED stops flashing and remains steady (and therefore the trigger input remains in a high state) will this not extend the output pulse indefintely, waiting instead for a whole interval period after the trigger input falls to low before dropping the output back to low?

    I'll take a look at the LM324 to get my head around it - thanks for that suggestion too!

    I appreciate your help, thanks!!
  4. Laplace


    Apr 4, 2010
    "Complement of the transit signal" means use the transit signal to inhibit activation of the open or closed display indicators. So when transit is HIGH the complement going into the AND gates will be LOW.

    Hold RESET low? Possibly. How often is the device powered on? Is it important to suppress transient flashing during power on?

    Extend the output pulse indefinitely? The CD4538 datasheet claims the inputs are edge triggered. That usually means only the transition is important, not the steady-state value. Try it on a breadboard.
  5. Seismic


    Feb 13, 2011
    I've taken a look at the LM324 and can see how I would use it but my thinking with the optocouplers was to maintain electrical separation between this control circuit and the door unit. The door does have provision for a 12V supply which I could use to drive the circuitry but since my control panel would be located about 10M worth of cabling away I plan to power it locally so would like to keep the two systems separated by the Optocouplers - does that make sense?

    Once constructed, this circuit would only experience a power-on during recovery from a power failure and since this portion of the circuit only reports the door's status and activates the appropriate door controls accordingly (but not operate them) then the power-on flash doesn't really have a major effect.
    The portion of the circuit that I'm yet to think about that will provide timed output pulses to operate the "cat" button though will need suppression because without it the output relay that simulates a door button press will close briefly and open the door - something I certainly don't want if there is a power failure and recovery while I am away from the house!!
    I'm reading about the MAX6805 to supervise the power-on reset which seems like it will do the trick but is there a simpler way?

    The edge-triggering makes sense and the datasheet shows that the timing cabacitor begins charging immediately after discharge rather than waiting until the end of the input pulse. I have the 4538 on a breadboard but am having a little difficulty - pardon my ignorance and inexperience!
    To use leading-edge triggering it seems that I have to connect the B input to the supply voltage as this input is inverted and then run into an OR gate alongside A.
    Page 4 of the datasheet shows what to do with unused inputs - if I am only testing one "side" of the 4538 on the breadboard, do I need to do this with the other side or should that not have any effect on the first side?

    Thanks again for your patience with me!
  6. Laplace


    Apr 4, 2010
    Optocouplers? Is there enough current available to drive both the LED's and the optocouplers? Instead of current sensing, using high resistance voltage sensing with the LM324 (100K sensing resistors) will provide plenty of electrical separation. You have to run cabling between the two systems anyway so why not extend the 12V power supply instead of adding another power supply?

    The A & B inputs of the 4538 can each be used to enable/inhibit operation of the other input. So make the appropriate connections.

    I would assume that each side of the 4538 is independent of the other.
  7. Seismic


    Feb 13, 2011
    Okay, so this weekend I have pulled the door controller apart and located the two SMD LEDs in question and their corresponding series resistors. I am assuming that the voltage across the resistor-LED combination will be 12V since the rest of the board seems to operate at this level but I will be able to test once I have wired in my connections. The power supply cap looks like it's going to rupture too so I will replace that while I'm there.
    I had just assumed that the optocouplers wouldn't require any more current than the LEDs, but that would of course double the current drawn from the pins on the micro driving the LEDs so agree with your opamp suggestion - thanks! I understand too that placing the optocouplers in parallel with the LEDs could lead to thermal runaway if the current draw doesn't match almost perfectly.
    So, another stupid question: once I know the voltage across the resistor-LED branches when active, and assuming it is 12V, will I still need the opamp to "export" the high signal to the CD4538? Would I be right in assuming that the input impedances of the 4538 are so high that the current drawn would be negligible?
  8. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    If you have sufficient excess voltage you can place the opto and the regular LED in series. If the current requirements are different you could shunt the LED requiring the lower current with a resistor (which does leave you a little exposed to thermal runaway, but in a much more limited manner.

    Figure out how much current the LED is getting now and check the opto's datasheet to see if this is sufficient.

    If you want a logic level from a gate that is driving a LED you will have to ensure that the LED current is low enough that the voltage at the output of the gate does not sag too much. You can look at the datasheet, but it may be more practical just to measure it.

    The input impedance would be many orders of magnitude higher than the LED/resistor, so it would have further negligible impact.
    Last edited: Feb 21, 2011
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day