Author Topic: creating a pulse on state change with a comparator  (Read 7417 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18017
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
creating a pulse on state change with a comparator
« on: November 27, 2010, 12:30:47 pm »
Hi guys, I'm trying to generate a pulse, so when a signal goes high a pulse of "x" ms is produced, preferably using a comparator. Any ideas ?
 

Offline Hypernova

  • Supporter
  • ****
  • Posts: 655
  • Country: tw
Re: creating a pulse on state change with a comparator
« Reply #1 on: November 27, 2010, 12:47:09 pm »
On your mcu:

-rising edge interrupt on input,
-on trip turn output high and start a timer, set over flow interrupt when timer counts to your desired time.
-on trip of overflow interrupt turn output off.

Gives you guaranteed timing to within microseconds even when in multi threaded environment.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18017
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: creating a pulse on state change with a comparator
« Reply #2 on: November 27, 2010, 01:30:08 pm »
yes but I don't want an MCU in the design, this is strictly non MCU I've already designed an MCU version but feel like flexing the analogue muscles
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19895
  • Country: gb
  • 0999
Re: creating a pulse on state change with a comparator
« Reply #3 on: November 27, 2010, 01:45:58 pm »
I don't know why anyone would use an MCU for such a simple task when it's likely to be more expensive.

I'd probably use the CD4013 or its HC equivalent, a resistor, diode and a capacitor.

It should be possible to use a comparator though.

A hex inverter logic IC is another possibility.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18017
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: creating a pulse on state change with a comparator
« Reply #4 on: November 27, 2010, 02:13:12 pm »
erm forgot to specify I am talking about a single impulse, which would need to reset and got again should another high to low transition occur
 

Offline DaveW

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: gb
    • WattCircuit
Re: creating a pulse on state change with a comparator
« Reply #5 on: November 27, 2010, 02:36:48 pm »
How accurate does the pulse need to be? A 555 monostable can be triggered with a midpoint comparator, and can produce ms second pulses (think it can go down to 10uS or so)?
If not, putting the pulse into the set input of an RS FF, and then a delayed pulse into the reset can work well-can use a series of not gates to provide a delay down to very high accuracy/repeatability. Although you'll probably get more drift that using an MCU with a good xtal oscillator
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18017
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: creating a pulse on state change with a comparator
« Reply #6 on: November 27, 2010, 02:42:53 pm »
Well accuracy is not  problem as it's to trigger a latch relay so 30-50 ms range is fine. my intention was to keep it very simple but perhaps that's not possible.

I have the MCU design (but yet to be verified) but wanted to see if I could do it all in discrete parts.
 

Offline armandas

  • Frequent Contributor
  • **
  • Posts: 336
  • Country: jp
    • My projects
Re: creating a pulse on state change with a comparator
« Reply #7 on: November 27, 2010, 03:03:09 pm »
my intention was to keep it very simple but perhaps that's not possible.

It is possible. You can do it with three components: monostable multivibrator, resistor and a capacitor.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18017
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: creating a pulse on state change with a comparator
« Reply #8 on: November 27, 2010, 03:12:58 pm »
right, basically the total operation I'm looking for is as follows: two pulse generator circuits (single shot) when the voltage transitions from low to high I will get a pulse from one circuit, when it transitions from a high to low I will get a pulse from the other one.

I'll have to have a think and a tinker I think, as I'm already using comparators I was hoping to use a stage from a quad chip
 

Offline Time

  • Frequent Contributor
  • **
  • Posts: 725
  • Country: us
Re: creating a pulse on state change with a comparator
« Reply #9 on: November 27, 2010, 07:13:57 pm »
Monostable multivibrators that I have used only send pulses on rise or fall edges and not both.  Something tells me there is something in AoE that would help with this though.
-Time
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1447
  • Country: us
  • Very dangerous - may attack at any time
Re: creating a pulse on state change with a comparator
« Reply #10 on: November 27, 2010, 07:39:26 pm »
I think the 74HC123 dual retriggerable monostable multivibrator can do what you need.

http://www.nxp.com/documents/data_sheet/74HC_HCT123.pdf
 

Offline qno

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: nl
Re: creating a pulse on state change with a comparator
« Reply #11 on: November 27, 2010, 09:49:44 pm »
You could do this by putting the pulse on the + input of the comparator and use an RC network to delay the pulse. Feed the capacitor voltage back to the - input.

You have 2 problems.
You need a pulse lower than the supply voltage of the comparator. Or else your comparator will never switch back, or you could divide down the pulse voltage or clip it with a zener or bandgap.
Your pulse must remain high during the complete delay time.

If you have a short pulse you do AM or Peak detection.
Put the pulse voltage in a capacitor via a diode and feed this in the +of the comparator.
Put a ref voltage on the - and adjust it for the right time. You can also use a discharge resistor over the capacitor or over the diode.
Why spend money I don't have on things I don't need to impress people I don't like?
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19895
  • Country: gb
  • 0999
Re: creating a pulse on state change with a comparator
« Reply #12 on: November 28, 2010, 10:04:05 am »
I think the 74HC123 dual retriggerable monostable multivibrator can do what you need.
http://www.nxp.com/documents/data_sheet/74HC_HCT123.pdf

Agreed, that looks like the simplest solution so far. Also note the price, it's much cheaper than even the cheapest MCU and is why such components are still used for simple circuits.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf