2 pulses from 1

Feb 28, 2005 24 Replies

I'm sure there must be a smarter way to do this than my first design. I want to produce separate +ve going 12V pulses at the leading and trailing edges of a low impedance 12V input.



My first draft looks too complex:


- Use R/C/diode edge detector to produce OUT 1.



- Also take input to half a 4013 to produce FF



- Logic NOR the input with the inverted FF



- Use R/C/diode edge detector to produce OUT 2



Here's the timing chart:

formatting link



I think those crude output pulses should be adequate without further cleaning up, as they go to the respective Set and Reset inputs of a simple 4001 bistable. Of course, squared up outputs would be a bonus; I might do that anyway if I have any spare 4001 gates.



For the curious, it's an add-on for my curtain controller, to open and close them either at dawn/dusk or at specific times of day.



Any simpler way to achieve this please?


Terry Pinnell Hobbyist, West Sussex, UK

Terry Pinnell wrote in news: snipped-for-privacy@4ax.com:

Terry, Someplace in the past I remember using an edge detecter circuit for the count output of a rotory encoder. I think it was from one of the "Design Ideas" in Electronic Design(?). It used an XOR gate with an RC delay on one of the two inputs. The other input was direct. The output pulse width was a function of the RC time constant.

-- --- - - | | | | || || || || --- --- XOR -- --- --- -- --- __ ---+----------------| | | ___ | |------- +---|___|---+----|__| | --- --- | ---------------+---------------

Edge Detector created by Andy´s ASCII-Circuit v1.24.140803 Beta

formatting link

What's wrong with the old standard way of doing it? IN>-----+-----------A | 4070 Y---->OUT +--[R]--+---B | [C] | GND>------------+ _______________ IN _____| |__________ _ _ OUT_____| |_____________| |________

View in a fixed-width font such as Courier.

4070_ +----------------\ \ \ | | | >--+------>OUTN | |\ +-/ /__/ | |\ IN>---+-[R]-+--| o --+ +-| o-->OUTP | |/ |/ [C] 40106 40106 | | ---

------------ | | | | IN ------- -----------

------- --------- ------- | | | | OUTN | | | | -- --

~0.7RC -- -- ->| |

This should be more in line with what you want: View in a fixed-width font such as Courier.

4070_ +----------------\ \ \ | | | >--+------>OUTN | |\ +-/ /__/ | |\ IN>---+-[R]-+--| o --+ +-| o-->OUTP | |/ |/ [C] 40106 40106 | | ---

------------ | | | | IN ------- -----------

------- --------- ------- | | | | OUTN | | | | -- --

~0.7RC -- -- ->| |OUTNN | | | >-+---/__/ | |\ +-/ /__/ | IN>---+-[R]-+--| o --+ 4070 | | | |/ | | [C] 40106 | | | | | | | | --- | | | 4011 | | __ +----------------------------| \ |\ | | o-| o --->OUTPP +---|__/ |/ 40106

------------ | | | | IN ------- -----------

~0.7RC -- ->| || |

Fred Bloggs wrote: scratch that- do this: View in a fixed-width font such as Courier.

4070_ +----------------\ \ \ | | | >--+------>OUTN | |\ +-/ /__/ | |\ IN>---+-[R]-+--| o --+ +-| o-->OUTP | |/ |/ [C] 40106 40106 | | ---

------------ | | | | IN ------- -----------

------- --------- ------- | | | | OUTN | | | | -- --

~0.7RC -- -- ->| |OUTNN | | | >-+---/__/ | |\ +-/ /__/ | IN>---+-[R]-+--| o --+ 4070 | | | |/ | | [C] 40106 | | | | | | | | --- | | | | |\ | 4001 +------------| o ------------\ \ |/ | | o-->OUTPP 40106 +---/__/

------------ | | | | IN ------- -----------

~0.7RC -- ->| || |

It may be better to make a slow XOR to avoid race, and if that RC is short like

"Terry Pinnell" a écrit dans le message de news: snipped-for-privacy@4ax.com...

Terry,

You want separate positive pulses for your NOR RS bistable.

If your 12 pulses are clean, you can do this:

10K ___ .-|___|-+------+-----VDD | | | 1K 1n | | | 12V ___ || | | |< >-|___|--||--+-------|----| pulse || | | |\ | | | >| | | |-----' | /| | | | Set Reset | | .-. .-. | | | | | | | | '-' '-' | | | | === === GND GND (created by AACircuit v1.28 beta 10/06/04
formatting link

Adjust the 1K 1n time constant to your taste.

Thanks, Fred.

Thanks for those prompt replies. Will experiment with each suggestion.

BTW, remember that IN period is *hours*, and output pulses can be virtually any duration - say 10 ms for discussion - so fast pulse issues don't arise.

Terry Pinnell Hobbyist, West Sussex, UK

Right- but I was talking about the fact that IN has to beat the XOR to the output NOR inputs each time to prevent things like OUTNN producing a sliver of a transient at the positive IN edge and OUTPP doing likewise at a negative IN edge- I have not checked the 4070 Tpd's- but using a quad NAND for this function gets you a two gate margin. I would make that RC more like 1us- more than enough duration at your higher power supply voltage.

I'm almost reluctant to say this since it seems to be the answer to so many simple projects: use an 8-pin PIC or other similar microcontroller (uC).

There are other considerations that are not addressed by a simple edge detector. I'm assuming your input comes from a photo-detector of some kind so your edges are probably very slow and subject to "chatter". Further, you probably don't want to trigger if a shadow from a bird passes over the sensor during the day, or a headlight beam hits it at night. This means you need to debounce the input before edge detection. This all adds up to extra components if you do it in the analog world.

Using a uC with an internal clock, you need only the uC and perhaps an input clamp. Plus you can easily vary the width of your output pulse or delay one edge if you want (if you find you'd prefer an hour after dawn, for instance).

Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer Marmot Engineering . . . . . . . VHDL, ASICs, FPGAs, embedded systems Vancouver, BC, Canada . . . . . . . . . . . http://www.marmot-eng.com

Ah! I missed that part. Thanks.

Extreme overkill IMO, and that's even *if* I had:

- the parts to hand

- the programming skills necessary

- the time to remind myself how to use the programmer

The dawn/dusk detector is based on an LDR, but via a Schmitt with hysteresis, so those problems don't arise. The second input option I mentioned will come from a plain mains-based programmable timer, and I'll ensure it delivers clean 12V pulses to the pulse-generating circuit.

Versus a couple of chips and a few passives - come on! OK, it certainly offers more versatility (not particularly important in this application), but I think every other factor weighs against a PIC approach here. Even my ponderous design takes only 6 passives plus 2 dirt cheap ICs. And some of the other recommendations, for which detailed schematics have been posted up-thread, are much simpler.

I appreciate your good intentions, but, like quite a few posters, you've tacitly assumed everyone here knows PICs and works with them every day. Although I still have that as a goal, unhappily I haven't achieved it yet!

Terry Pinnell Hobbyist, West Sussex, UK

Nothing- he wants those pulses separated out- the IN + edge pulse to one output, and IN - edge pulse to another channel.

I think the cheapest thing is a simple gate one-shot since he says IN lasts a long time and is debounced. OUTNN is pulse at neg IN edge and OUTPP is pulse at pos IN edge:

View in a fixed-width font such as Courier.

BASIC ONESHOT

12V | +---------+ | | / / 1M 22K / / \ \ 40106 | 330P | |\ IN >--|OUT 1N914 |/

------------- IN | | | | --- ----

--- -> | |--| o--+--| o---|OUTNN |/ | |/ 1N914 |/ | | 12V | | | +---------+ | | | | / / | 1M 22K | / / | \ \ 40106 | | 330P | |\ +--------|OUTPP 1N914 |/

I'm not particularly fond of differentiators (noise). An integrator with a couple of gates works. For a single output an XOR gate can be used as a discriminator. For separate rising/falling outputs use a couple of NAND/NOR gates.

Keith

That's clever-easy to square up too: View in a fixed-width font such as Courier.

You want separate positive pulses for your NOR RS bistable.

If your 12 pulses are clean, you can do this:

10K ___ .-|___|-+------+----+ | | | | 1K 1n | | | === 12V ___ || | | |> GND >-|___|--||--+-------|----| pulse || | | |\ | | |

Just differentiate the square pulse with a CR circuit. Use both the leading and trailing edges to trigger something.

See Blumlein, early television, circa 1935.

Unfortunately Blumlein was killed in an air-crash around 1943/4 while testing yet another of his circuits in a war-time, top-secret, centimetric, airborne Radar navigation equipment intended for guidance of Lancaster bombers, the ultimate killing machines, over German towns and cities for the purpose incinerating their populations in fire storms.

We'll never know the circuit details but a monument has been erected to his memory.

Read the requirement again. Look at the timing chart...

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