All About Circuits Forum  

Go Back   All About Circuits Forum > Electronics Forums > General Electronics Chat

Notices

General Electronics Chat Discussion forum for general chat about anything electronics related, including asking questions about material in the All About Circuits E-book, Worksheets, and Videos.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 08-21-2011, 04:22 PM
HDAV HDAV is offline
Junior Member
 
Join Date: Aug 2011
Posts: 43
Default Detecting short pulse help please

Hi everyone my first post so please be gentle.

I have a system that generates an event from a trigger the trigger is the closing of a small switch.

The problem is the switch/sensor only closes for a short period of time. The electronics that detect the pulse detect it as part of existing device (the device has GPIO available). Which are used "sense" the event switch closing.

The issue is that the detection of the closure is unreliable, we believe that this unreliability comes from the "sampling of the GPIO" which occurs at about 120hz (this is done by software) the software was modified to to sample at 1Khz (polling the GPIO at 1khz) but we think the GPIO are locked in firmware of the device to 120Hz detection (does this make sense?)

The process does work but isnt reliable enough (worked 3 time out of 3 then 1 out of 4) What i need to do is extend the output of the switch pulse at the moment the time the switch is closed for is short <10ms if we can modify the output to be closer to 100ms then the "sense will be more reliable"

My first thought was an SR flip flop which will work or a 555 based timer or any sort of latching circuit. the issue is the size of the solution.

If possible we want to avoid any IC components and keep the components down to 2 or 3 legged items.

One idea is to use a small capacitor that is charged by the switch closing but discharges slowly through a resistor? but struggling with the design can anyone help?

Some information about the system:

Power is 12V DC
Sensor is a mechanical switch NO (push to make)
Devices has opto isolated inputs available
Current system has 12V->switch->Device input

Challenge for the analogue experts out there can this be done with maximum 3 additional components? Was thinking Capacitor and Diode in series where capacitor charges quickly when switch closed but discharges slowly when switch returns to open?

Thank you for taking the time to read this and I appreciate any advice offered. Many thanks.
Reply With Quote
  #2  
Old 08-21-2011, 04:28 PM
praondevou's Avatar
praondevou praondevou is offline
Senior Member
 
Join Date: Jul 2011
Location: Canada
Posts: 2,876
Default

Quote:
Originally Posted by HDAV View Post
Devices has opto isolated inputs available.
Does that mean the input signal HAS TO drive an optocoupler? If so, what's the current needed to drive it ON?

Can one side of the switch be connected to either positive voltage or GND?
Reply With Quote
The Following User Says Thank You to praondevou For This Useful Post:
HDAV (08-21-2011)
  #3  
Old 08-21-2011, 04:49 PM
HDAV HDAV is offline
Junior Member
 
Join Date: Aug 2011
Posts: 43
Default

Good question: The specs for the detection on the device input is:
Uin(high) = 3 V...24 V
Uin(low) = 0 V...1.5 V
I believe the Opto coupling is to prevent damage to the device and allow it to use a range of voltage and currents as an input, the actual functional input is to Schmitt trigger inside the device

Parameter Value
Uin (low) 0 V ... 1.5 V
Uin (high) 3 V ... 24 V
Current (constant current source
within the device) 8 mA
Flux voltage of the LED (@ 10 mA) 1.5 V

The device use a and LED to an op to sensor to transfer the trigger from external voltage to the internal logic (so yes it does need to drive the internal LED.

Last edited by HDAV; 08-21-2011 at 04:58 PM.
Reply With Quote
  #4  
Old 08-21-2011, 05:21 PM
HDAV HDAV is offline
Junior Member
 
Join Date: Aug 2011
Posts: 43
Default

Quote:
Originally Posted by praondevou View Post
Can one side of the switch be connected to either positive voltage or GND?
Good thinking use a capacitor to charge the trigger which has a charging delay of Xms then if the switch grounds (discharge capacitor through resistor) then the input would stay low for Xms

Is this the sort of thing you were thinking? the "trigger signal would need to stay below 1.5V for 0.01 seconds but would need to discharge to 0V in 0.001 seconds so we are looking for a factor of 10 delay?

Can this be simply implemented?
Reply With Quote
  #5  
Old 08-21-2011, 10:03 PM
HDAV HDAV is offline
Junior Member
 
Join Date: Aug 2011
Posts: 43
Default

Attached is the output of a similar sensor tested on a scope the actual sensor pulse I dont yet have
Attached Images
File Type: jpg pulse.jpg (28.8 KB, 7 views)
Reply With Quote
  #6  
Old 08-21-2011, 10:14 PM
SgtWookie's Avatar
SgtWookie SgtWookie is offline
Expert Member
 
Join Date: Jul 2007
Location: In the vast midwest of the USA; CST
Posts: 21,996
Default

Well, I had the attached simulation kicking around that might be useful for you...

Since your inputs are Schmitt triggers, you wouldn't need the 555; just the two resistors, the cap and the switch. The switch I used in the simulation works like a relay.

R1 is in there to keep the switch contacts from getting burned, along with avoiding putting a large transient on the power rails.

Adjust values to suit your application. I don't know what your Schmitt-trigger levels are.
Attached Images
File Type: png 555 Schmitt RC Switch.png (115.7 KB, 22 views)
__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.
Reply With Quote
The Following User Says Thank You to SgtWookie For This Useful Post:
HDAV (08-21-2011)
  #7  
Old 08-21-2011, 11:05 PM
HDAV HDAV is offline
Junior Member
 
Join Date: Aug 2011
Posts: 43
Default

Thankyou Sgt Wookie, can i ask a couple of dumb questions about your simulation please?

In the simulation the switch which is S1? is used to trigger the 555? the R1 R2 C1 gives the purple trace (trigthrs) on the graph which drops down to 1.5V ish the steadily rises?

S1 is normally open? and when closed grounds the trigger input?

I have downloaded LTspice and tired to come up with a simulation, is there a way to put a switch in other than the volt controlled switch you used?

As for the schmitt levels they are i believe derived from the opto unit
Parameter Value
Uin (low) 0 V ... 1.5 V
Uin (high) 3 V ... 24 V

Triggers
All inputs configured as triggers are linked by AND. If several inputs are being
used as triggers, a high signal must be present on all inputs in order to generate
a trigger signal. Each signal can be inverted.

Last edited by HDAV; 08-21-2011 at 11:22 PM.
Reply With Quote
  #8  
Old 08-21-2011, 11:31 PM
ErnieM's Avatar
ErnieM ErnieM is offline
Senior Member
 
Join Date: Apr 2011
Location: Lon Guyland, Noo Yawk
Posts: 4,742
Default

You already have flip flops built into your device (assuming it is a PIC).

The first way is to use an Interrupt On Change (IOC) bit, which will fire when there is a change giving you an immediate check of the pin just after it changed.

Another way is to use the I/O pin to drive one of the timer registers as the clock; clear the timer, and check if it is not zero in your loop.

As far as it being a 10V pulse: not a huge problem. Just isolate with a 50K or so resistor after making sure the input you drive has the ESD suppression diodes. Then a 10V pulse will be current limited, but still input a 5V (or whatever Vdd is) pulse to the device.
__________________
“Freedom is never more than one generation away from extinction. We didn’t pass it to our children in the bloodstream. It must be fought for, protected, and handed on for them to do the same, or one day we will spend our sunset years telling our children and our children’s children what it was once like in the United States where men were free.”
Reply With Quote
  #9  
Old 08-21-2011, 11:59 PM
SgtWookie's Avatar
SgtWookie SgtWookie is offline
Expert Member
 
Join Date: Jul 2007
Location: In the vast midwest of the USA; CST
Posts: 21,996
Default

Quote:
Originally Posted by HDAV View Post
Thankyou Sgt Wookie, can i ask a couple of dumb questions about your simulation please?
Not dumb questions; just questions.

Quote:
In the simulation the switch which is S1? is used to trigger the 555?
S1 represents your switch. It's normally open, and closes for just a short period of time; a couple of milliseconds.
Quote:
the R1 R2 C1 gives the purple trace (trigthrs) on the graph which drops down to 1.5V ish the steadily rises?
Yes. The capacitor C1 charges relatively quickly, as R1 is a very low value compared to R2. If the switch stayed closed longer, the voltage on C1 would eventually reach nearly 1/48th of 12v, or 250mV.

Quote:
S1 is normally open?
Yes.
Quote:
and when closed grounds the trigger input?
Yes.

Quote:
I have downloaded LTspice and tried to come up with a simulation, is there a way to put a switch in other than the volt controlled switch you used?
Not really. LTSpice is not interactive in that manner. Basically, you set up an analog simulation, then run it, and when it's done, you view the output. If you want parameters to change during the simulation run, you need to set them up beforehand.

There IS a somewhat limited simulation available online where you can see things occurring in (more or less) real time, or slowed-down real time, which is handy for demonstrating things - but its' accuracy is rather dubious.

That simulator is available here: http://www.falstad.com/circuit/
You will need to have Java installed to use it.

Quote:
As for the schmitt levels they are i believe derived from the opto unit
Parameter Value
Uin (low) 0 V ... 1.5 V
Uin (high) 3 V ... 24 V

Triggers
All inputs configured as triggers are linked by AND. If several inputs are being
used as triggers, a high signal must be present on all inputs in order to generate
a trigger signal. Each signal can be inverted.
Hmm. Well, then the charge should be limited to around 4.5v in order to have a roughly 1/3-2/3 threshold swing. Not very difficult to implement with a Zener and resistor.
__________________
General info:
If you have a question, please start a thread/topic. I do not provide gratis assistance via PM nor E-mail, as that would violate the intent of this Board, which is sharing knowledge ... and deprives you of other knowledgeable input.

Last edited by SgtWookie; 08-22-2011 at 12:12 AM.
Reply With Quote
The Following User Says Thank You to SgtWookie For This Useful Post:
HDAV (08-22-2011)
  #10  
Old 08-22-2011, 12:05 AM
HDAV HDAV is offline
Junior Member
 
Join Date: Aug 2011
Posts: 43
Default

Quote:
Originally Posted by ErnieM View Post
You already have flip flops built into your device (assuming it is a PIC).

The first way is to use an Interrupt On Change (IOC) bit, which will fire when there is a change giving you an immediate check of the pin just after it changed.

Another way is to use the I/O pin to drive one of the timer registers as the clock; clear the timer, and check if it is not zero in your loop.

As far as it being a 10V pulse: not a huge problem. Just isolate with a 50K or so resistor after making sure the input you drive has the ESD suppression diodes. Then a 10V pulse will be current limited, but still input a 5V (or whatever Vdd is) pulse to the device.
Thanks the Device is probably similar to a PIC (its a fairly high spec micro processor) but its a stand alone unit which offer I/O that are available in software, the software has been written to use the device triggers.

All we need to do is make the trigger reliable. We are sure the physical trigger works but the pulse is too short for the I/O to detect (proven by sporadic detection). It would be possible to modify the device but the cost and hassle of getting a major manufacturer to modify the firmware for one unit is likely to astronomical!

I am trying to run a spice simulation but struggling with how to simulate the short pulse?

This is a small part of a larger project and I am just struggling with the various constraints.

Thanks to everyone that has offered some input please keep it coming
Reply With Quote
Reply   Post New Thread

Tags
, ,


Related Site Pages
Section Title
Worksheet Design Project: Event counter
Worksheet Thyristor application circuits
Worksheet BJT amplifier troubleshooting
Textbook The "operational" amplifier : Operational Amplifiers
Textbook Field-effect-controlled thyristors : Thyristors
Textbook Parallel-in, parallel-out, universal shift register : Shift Registers
Textbook Monostable multivibrators : Multivibrators
Textbook 555 Schmitt Trigger : 555 Timer Circuits
Textbook The common-emitter amplifier : Bipolar Junction Transistors
Textbook Logic signal voltage levels : Logic Gates


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulse Charging SLA Batteries survivalsys Off-Topic 11 05-20-2011 02:32 AM
Help with Pulse Counter that outputs one pulse per n-pulses tuscarora The Projects Forum 18 03-09-2010 07:20 PM
Help converting long pulse to short pulse. Holder350 The Projects Forum 6 01-17-2010 08:13 PM
LM555 Timing and Pulse Width Modulation 1337Hendrix The Projects Forum 6 12-02-2009 07:40 PM
C++ header files Ryno3030 Programmer's Corner 5 12-06-2007 03:46 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:06 PM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.