Protecting a CMOS gate input

, If a long unshielded cable to the pushbutton is used, it is going to pick up RFI, especially since the pushbutton is open circuit most of the time.

Make sure you bypass any RF entering rom the cable into your device, before it hits any semiconductors. Do not let the RF current circulate around the PCB, filter it out close to the cable socket. These days the low pass filter should work well for at least from 0,1 MHz to several GHz to get rid of any AM broadcast and smart phone signals.

The GSM cellular phone signal is TDMA and if is rectified in an oxidized cable connector or some protection diodes, it will generate a square wave of a few hundred Hertz, which could misfire the flip-flop.

Reply to
upsidedown
Loading thread data ...

The FF has at least 4V of noise immunity. That would take quite the cell phone. ;)

Cheers

Phil Hohhs

Reply to
pcdhobbs

phone. ;)

Won't the signal induce a current proportional to the loop size so that the resulting voltage will then be dependent on the input resistance? The dev il is always in the details. That's why experts get called in to solve the se sorts of problems. Often it is not a matter of black magic, but of bein g meticulous.

The circuit is running from 12 volts, so lots of noise margin, but also the circuits are high impedance. Damned if you do, damned if you don't.

--

  Rick C. 

  -+- Get 1,000 miles of free Supercharging 
  -+- Tesla referral code - https://ts.la/richard11209
Reply to
Ricky C

Using an ADC is a valid way to read button states, too. I can take a 8 pin AVR with 3 or 4 ADCs on board and an LM324 to buffer the voltage and protect whatever is on the other side and multiplex 15 or 20 buttons, using the buttons to switch in resistors in a divider to the ADCs and thresholds set in software.

A moving-average filter/sample binning + state machine prevents any bounce-glitches it's a very solid arrangement.

Reply to
bitrex

Er, protect the uP inputs, getting my circuits confused :)

Reply to
bitrex

I thought I'd place a resistor across the switch contacts, high enough not to cause triggering, low enough to prevent static build-up.

Reply to
Pimpom

I'm more worried about when the cable is plugged in. I recall plugging in audio jacks to music amps and getting the big hum blast. The guy whose equ ipment it was would yell at me.

I guess cabling problems are more of a problem when dealing with cabling di fferent chassis together. Then you have ground differences and lots of thi ngs can be a problem. Plugging in a remote switch might be a lot less of a n issue if it isn't grounded to anything.

--

  Rick C. 

  -++ Get 1,000 miles of free Supercharging 
  -++ Tesla referral code - https://ts.la/richard11209
Reply to
Ricky C

For CD4013, the noise margin at Vdd=5 V is quoted as 1 V and at Vdd=15 V as 2.5 V.

Consumer electronics is suppose to withstand a 3 V/m field strength without malfunctioning.

A random wire several wavelengths long will capture about similar voltages as a 1/4 wavelength monopole. A 1/4 wave monopole at 900 MHz is about 0.1 m, so 3 V/m will induce 0.3 V into the wire. This is for the far field. When the transmitter is in the near field, the voltage can vary significantly.

Reply to
upsidedown

Choose your connectors wisely. Audio jacks have the nasty property that the signal connects before the ground. Stupid, but that's the way it is.

Jeroen Belleman

Reply to
Jeroen Belleman

I'd add another resistor from that set-up to the chip itself 1K-100K whatever is convenient

--
  Jasen.
Reply to
Jasen Betts

Ah, it's similar to the feeback debounce used with dual-inverter bistables. eg:

formatting link

But your circuit allows the switch be be connected to a power node at one end, which is a nice feature, also not free-running if the switch is held.

--
  Jasen.
Reply to
Jasen Betts

Yes. It would be worthwhile to use a resistor rated for several kV (some are inexpensive) or tested and found to usually survive and also not arc over and thereby carry more current than Ohm's law would predict.

By putting the incoming signal trace close to a big ground pour on the PCB and removing a small region of solder mask, you could make a spark gap that will arc over at a few kV to shunt the ESD before it reaches the series resistor, and provided the resistor can take more than the voltage at which the spark gap arcs over, the resistor ought to be safe. You can of course buy spark gaps and gas discharge tubes, if the parts budget permits.

Reply to
Chris Jones

Yeah. And as I explained further in reply to someone else, the circuit I'm actually using uses ground as Vdd and -12V as Vss so that one end of the switch will be at ground potential.

Reply to
Pimpom

Because you want the button signal to clock the flip-flop the RC filtering cannot be too aggressive else the clock input rise time will be too slow, I reckon CD4013 is good to few dozen us so here is my suggestion:

The 330 ohm gives a contact make current of 50mA to help clear oxide films and the 10k keeps 1.2mA flowing as long as pressed. In event of surge the 0.1uF cap absorbs most of the rise and the 100k in series with the clock input keeps the chip safe. Depending on the power supply rate of decay you may want to add the ? resistors to protect the chip esd diodes from the biggish caps.

piglet

piglet

Reply to
piglet

CMOS logic threshold is very roughly between 1/3 and 2/3 of VDD.

But you have to rectify it before it can cause logic problems in dog-slow 4000-series CMOS. Good luck getting volts of rectified signal from an input diode.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

=0

Not free running, but if the switch is held long enough the opening of the switch can also bounce and toggle the circuit back to the original state. Make the time constant very long to deal with this issue and that sets a li mit to the time before the FF state can be changed again.

The inherent limitation of this circuit is that the RC timer and FF are bei ng used to debounce the control, the FF is also being used to remember a st ate controlled by the debounced button. The circuit really needs two FFs, one to debounce and one to remember the state. Then the timeout can be as short as the max bounce period and no need to worry about how long a user h olds the button.

Rather than two FFs, a simple approach might be to use the RC on the switch input and a FF with a Schmitt trigger clock input. The RC will provide a slowly changing input which the Schmitt trigger input will accept without b ouncing. Tie the Qn to the D and you get transitions on every button press . The only issue is the RC delay is added to detection of the input change . For real world push buttons that's not normally an issue. For machine c ontrolled switches it may be a problem.

--

  Rick C. 

  +-- Get 1,000 miles of free Supercharging 
  +-- Tesla referral code - https://ts.la/richard11209
Reply to
Ricky C

You mean like this, to prevent toggling again on release?

^ | | R 1M | | | _|_ |-----| +---X X---+---------|> Q|------- | | | _| | | |---|D Q|---| | | | |-----| | | | | | === 1uF R 1K +------R------| | | | 100K | | === 1uF | | | |---------+-----+ | ----- --- -

Reply to
Tom Del Rosso

l=0

I don't think that is quite right. This way there is no debouncing of the voltage from the cap. The cap has to be on the clock input and then the re sistors need to be swapped. 1 second RC might be a bit long. 1K from the switch to ground with the switch feeding the clock input with 100K and 1.0u F to power. This requires a negative edge clock. Or run the switch to pow er and let the cap and discharge resistor go to ground.

The switch can be the only thing on the end of the cable and the switch res istor can be in the unit as the series limiting resistor.

^ | X | |=== X | | |-----| +--R1K--+----x---------|> Q|----- | | | _| | | |---|D Q|---| | | | |-----| | | |1uF | | R100K === +-------------| | | | | | | +----+ | ----- --- -

The time constant on the Qn feedback to the D is not needed at all then. T he RC does the debouncing (as long as the clock input is a Schmitt trigger) and the FF just needs to toggle.

Am I missing something?

--

  Rick C. 

  +-+ Get 1,000 miles of free Supercharging 
  +-+ Tesla referral code - https://ts.la/richard11209
Reply to
Ricky C

The CD4013 specifications require that the maximum rise time of the clock signal is 10us at VDD=10V and 5us at VDD=15V so I would assume that you need to meet 5us to be safe, for VDD=12V.

Depending on what series resistor you add, shunt capacitance etc. you may struggle to meet that, and it is worth checking. Also it may get worse over time if the switch contacts oxidise. If cost is not critical then you could add a Schmitt trigger buffer before the clock input.

Reply to
Chris Jones

That has a slow rise and a slower fall. The circuit I posted (which was one of a compendium of past SED toggle circuits that Win posted) has the problem of a slow fall-time if the button is held. I haven't seen any debounced toggle circuit that can drive the clock input within its spec, and also has adequate protection for an outside connection. They are mutually exclusive.

If it was me, I'd use a bipolar in addition to a resistor, cap, and zener diode for protection. A pair of biploars can provide the non-inverting logic that Pimpom needs, and a pair of bipolars can also have a little positive feedback to make it a Schmitt, and provide a very fast rise and fall to the FF. (values are just from mental calculation, so needs review)

^ ^ | | | | 1k 1k | | ^ | | | |----------------x | | | | | o | | x--------FF clock -| | | | | o | | | | 4.7k | c | | x-------b 1k | | e | | | | | | c | x----x----x---x----b | | | | e | | | | | | | | | | | 1k =10 ZD 1k | | |uf | | | | | | | | | | | | | V V V V V

But then I remembered the toggle made with only a Schmitt (I just added the 10k at the button, and split the lower 200k and added a cap for reset),

^ | | 200k | | Schmitt | o----10k----x---x-----|>o---x------- --| | | | o----x---------------1M-----| | | | | ^ | 180k | | .01 | | === x-------||-------| | | .01 | 20k | | +----------| | | v

and that means a discreet Schmitt can be a toggle by itself with no

4013.

I was about to modify the discreet circuit for that, but remembered there were already a few discreet toggles in Win's post.

It's probably best of all for ruggedness at the input and it can drive a load if the FET is big.

2002, Win Hill, 20A zero-power transistor + MOSFET switch (Zero power when off, low when on.) improvements by Jonathan Kirwan, SPICE by Terry Pinnell

Reply to
Tom Del Rosso

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.