Separate pulses from edges?

Jun 24, 2006 60 Replies

Thanks Mike. But as per my follow-up earlier this morning, unless I'm missing something I reckon my own approach is about as simple as it comes. Just *invert* the trailing edge input (either with a single logic gate such as a 4001, or an NPN transistor), and differentiate that as usual to get your second pulse.

formatting link

Terry Pinnell Hobbyist, West Sussex, UK

--- _ Connect Q to D and drive the clock line with the debounced output of your RF receiver. There should be no interaction as long as both SET and RESET are low when CLOCK goes high.

John Fields Professional Circuit Designer

Now I see why you wanted those signals to go into the set/reset inputs of a toggle flip-flop. This being your target, you might use John Popelish's idea of a single time constant with an xor gate to get both change signals on a single line. These could be used to reset an R/S flip-flop. The set for that flip-flop would be your radio signal, and the output of that flip-flop would go to another xor in the package to reverse the current sense of the lights. That is, the radio signal would turn the lights off if they would otherwise be on, on if they would be off. Either normal day/night transition would reset the sense-reversing flip-flop. The advantage of doing it this way is using only a single time constant, with both signals on one line, and using a single pair of gates for the R-S flip flop.

-- john

The disadvantage, however, is that it won\'t do what he wants it to do, which is to turn ON at dusk automatically, (subject to an RF override) and turn off at dawn automatically, also subject to an RF override. In order for that to happen he needs one positive-going pulse for the SET input of his 4013, a _separate_ positive-going pulse for the RESET input, and a CLOCK input from the RF detector. Also, the 4013\'s Qbar output needs to be connected to the D input, and the signal from the RF detector needs to be debounced.

The simplest is a dual one -shot; it uses two RCs but does the output decoding, ultimately less space and parts than a headache with only a single RC and discrete gates that respond to opposite polarity input slew and route to one of two outputs: View in a fixed-width font such as Courier.

. . . . +--------+ . | | . .---|>B Q|------------. . | | | | . | | 15ms | | . | +--------+ +--------+ . in >---------+ | S | . | | | . 5v Set | 74HC123 | 4013 | . | | | . 0v Reset | | | . | | R | . | +---------+ +--------+ . | | 15ms | | . | | | | . '---o>A Q|-----------, . | | . +---------+ . . . . . . T~RC = 15ms; C=0.1u -> R=150K . . . . ------------------- -------- . in | | | . | | | . --- ----- . . |

I think what I described actually will do what he wants. The set of the RS latch is from the radio signal, a signal that a reversal of the normal condition is desired. The reset of the RS latch and a reversion to normal operation occurs on any day-night or night-day transition, from a single line that carries a pulse signalling a change of day/night state. That RS latch is one input to an xor gate, whose other input is just the day/night condition. The output of that xor gate is transmitted to the light control. Unless I've misunderstood?

-- john

Thanks John, but I don't see how that could work. John Fields pointed out the basic flaw over the source signals in his reply to John Popelish up-thread,

There also seems another problem to me. In your follow-up to JF, you say "That RS latch is one input to an xor gate, whose other input is just the day/night condition. The output of that xor gate is transmitted to the light control."

But surely the XOR's output would depend on the current state of the RS latch? For example, if the latch had been set low during the night (maybe my son had switched off the lights before going to bed), then at dawn they would go back *on* again.

Terry Pinnell Hobbyist, West Sussex, UK

Yes, that's the point of the latch- it toggles the output of your circuit away from its normal state (by using the output xor as a switchable inverter), and then the whole thing goes back to its normal state at each transition from night to day. I just posted a jpg schematic on a.b.s.e. Just to be sure, I whipped up a quick breadboard, and it seems to do what you want rather simply. Again, unless I'm still misunderstanding. :-)

-- john

Thanks Fred. I may give that a try on a future occasion. But I'll stick with the present chips right now, for the reasons I gave in my other post: "Present circuit is already built on stripboard, with several other sections, so want to fix it with existing

4001/4011/4013."
Terry Pinnell Hobbyist, West Sussex, UK

Apparently I couldn't make a post to ABSE; I took the liberty of emailing you a 100k jpg file of the schematic.

-- john

Terry Pinnell wrote: "Present circuit is already built on stripboard, with

Then you can use an idea similar to the one I posted for the EX OR, but using other gates. If you combine the original signal with the RC delayed version, with a NOR, you get a positive pulse every time the signal goes low. Combine the original signal and the same RC delayed version, with a NAND and you get a negative pulse every time the signal goes high. I leave it to you to come up with a way to make the negative pulse into a positive pulse. ;-)

If this is what you\'re advocating: (View in Courier) _ _| |_ RFDET>--------------A NOR Y--+ +--B | | | | A--+ +--Y NOR _ | B--+ _| |_ | | D/N>-------------|--------+---A | EXOR Y--->OUT +------------B then RFDET will only set the latch if it\'s been previously reset by a pulse from D/N, which means that you\'re only allowed one set in any daylight or dark period. Terry specified that he wanted to be able to toggle the output with the radio signal which, to me, means being able to change the output state at will. Like this: _ _| |_ D>------------------+ | +------|------+ | | | | +---+---+ | _ +--|D S Q|--|--->OUT _| |_ | | | RFDET>----------|> 4013 | | | _| | | R Q|--+ _ +---+---+ _| |_ | N>------------------+

OK, thanks, I'll study that tomorrow.

Terry Pinnell Hobbyist, West Sussex, UK Sun 25 June 2006, 22:34 UK time

OK, then I did misunderstand. With the circuit I proposed, it can only override away from the default state, not toward it.

-- john

--- Google groups doesn't support binaries so, since I'm also in the loop, would you please email me a schematic as well?

Short of that, if you log onto:

formatting link

and download and learn to use their simulator, you'll be able to work your ideas out and post your solutions as text files to USENET through Google.

-- John Fields Professional Circuit Designer

I had signed up for a cheap news service just to get abse, and only now found out that I couldn't post through it. I changed news providers and did post the schematic in abse. However, you were right, it only overrides once and it stays overridden until the next day/night change. The toggle ff would permit changing back and forth at will.

-- john

--- Post your circuit.

John Fields Professional Circuit Designer

John Fields wrote: {trimmed}

It's in abse.

-- john

Agreed, as per my reply last night. news: snipped-for-privacy@4ax.com

Terry Pinnell Hobbyist, West Sussex, UK

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required