Trigger event too fast - Page 1
Forum section: electronics / beginners

author: Wuahn
author_rank: Newbie
timestamp: August 23, 2015, 07:11:52 pm
content: I have purchased two Adafruit components, the IR Break Beam Sensor (PID 2168) and the Audio FX Sound Board (PID 2133). Basically, when the IR beam is interrupted, it grounds a trigger pin on the Audio FX module which plays a PCM wave file. This is for a game in which you throw bean bags through a hole. When the bean bag breaks the beam, it plays a sound.The setup works but the Audio FX board does not detect the grounding of the trigger pin if it happens too quickly. Not only is this happening with the bean bags, but you can replicate the problem on the audio board directly using test probes. If you ground and release quickly enough, it does not trigger. For example, let's say that the Audio FX Board takes 30 ms to detect that a trigger pin has been grounded, but a well-aimed bean bag can pass through the IR break beam sensor in only 20 ms. The end result is that sometimes it triggers and sometimes it doesn't.I've already posted on the Adafruit forums and received several responses but nothing basic enough for my experience level (pulse stretchers?). This project is a gift that will be presented next weekend, so I'm running out of time. I'm a fan of Dave's videos on YouTube so I thought I'd cast my net here as well.Is there a simple way to extend this trigger/grounding event? Capacitors, diodes, and relays maybe?Thanks for your help.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: August 24, 2015, 03:53:03 am
content: Monostable multivibrator?http://www.electronics-tutorials.ws/waveforms/monostable.htmlPerhaps using a 555 timer?http://www.electronics-tutorials.ws/waveforms/555_timer.html(scroll down)

author: rt
author_rank: Regular Contributor
timestamp: August 24, 2015, 05:14:09 am
content: Quoting from the Adafruit documentation for the Audio FX board:https://learn.adafruit.com/adafruit-audio-fx-sound-board?view=all#triggering-audio"When the # pin is connected to GND for more than about 50 milliseconds it will trigger! There is a 100K pull up resistor on each one, so you do not need any extra resistors or pullups."So you need to get the pulse to at least 50ms for reliable triggering.As stated above, start with 555 monostables.

author: Zero999
author_rank: Super Contributor
timestamp: August 24, 2015, 09:06:52 am
content: The 555 will work but there are better ICs around.The 74HC123 is perfect for this.http://www.nxp.com/documents/data_sheet/74HC_HCT123.pdf.EDIT:It also come in a single version, if you want to save space.http://www.nxp.com/documents/data_sheet/74LVC1G123.pdf

author: KerryW
author_rank: Regular Contributor
timestamp: August 25, 2015, 01:54:02 am
content: You could try putting a backstop behind the hole. The bean bag will hit it and fall to the ground. That should break the beam for plenty of time.

author: LukeW
author_rank: Frequent Contributor
timestamp: August 25, 2015, 03:28:34 am
content: You could simply try a capacitor on the signal to "stretch" the time that it spends below the low threshold.Combined with the 100k pull-up resistor, a 470nF capacitor will give you a 47 ms time constant.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: August 25, 2015, 05:36:31 am
content: Quote from: KerryW on August 25, 2015, 01:54:02 am!!Best answer so far!!

author: leblanc
author_rank: Regular Contributor
timestamp: August 26, 2015, 05:31:13 pm
content: Maybe something like this would work for you.1: Easiest solution. When the input goes from low to high, the capacitor will slowly charge up, so your output will have a slow rising edge. Many ICs can't tolerate rising/falling that are too slow. If this is the case, see solution 2. On the falling edge, the only delay is the diode reverse recovery time, which is in the order of a few nanoseconds.2: The same as 1, but the schmitt trigger will wait for the capacitor to charge/discharge to a threshold and snap to Vcc or ground (so your edge is fast). The schmitt trigger adds a trigger propagation delay to your falling edge (so the reverse recovery time of the diode plus the schmitt trigger propagation time). If this propagation time is too large, see solution 3. If the schmitt trigger is open drain, don't forget a pull-up resistor at the output.3: Speeds up the propagation by allowing the falling edge of the input to drive the output (through the diode). The propagation time is then just the diode reverse recovery time. 3A uses an open drain schmitt trigger, 3B uses a push-pull schmitt trigger.To calculate the values of the RC for a desired t_delay (trigger width), chose them so thatRC = -t_delay/ln(1-V_TH/Vcc)where V_TH is the high threshold voltage of the schmitt trigger.For example, for a Vcc of 3.3V, a V_TH of 2.7V, a delay of 1ms can be obtained with RC = 5.866e-3. You may chose something like C=560nF and R=1kOhm.