0
\$\begingroup\$

I'm using some Schmitt-trigger inputs for debouncing the interrupt problems.

enter image description here Referring to above circuit, the circuit has a RC circuit and the output of the RC circuit goes to the Schmitt-trigger IC(74HC14). Also, I soldered like this circuit and the look is like as below picture.

enter image description here

Well, the picture is not good I apologize for the view. (18k : R1, 2k : R2, 0.1u : C1)

Anyway, I'm convinced of the equality of the circuit picture and the real one. However there is a very small issue.

The output of the Schmitt-trigger IC is connected to the MCU interrupt pin. So, if the Schmitt-trigger output goes to low(I use falling-edge-triggered interrupt), the MCU will run some ISR. Suppose I "bring(NOT push the button)" my hand to control the device on my own. At most, the device not malfunction. However, very occasionally the device goes to interrupt mode(ISR).

The schmitt-trigger goes to MCU(ATmega2560, STM32F411RE, and so forth) and the MCU has some attached interrupts that can respond for the some schmitt-trigger inputs. And if the problem occurs, MCU just execute some ISRs. I thought the problem is occurred by the ESD so I used some TVSs and collected all the GNDs as near as the SMPS input, but the issue is not entirely solved. The problem hardly happens(probably just one time of a day) so this wouldn't be important one, but what could be the cause of this situation? Could I get some intuitions for the issue and the solutions?

\$\endgroup\$
  • 1
    \$\begingroup\$ It's unclear what your problem is. Could you elaborate on the sentence "Very sometimes, the Schmitt-trigger seems to be fluctuated by somewhat effective situation."? I can't understand what you're saying there. \$\endgroup\$ – Hearth Feb 16 at 4:58
  • \$\begingroup\$ @Hearth I apologize for the ambiguous statement. The output of the Schmitt-trigger IC is connected to the MCU interrupt pin. So, if the Schmitt-trigger output goes to low(I use falling-edge), the MCU will run some ISR. Suppose I "bring(NOT push the button)" my hand to control the device on my own. At most, the device not malfunction. However, very occasionally(as written above, just one or less for a day) the device goes to interrupt mode(ISR). This is my 'problem' which I want to talk about. \$\endgroup\$ – Chanho Jeon Feb 16 at 5:05
  • 1
    \$\begingroup\$ Are you actually using a 7414? Not a 74LS14, 74HC14, or any other family? \$\endgroup\$ – Edgar Brown Feb 16 at 5:37
  • \$\begingroup\$ @EdgarBrown I added the information about 7414 at the article, and I'm using the 74HC14 @ 5V Vcc. \$\endgroup\$ – Chanho Jeon Feb 16 at 5:38
1
\$\begingroup\$

Your awareness of stray ISR resets, tells me you have an EMI problem.

It can be caused by stray E-fields, modulated by your hand that acts as an antenna and variable capacitor to couple line E fields near a floating supply voltage used on MCU.

Although 0.1uF seems low impedance, the thin wires also raise ground impedance, so the distance to MCU can be important and RF broadcast signals can also combine with this interference. Often Common MOde (CM) noise converts to Dff. Mode (DM) noise by unbalanced impedance of signal and reference. (supply)

To reduce stray E-fields; typically, ground planes, shielding , ferrite beads, twisted pair wires, using tighter/smaller layouts to reduce loop area are some methods used and use lower impedance sensors.

\$\endgroup\$
  • \$\begingroup\$ I measured the magnetic field value now(I have no e-field sensor...), and the buttons are placed near the SPDT relay(which gets 60Hz current transformer input). The measured value is somewhat higher than the value of other parts(at least 2 times). In my university I learned that magnetic field is very closely related to the electric field. Will moving the relay to far from the buttons solve the issue or relieve the problem? \$\endgroup\$ – Chanho Jeon Feb 16 at 6:14
  • 1
    \$\begingroup\$ A high impedance measures e-fields from long wires, low impedance inductive loops measure B. Distributed capacitance is twisted pair of 100pF/m. Or if Earth ground is available, connect with 1nF to 100nF to 0V. Yes Relay dV/dt or dI/dt can be clamped and reduced with twisted pair and route at right angles \$\endgroup\$ – Sunnyskyguy EE75 Feb 16 at 6:17
1
\$\begingroup\$

As @Sunyskyguy says, you have an EMI problem. Very likely due to your perforated board construction and the distance between components. Enough of a stray field can be induced into those long wires to cause some problems.

Without a proper PCB it could be hard to avoid, but here are a couple of things that you can do to reduce the likelihood of the problem:

  1. Make sure to have a low inductance connection between the ground of the 74HC14 and the MCU. Place these as close as possible, with as thick a wire as possible.
  2. Make sure to have a ~100nF decoupling capacitor for the 74HC14 power supply. Directly on its pins.
  3. Place the debouncing capacitor as close to the 74HC14 as possible. This will serve to filter any EMI coupled into the wiring.
  4. Optionally, add a zener or TVS before the capacitor. This will serve to dissipate any ESD energy before it hits the ICs.
\$\endgroup\$
0
\$\begingroup\$

I would avoid this whole problem by doing the debouncing in software. There are several subroutines for this on https://playground.arduino.cc/Main/LibraryList#IO_buttons That, to me, is the correct way to solve the problem. Requires no external components beyond the switch. You can set INPUT_PULLUP for the pin to eliminate the pullup resistor.

"The cheapest and most reliable parts are those which are not there." - Gordon Bell (designer of the PDP-11)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.