Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

positive/negative edge detection

Status
Not open for further replies.

raviram87

New Member
hello people...

i want to build a circuit that accepts an analog input and does the following...

(1). If the incoming analog signal has a rising edge first (irrespective of the next edges), then do a specifc thing (say produce a HIGH voltage)
(2). If the incoming signal has a negative edge first (irrespective of the edges that come next), then do a specific thing (say produce a LOW voltage)
 
Use a comparator (swap 0V and signal between inverting and non-inverting inputs to change between rising/falling) and use a time delay or pulse circuit or flip-flop (which will ignore the events that happen next within a certain time period or until it resets).

Instead of a comparator, you may also use a D-flip-flop (with or without an inverter at the input depending on rising/falling).
 
thanks for the help again...

about the d flip-flop part, i should give my signal to the clock input right? will the flip-flop accept an analog input?
 
Yeah, you feed your signal into the D-flip flop block and the data input for the DFF is the state you want it to go to when it detects an edge.

But you make a good point about accepting an analog signal. Assuming the analog signal is within operating range of the DFF, if it is too slow it would cause the signal to spend too much time between the input LO and HI threshold voltages. And since your signal is bipolar, it will never be in range (I've never seen a bipolar logic gate...). So I guess you have to use the opamp with bipolar supplies.

A transition from low to high is good enough to approximate a rising edge in most cases. But what you might be able to do is to follow the op-amp with a DFF. THen the DFF will detect the rising edges of the comparator AFTER they have been changed from bipolar to unipolar by the comparator. BUt I don't think that is necessary unless you lack other "intelligent" parts of your circuit circuits to only accept HI values AFTER a LO value, and reject continously high values. THe DFF will do this for you if you do not have them.

SOrry about my mistake.
 
Last edited:
does it mean to say that if i get a d flip flop whose specifications are such that the input voltage falls within its specified range.... it will function accordingly???

and abt the comparator... i have a LM339 type comparator.... are its outputs digital?? means +5V and 0 ???
 
raviram87 said:
(1). If the incoming analog signal has a rising edge first (irrespective of the next edges), then do a specifc thing (say produce a HIGH voltage)
(2). If the incoming signal has a negative edge first (irrespective of the edges that come next), then do a specific thing (say produce a LOW voltage)

I think that you need to build a differentiator. This is an analog circuit that puts out a positive voltage when the input waveform is rising, and a negative output when the input voltage is falling. It does not matter what voltage the input has, just whether it is rising or falling, and how fast.

Is this what you need?
 
Last edited:
yes...

if u see the image below....

the output is zero initially... when a certain trigger is given to the circuit, the input rises, falls down and again reaches a constant 0 level....

i identify the first rising edge alone and conclude it is caused due to that particular trigger alone..... i do not want the circuit to react to any other rising edges in the output.... only the first

what i need to do is once this is observed at the output, i need to do a specific thing (as say producing a high voltage)....
 

Attachments

  • Image1.jpg
    Image1.jpg
    323.6 KB · Views: 1,326
the positive peak is of the order of around 0.5 V and so is the negative peak....

i want to detect only the first edge.... nothing after that....
 
i tried building the circuit with LM139 type comparator.... but i couldn get favourable results...

wat i did was... i used two comparators with the input signal being applied to the inverting input of one, while to the non-inverting input of the other comparator... the reference input was given as 0.5V...

can i acheive my objective by using a differentiator with a long enough time constant?? by using a high velue of R and C????
 
Use a strobed OpAmp. This will take care of ignoring further pulses to arrive at the input.
 
thanks...

but i am hearing the term strobed op-amp for the first time... where can i get more info about it?

and how abt the differentiator idea.... if u see image 1 that i have attached in one of my previous posts in this topic.... the signal is initially 0 and then rises... so the slope will be positive.... if i choose the value of RC (in the differentiator) pretty high... then i can get the slope of the rising edge....

can i use any other such ideas?
 
the output of the circuit remains at 0...

on recieving a trigger, there is a positive pulse followed by a negative one and the output settles back to 0....

both the pulses have a width of around 500ms....
 
if i use a schmitt trigger for my application.... then i will be converting the output (shown in image 1 in the attchments in previous posts) into a clean sqaure wave...

if thats the case how can i proceed next?
 
raviram87 said:
if i use a schmitt trigger for my application.... then i will be converting the output (shown in image 1 in the attchments in previous posts) into a clean sqaure wave...

if thats the case how can i proceed next?
hi,

Post a diagram on how you have connected your comparator circuit, if wired correctly it should give a sharp rising edge when it detects the positive swing on the input signal.

The dual LM393 is commonly used in applications like yours.

Regards
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top