LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using a relay what is best way to generate a ttl pulse for a digital trigger

I have a daq brd. and accessing a relay contact closure to hopefully generate a dig trigger input to the daq. Any suggestions on best device to use, as relay bounces and gives more than 1 trigger. Freq of contact closure is anywhere from 1 min to 10 min. Thanks for any help.
0 Kudos
Message 1 of 11
(4,607 Views)
I am not an expert in this, but what do you think a optical sensor to replace the mechanical relay? Or, programmatically filter-out the transient effect of the mechanical relay?

Just something to ponder... hope that i am not making a fool of myself 😛
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 2 of 11
(4,607 Views)
A simple RC filter may suffice if you do not mind a little latency. The trick is picking a value for C that is large enough to filter out any bounce, and yet small enough as to not cause unreasonable delay.
0 Kudos
Message 3 of 11
(4,607 Views)
In article <50650000000500000091AA0000-1031838699000@exchange.ni.com>,
"ian.f" wrote:

> I am not an expert in this, but what do you think a optical sensor to
> replace the mechanical relay? Or, programmatically filter-out the
> transient effect of the mechanical relay?
>
> Just something to ponder... hope that i am not making a fool of myself
> 😛


I don't think you're making a foolish comment, Ianp. In one of my
applications I'm forced to use a relay between a digital input (pulled
high) and a digital ground. A mechanical switch will be used in our final
product so this is how I must simulate it. You're right about the bounce.
I think I add a 50 to 100 ms delay before taking reading. The easiest
way to test it is to build a loop: cl
ose relay, programmable delay, take
an digital input reading, open relay, fixed delay (like 1 second so you
can look at the results). The programmable delay can be varied from the
front panel.

That's kinda what I did. I think magnitude of bounce is dependent upon
the voltage used to charge it's inductor coil. If you could drop the
voltage a little, you may see a bounce reduction. Well, there's my
foolish comment.

- Kevin
0 Kudos
Message 4 of 11
(4,607 Views)
Hello,

I can tell you exactly how to do this. I've done it with a combination of an RC filter and an inverter. Here's what you need:
1. your relay
2. 5V supply
3. 1K ohm resistor
4. 22 ohm resistor
5. 10 microfarad capacitor
6. 7414 inverter chip
Here's what to do:
1. Connect one end of the relay switch to ground and the capacitor.
2. Connect the other end of the relay to the 22 ohm resistor.
3. Connect the other end of the 22 ohm resistor to the 1K ohm resistor, the other end of the capacitor, and an input of the 7414.
4. Connect the other end of the 1K ohm resistor to +5V.
5. Read the inverted 7414 output as your TTL trigger.

The idea behind this is the filter gives you a somewhat gradual high to low change, and the inverter reads that and
gives you a low-to-high TTL trigger.

Let me know if you don't follow this. I could FAX you a schematic, or possibly break down and draw it up in Visio and attach a file.

Best Regards,

Doug Norman
0 Kudos
Message 5 of 11
(4,607 Views)
Thanks for your help. Your solution is exactly the type I was looking for. I have attached a sketch of how I interpret the circuit, as you described. Is it correct? Also, I'm an old technician rather than Eng. so was wondering about powering the 7417 vcc. Is it just 5v or ? Thanks again, I've struggled a little with this.
0 Kudos
Message 6 of 11
(4,607 Views)
Ian, thanks for taking the time to help.
0 Kudos
Message 7 of 11
(4,607 Views)
digger wrote in news:50650000000800000051610000-1031838699000
@exchange.ni.com:

> I have a daq brd. and accessing a relay contact closure to hopefully
> generate a dig trigger input to the daq. Any suggestions on best
> device to use, as relay bounces and gives more than 1 trigger. Freq
> of contact closure is anywhere from 1 min to 10 min. Thanks for any
> help.
>

If hardware is an option, why not just debounce the relay output. If I
remember, crossing two NAND gates should debounce the input. Look up
debounce in Horowitz and Hill, "the art of electronics

--
Scott
Reverse first field of address to reply
0 Kudos
Message 8 of 11
(4,338 Views)
😛
I didn't help much. Glad that someone else is providing you the solution.

Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 9 of 11
(4,607 Views)
Your sketch is perfect. Yes, you power the 7414 with 5V. The 7414 actually has 6 inverters on it. If you connect the "7414 INPUT" from your sketch to pin 1 of the 7414, you would then use pin 2 of the 7414 as your output (trigger). Pin 14 of the 7414 gets the 5V and pin 7 is ground. A quick web search on 74LS14 will yield pinouts for you.

Regards,

Doug Norman
0 Kudos
Message 10 of 11
(4,607 Views)