Single Button On/Off Circuit with Delay

I'm trying to figure out a way to design an On/Off circuit that uses very l ittle power when off and requires holding the push button for two or three seconds before it accepts the change. A pair of CMOS gates/inverters can p rovide the low power two state circuit and a push button connected with a s imple capacitor/resistor arrangement will default to off on power up and al low toggling on the button press, but I can't seem to get it to delay prope rly.

It works ok if you allow enough time between button presses, but the charge on C2 acts as a memory recording the time since last activation. The butt on hold time is a lot less if you just changed states. Actually, must of t his seems to be from a bias current into the CMOS inverter. I'm guessing t his current is not as in a real part since it seems to be a resistor of 100 Mohm.

Version 4 SHEET 1 880 1380 WIRE -784 576 -800 576 WIRE -768 576 -784 576 WIRE -800 608 -800 576 WIRE -480 608 -560 608 WIRE -256 608 -480 608 WIRE -80 608 -176 608 WIRE 192 608 -80 608 WIRE -800 704 -800 672 WIRE -752 704 -800 704 WIRE -704 704 -752 704 WIRE -560 704 -560 608 WIRE -560 704 -624 704 WIRE -448 704 -560 704 WIRE -288 704 -368 704 WIRE -144 704 -176 704 WIRE -16 704 -144 704 WIRE 48 704 -16 704 WIRE 192 704 192 608 WIRE 192 704 160 704 WIRE -800 736 -800 704 WIRE -560 752 -560 704 WIRE -144 752 -144 704 WIRE -800 816 -800 800 WIRE -560 880 -560 832 WIRE -512 880 -560 880 WIRE -480 880 -512 880 WIRE -272 880 -304 880 WIRE -144 880 -144 832 WIRE -144 880 -272 880 WIRE -16 880 -144 880 WIRE 192 880 192 704 WIRE 192 880 48 880 WIRE -112 944 -128 944 WIRE -96 944 -112 944 WIRE -128 976 -128 944 WIRE -480 1072 -480 880 WIRE -432 1072 -480 1072 WIRE -304 1072 -304 880 WIRE -304 1072 -352 1072 WIRE -128 1072 -128 1056 WIRE -368 1136 -368 1120 WIRE -416 1168 -416 1120 WIRE -416 1216 -416 1168 WIRE -416 1328 -416 1296 FLAG -128 1072 0 FLAG -112 944 Vdd FLAG -368 1136 0 FLAG -416 1328 0 FLAG -480 608 PWROFFn FLAG -512 880 SW FLAG -272 880 CAP FLAG -80 608 PWRON FLAG -416 1168 SWcntl FLAG -16 704 PWROFF FLAG -800 816 0 FLAG -752 704 CAP2 FLAG -784 576 Vdd SYMBOL voltage -128 960 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V1 SYMATTR Value PULSE(0 15 50ms 20ms 20ms 118.5s 119.5) SYMBOL cap -16 896 R270 WINDOW 0 32 32 VTop 2 WINDOW 3 0 32 VBottom 2 SYMATTR InstName C1

SYMBOL res -160 736 R0 SYMATTR InstName R4 SYMATTR Value 470k SYMBOL res -160 592 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R5 SYMATTR Value 10Meg SYMBOL res -576 736 R0 SYMATTR InstName R6 SYMATTR Value 3.3Meg SYMBOL sw -336 1072 M270 WINDOW 0 43 31 VLeft 2 WINDOW 3 44 117 VLeft 2 SYMATTR InstName S1 SYMATTR Value MYSW SYMBOL voltage -416 1200 R0 WINDOW 0 38 39 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V2 SYMATTR Value PULSE(0 5 4.9s 20ms 20ms 4s 24s) SYMBOL CD4000\\CD4049B 96 640 R0 SYMATTR InstName U3 SYMBOL CD4000\\CD4049B -240 640 R0 SYMATTR InstName U2 SYMBOL cap -816 736 R0 SYMATTR InstName C2

SYMATTR SpiceLine Rser=1 SYMBOL res -608 688 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R1 SYMATTR Value 100k SYMBOL diode -784 672 R180 WINDOW 0 24 64 Left 2 WINDOW 3 24 0 Left 2 SYMATTR InstName D1 SYMATTR Value 1N4148 SYMBOL voltage -464 704 M90 WINDOW 0 -31 94 VRight 2 WINDOW 3 20 21 VLeft 2 WINDOW 123 0 0 Left 0 WINDOW 39 -30 25 VLeft 2 SYMATTR InstName V3 SYMATTR Value 0 SYMATTR SpiceLine Rser=0 TEXT -18 800 Left 2 !.tran 100 TEXT -432 792 Left 2 !.include cd4000_v.lib TEXT -200 1152 Left 2 !.model MYSW SW(Ron=30m Roff=1G Vt=1 Vh=-0.1) TEXT -456 960 Left 2 ;Momentary\nPush Button RECTANGLE Normal -224 1376 -544 928 1

--

  Rick C. 

  - Get 1,000 miles of free Supercharging 
  - Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C
Loading thread data ...

use an SCR ;)

Reply to
M Philbrook

Yo, the cd4000.lib isn't in the standard LTSpice library so unless you upload the whole folder somewhere with the lib and required symbols in there with it nobody can run your circuit.

Reply to
bitrex

That behavior is normal for a Schmitt trigger with 50% hysteresis from

1/3 to 2/3 Vss because the transition time from 0 to 66% is more than 66 to 33%. Using a comparator with 80% positive feedback would make the difference from 90% less noticeable for example.
Reply to
Tony Stewart

The CD4000 library is available on the LTspice groups.io files section. I can't post it here, I guess I should get the link and post that.

--

  Rick C. 

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

little power when off and requires holding the push button for two or thre e seconds before it accepts the change. A pair of CMOS gates/inverters can provide the low power two state circuit...

Well, mainly low power. It sucks a bit when the inputs slew slowly. A hex Schmitt trigger (74HC14) with up to six RC delays of a fraction of a second is the easy fix; just cascade the RC -inverter through a few sections (until y ou get tired of wiring in capacitors). 1M ohm and 0.47 uF gives about half a sec ond.

Reply to
whit3rd

I don't get why people don't just post a Dropbox link to a folder to download with the .asc and any external library dependencies if the project has them, they're finally all just text files, nobody's gonna get a virus from it.

Reply to
bitrex

I noticed when I open your sim file there's some extraneous character in your capacitance values, it comes up for me as:

"1µF"

They don't simulate properly in isolation, it's interpreted as some very large value. it takes 100 seconds for a "1µF" capacitor to charge up to

100mV through a 1k resistor connected to 1 volt.
Reply to
bitrex

ry little power when off and requires holding the push button for two or th ree seconds before it accepts the change. A pair of CMOS gates/inverters c an provide the low power two state circuit and a push button connected with a simple capacitor/resistor arrangement will default to off on power up an d allow toggling on the button press, but I can't seem to get it to delay p roperly.

arge on C2 acts as a memory recording the time since last activation. The button hold time is a lot less if you just changed states. Actually, must of this seems to be from a bias current into the CMOS inverter. I'm guessi ng this current is not as in a real part since it seems to be a resistor of 100Mohm.

rge up to

en for some people it mucks up. I expect LTspice is treating the cap as 1F . I tried entering 2.5F once and it seems it treats that as 1fF. The firs t letter after the number is an SI prefix. Everything else is ignored. I

have it turned on??

at if you try to discuss these many quirks as "quirks" the old timers in th e LTspice forum don't appreciate it. To them every part of LTspice is a co mponent of a well thought out battle plan rather than the unique and someti mes eccentric preferences of one brilliant designer.

I was learning to use KiCad at the same time I was trying to get a someone complex circuit to work in LTspice. The differences in UI were incredibly incompatible. It messed up both programs for me.

--

  Rick C. 

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

very little power when off and requires holding the push button for two or three seconds before it accepts the change. A pair of CMOS gates/inverters can provide the low power two state circuit and a push button connected wi th a simple capacitor/resistor arrangement will default to off on power up and allow toggling on the button press, but I can't seem to get it to delay properly.

charge on C2 acts as a memory recording the time since last activation. Th e button hold time is a lot less if you just changed states. Actually, mus t of this seems to be from a bias current into the CMOS inverter. I'm gues sing this current is not as in a real part since it seems to be a resistor of 100Mohm.

n
y

harge up to

Then for some people it mucks up. I expect LTspice is treating the cap as

1F. I tried entering 2.5F once and it seems it treats that as 1fF. The fi rst letter after the number is an SI prefix. Everything else is ignored.

I have it turned on??

that if you try to discuss these many quirks as "quirks" the old timers in the LTspice forum don't appreciate it. To them every part of LTspice is a component of a well thought out battle plan rather than the unique and some times eccentric preferences of one brilliant designer.

sure, but it can't be a surprise that if you pop into a forum and says; that thing you have used in 20 years is terrible, it is all wrong and I don 't like it, you should change it so it is how I think it should be. the response will be along the lines of f... off

Reply to
Lasse Langwadt Christensen

On Thursday, July 2, 2020 at 4:58:17 PM UTC-4, Lasse Langwadt Christensen w rote:

s very little power when off and requires holding the push button for two o r three seconds before it accepts the change. A pair of CMOS gates/inverte rs can provide the low power two state circuit and a push button connected with a simple capacitor/resistor arrangement will default to off on power u p and allow toggling on the button press, but I can't seem to get it to del ay properly.

e charge on C2 acts as a memory recording the time since last activation. The button hold time is a lot less if you just changed states. Actually, m ust of this seems to be from a bias current into the CMOS inverter. I'm gu essing this current is not as in a real part since it seems to be a resisto r of 100Mohm.

in

ery

charge up to

Then for some people it mucks up. I expect LTspice is treating the cap a s 1F. I tried entering 2.5F once and it seems it treats that as 1fF. The first letter after the number is an SI prefix. Everything else is ignored.

d I have it turned on??

d that if you try to discuss these many quirks as "quirks" the old timers i n the LTspice forum don't appreciate it. To them every part of LTspice is a component of a well thought out battle plan rather than the unique and so metimes eccentric preferences of one brilliant designer.

on't like it, you should change it so it is how I think it should be.

Yeah, that's not what happened. I was looking for a way to do something th at I thought would be simple. The ways described were complicated. I even tually found a simple way to do it and mentioned it along with one small qu irk that I didn't know how to deal with, mostly because the docs are all ve ry terse. I was repeatedly assailed for simply wanting to do something a d ifferent way than the way the grand masters knew how to do it. Rather than just not reply, they went out of their way to tell me how I was being obst inate or whatever adjective they used for not accepting their advice on how I should do that task and go away. questions. At no time did I say anyth ing should be changed.

I did comment on the oddities of parameters that seem to be set during symb ol creation but in fact are not in the symbol at all, rather the tool creat es the parameter later on when the symbol is added to the schematic. So th e Q number becomes an M or X number, (I forget and has to be manually edite d. Not a big deal, but if the symbol allowed the other parameter to be set , it would solve the problem.

Now, is that enough to start a flame war.. well, as much as the LTspice gro up would ever have. lol They wouldn't even register as a lit match in th is forum.

--

  Rick C. 

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

very little power when off and requires holding the push button for two or three seconds before it accepts the change. A pair of CMOS gates/inverter s can provide the low power two state circuit and a push button connected w ith a simple capacitor/resistor arrangement will default to off on power up and allow toggling on the button press, but I can't seem to get it to dela y properly.

charge on C2 acts as a memory recording the time since last activation. T he button hold time is a lot less if you just changed states. Actually, mu st of this seems to be from a bias current into the CMOS inverter. I'm gue ssing this current is not as in a real part since it seems to be a resistor of 100Mohm.

in

ery

charge up to

. Then for some people it mucks up. I expect LTspice is treating the cap as 1F. I tried entering 2.5F once and it seems it treats that as 1fF. The first letter after the number is an SI prefix. Everything else is ignored

nd I have it turned on??

nd that if you try to discuss these many quirks as "quirks" the old timers in the LTspice forum don't appreciate it. To them every part of LTspice is a component of a well thought out battle plan rather than the unique and s ometimes eccentric preferences of one brilliant designer.

don't like it, you should change it so it is how I think it should be.

I'm not new with LTspice. But it has many, many, many quirks and if you do n't use it every day they will catch you every time you pick it up again.

Going between LTspice and KiCad made my head explode. I think I actually p refer the LTspice GUI, but not by a lot.

--

  Rick C. 

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

Yeah the component value entry is ambiguous and it accepts meaningless characters and then probably interprets them as their ASCII or Unicode values or something who knows, I've wasted time with that before.

You should be able to select whether the component value is a mathematical function of some other parameters, or a static value. If it's a static value anything but a valid format for that i.e. some number followed by one of the standard suffixes should be rejected.

You can tell that most of the development time went into the engine and the GUI was a bit of an afterthought.

Reply to
bitrex

Or just drops everything after the first nonsense character is encountered.

Reply to
bitrex

"eccentric" means that LTSpice is as closed as closed-source gets there's probably not a single line of open-source anything in the source, all done by one guy and you'll never know shit about it under-the-hood.

Problem is you sometimes encounter something where you'd want to use say regular expressions to validate input formatting but realize that re-inventing that wheel and writing a regex engine from scratch is going to take you nearly as long as the rest of the GUI.

So it doesn't get done f*ck it.

Reply to
bitrex

There's often a "newbie effect" with many products one's unfamiliar with to say "it sucks" on the grounds of simple unfamiliarity and most people are guilty of it from time to time.

It often takes some time investment to make an honest assessment as to whether something is much better than one's first impression, just OK, or does in fact suck.

After number of years of use I rate LTSpice as "OK/Approved", it's far from perfect but no other product helps me pay my bills as much and the price is sure right.

Approved:

Reply to
bitrex

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.