Need some help with a 555 timer circuit - Page 1
Forum section: electronics / projects

author: Pizzashape23
author_rank: Contributor
timestamp: August 11, 2020, 02:32:29 am
content: This is my first post, so go easy, anything i have missed/done wrong just let me know and i would be more than happy to correct it.Essentialy, I am trying to create a circuit which outputs a fixed pulse width (1 sec) for all input widths, both longer and shorter than the output. I have tried a bunch of different circuits with discrete components, but after a bunch of failures a friend recommended I use a 555 timer. I ended up finding a circuit I thought would integrate well with my existing project on the Electronics Stack Exchange, and modified it to suit my needs. I don't currently have access to the components needed to fully test it, but i need to finalise a prototype so I was hoping someone with a bit more experience could give some input/advice. (I know the best way would probably be to breadboard/veroboard it but this was my second best option.I have already made a post on the Electronics stackexchange with what I hope are all the details needed, I am going to link it here, but if linking to another forum is frowned upon here i would be glad to repost all the information.https://electronics.stackexchange.com/questions/514223/will-my-555-timer-circuit-work-the-way-i-want-it-toWill this circuit work?Would you recommend a different circuit (preferabbly without an MCU)?Any modifications I should make circuit or safety wise?

author: Buriedcode
author_rank: Super Contributor
timestamp: August 11, 2020, 04:21:10 am
content: I would suggest using a circuit simulator like LTspice (which has a 555 model I believe). I'm sure there are simpler and easier ones about, all free, but I have most experience with this.It sounds like you want an edge triggered monostable, I haven't even thought about such things in years. So, say, a falling edge on the input will trigger a pulse, so it doesn't care when the rising edge is, so the pulse can be as short or as long as you like, it'll only trigger on the start of the pulse. If you want to change the polarity you can use a bipolar transistor to invert the input or output.I'm pretty sure the 555 monostable is non retriggerable (multiple edges during the output pulse are ignored), but I can't remember off hand.Honestly, playing about with a circuit simulator, even just copying schematics from the web to see what is going on can be interesting.This page has an example of one:https://electronicsclub.info/555monostable.htm

author: Pizzashape23
author_rank: Contributor
timestamp: August 11, 2020, 04:33:49 am
content: Thanks for the reply, I'm pretty sure a falling edge monostable circuit is exactly what im after.Quote from: Buriedcode on August 11, 2020, 04:21:10 amI tried using LTspice but got nowhere (inept at using it for anything but circuit diagrams). I also used tinkercads circuit program and got it to work exactly as intended, my one issue is that it is aimed at begginers/kids and initial concepts. It doesn't give exact values for transistors or mosfets and it's difficult to monitor what is going on, so i was unsure whether the result I got was because I had the right values or because of the programs leeway.

author: Ian.M
author_rank: Super Contributor
timestamp: August 11, 2020, 05:17:11 am
content: In the real world, you can never expect your components to have the 'right value' as *everything* has a tolerance. Resistors used to be +/-10%, or +/-5% but now 1% is far more common and nearly as cheap. 0.1% is readily available at a moderate premium. Capacitors are much worse - a typical electrolytic may be +/-20%, and +/-10% is typical for many other types. Most inductors aren't precision components either. The situation with discrete semiconductors is even worse - typically there will be at least one datasheet parameter for which a 2:1 variation is entirely normal. Therefore, if you don't want to have to hand-trim every circuit to find its 'sweet spot' then re-trim it when it inevitably drifts you need to get into the habit of designing defensively so your circuit tolerates non-ideal component values.Its worth persevering with LTspice, though the learning curve is admittedly fairly steep if you haven't previously used any other SPICE software. If you get stuck with simming something, ask here. Although your circuit maybe harshly criticised, if you are willing to learn, you wont be!

author: Pizzashape23
author_rank: Contributor
timestamp: August 11, 2020, 05:29:35 am
content: I get what you are saying in regards to component tolerance, does this mean the leeway in TinkerCad simulation would carry over into real life, at least to some extent? What I mean is can the simulation be trusted?Also I was curious if you had an opinion on the overall circuit itself, is there a better way of achieving the same thing or should I go ahead and submit the prototype?

author: Circlotron
author_rank: Super Contributor
timestamp: August 11, 2020, 05:39:14 am
content: Looks like it ought to work. I would have put the top of R2 to +12V but it doesn't look like a big deal. Maybe add a 1uF bypass cap from Vcc to GND right at the 555 pins. 555s have been known to pull a current spike when the output changes state.

author: Pizzashape23
author_rank: Contributor
timestamp: August 11, 2020, 05:46:47 am
content: Thank you for the response, I will definitely be adding that capacitor, and following the link provided by Buried Code, the circuit there also put the top of r2 to +12v with 10k instead of 100k. Would the values of the resistors in the edge triggered part of the 555 circuit have a big impact on the end result? I have seen both a 4.7k used with a 100k and a 10k used with a 10k, simulating both gives the same result, would one be better than another?

author: Circlotron
author_rank: Super Contributor
timestamp: August 11, 2020, 06:31:42 am
content: As long as the pulse going into the trigger input is shorter than the desired output pulse it will be okay.

author: Pizzashape23
author_rank: Contributor
timestamp: August 11, 2020, 06:34:44 am
content: That won't work, As stated in my question the output pulse width needs to be constant even when the input pulse is longer than the desired output. The input is a user activated button so in making the circuit edge-triggered i was hoping to eliminate that source of error.

author: ozcar
author_rank: Frequent Contributor
timestamp: August 11, 2020, 07:04:17 am
content: Quote from: Pizzashape23 on August 11, 2020, 05:46:47 amIf you make R2 too low (relative to R3), then the trigger input would be low all the time the button is pressed. That wouldn't work for what you want.

author: Pizzashape23
author_rank: Contributor
timestamp: August 11, 2020, 07:10:50 am
content: Quote from: ozcar on August 11, 2020, 07:04:17 amThat makes sense for that configuration, but what if i was to put R2 up to +12v (instead of connected to R3) and make both 10K, would this be a better configuration? I have seen both online but was curious if one was better than the other, for me anyway it's two less items on the BOM (I am already having to order some 10k resistors)

author: Circlotron
author_rank: Super Contributor
timestamp: August 11, 2020, 07:51:50 am
content: Quote from: Pizzashape23 on August 11, 2020, 06:34:44 amWhen I said the trigger input I meant the actual trigger input pin on the 555, not where the pushbutton connects to the cct. As long as the CR network on the input makes a shorter pulse than the 555 output pulse.

author: Pizzashape23
author_rank: Contributor
timestamp: August 11, 2020, 08:03:18 am
content: Sorry, your answer makes much more sense now, thanks

author: Ian.M
author_rank: Super Contributor
timestamp: August 11, 2020, 08:12:00 am
content: One thing you haven't considered is switch wetting current. Unless otherwise specified, for reliability its good practice to have a minimum of 10V across a switch (or other contacts) when open and minimum 10mA through them at the moment they close to provide enough energy to break through any surface contamination that has built up. Of course this isn't always possible e.g. 5V logic circuits, so one does the best one can.

author: Pizzashape23
author_rank: Contributor
timestamp: August 11, 2020, 08:35:32 am
content: The entire circuit runs on 12v, if that is what you meant, but I'm not sure about the current through the input button. The relays will be at the same 12v and one should be switching around 200ma minimum while the other up to 40A. The circuit runs off a 24v to 12v converter module capable of delivering 2A, so current shouldn't be an issue. It is quite possible I'm wrong, this is the first time i'm hearing about wetting current, so please let me know.

author: Circlotron
author_rank: Super Contributor
timestamp: August 11, 2020, 11:36:48 am
content: You could put a capacitor across the switch contacts. When they close the cap gets suddenly discharged and this current should wet the contacts. How big a cap? Others may care to comment.

author: Ian.M
author_rank: Super Contributor
timestamp: August 11, 2020, 12:25:23 pm
content: Energy conservation is not an issue*. Simply use a 1K pullup (to +12V) for the switch to meet the 'rule of thumb' wetting current and voltage requirements. However, if you care about your switch (or relay) contacts and EMI one should also be careful *NOT* to directly short any significant size capacitor without some resistance in the loop to limit the surge current and damp the capacitor ringing with the loop inductance to reduce EMI.How big does the capacitor have to be before it matters? Well that depends on the switch. A massive wall mounted two-handedknife switch with heavy solid silver alloy wiping contacts can withstand a lot more than a sub-miniature reed switch with only a thin flash of gold over the iron of the reeds for a contact surface.For boosting wetting current for small switches without the penalty of a high standing current when closed, 1nF to 10nF is in the ballpark.I start worrying about loop resistance and surge current if I'm shorting out caps of 100nF upwards (e.g. in a 'classic' MCU reset circuit).Considering your circuit over at StackExchange, remove the 100K resistor across the capacitor, add a 1K pullup to the junction of the capacitor and the switch, and add a small signal diode, cathode positive, across the resistor pulling Trigger high, to clamp it when the switch opens.However I am *really* not happy with that circuit for a safety system. Its got absolutely nothing to prevent activation by EMI pickup on the switch wiring or by ESD to the switch. IMHO using a 555 trigger input almost directly exposed to the outside world is *CRAZY*. Using another 555 to buffer, debounce and ESD and EMI filter the switch input would make me a lot happier. I'll see about working up a sim for you so you can see what I mean.* Its feeding a fricking metal-smelting furnace, so an extra seventh of a watt in the pullup is truely negligable!

author: Pizzashape23
author_rank: Contributor
timestamp: August 11, 2020, 01:14:44 pm
content: WOW, I really appreciate the amount of detail you managed to include in that response. One question about your response, if I use a 1K pullup do I still need the capacitor across the contacts?Correct me If I'm wrong, but your response suggests that the 555 circuit path is the correct way to go about what I am trying to achieve, or is there a better/more efficient way of switching the relays for a fixed pulse width?Just note, the reason the "safety" is so rudimentary is becasause the circuit it is protecting is ridiculously basic, I could probably find a schematic if you would like. (It would be considered very *VERY* Basic, and is part of the reason why i opted for a safety circuit i the first place). However, if adding an additional 555 and a few more components is all it would take to drastically improve the safety, I whole hartedly agree that it would be the smartest thing to do. Be warned, I wouldn't know the first thing about going down that path and would probably need a lot of help, but I would definitely be up for learning.

author: Ian.M
author_rank: Super Contributor
timestamp: August 11, 2020, 03:30:59 pm
content: Ok, here's the 2x 555 timer version, as safe as I can reasonably make it.R1 provides 12mA through the switch and 12v across it when open, so unless you use a particularly crummy switch you don't need to worry about wetting current.Fs1 and R3 provide protection against shorts to ground in the switch wiring. If Fs1 trips, IC2 is locked out via its Reset pin. R4, C7 provide a power-up delay to ensure U2 doesn't pulse the relay at switch-on, and in conjunction with R3 also provide ESD protection to its Reset pin.R2, C1 provide input filtering for debouncing and in conjunction with R1 provide ESD protection to U1, which is wired as a simple inverting Schmidt trigger with 1/3 Vcc hysteresis*. Its Out pin is the inverted debounced switch state (i.e. low when pressed).R5, C4, D3, R6 are the negative edge trigger pulse shaping network, that only triggers U2 on a new button press, once the current timing period is complete.C5, R7 is the timing network and R8 limits the current into the Discharge pin. R9, R10, Q1 is a 'bog-standard' relay drive circuit, though its imprudent to rely on the diode inside the relay coil to protect Q1. If you are feeling moderately paranoid, adding a 24V Zener, cathode positive, from ground to Q1 collector, + a fuse in series with the feed to the relay coil wouldn't be a bad idea.I've minimized the number of values used for BOM reduction. If that isn't an issue, R8 and R9 could benefit by being reduced, and the CV pins don't need so large decoupling capacitors.LTspice sim with some nasty simulated contact bounce attached. Zoom in on the edges of V(in) to see it!For the details of how the SIM only Switch Control works, seeLTspice: Piecewise Linear Functions for Voltage & Current Sourcesand my comments on simultating switches.H.T.H.Ian.Now everybody's got a chance to bash my ideas to deathwhile I chilland hopefully we all learn something!* A buffer following a RC filter for debouncing *MUST* have hysteresis.You should probably (re)read Jack Ganssle's excellent article on debouncing:http://www.ganssle.com/debouncing.htmespecially part 2 where he covers RC hardware debouncers.

author: Pizzashape23
author_rank: Contributor
timestamp: August 12, 2020, 12:01:16 am
content: HOLY $**TThat has to be the best and most helpful response I have ever recieved. You nailed all of the design goals I set for myself AND managed to reduce the BOM.In all seriousness, I cannot thank you enough.I now have just two questions;How long did this take you? (I probably would have taken a week)Do you still have the shcematic file? (I wanted to get a custom PCB printed)

author: Ian.M
author_rank: Super Contributor
timestamp: August 12, 2020, 12:50:30 am
content: A couple of hours, most of which was wasted on the switch bounce generator- see below. I can layout a basic 555 sim in under ten minutes then its just a matter of a little copy/paste to daisy-chain them and gutting most of the timing components round U1. I use amouse macro utility, so a lot of the layout is just muscle memory following my train of thought. Probably the most tedious chore is reordering reference designators. D3 got away from me as I originally had two more Schottkys for ESD protection at the input, but I decided they were superfluous, removed them and forgot to rename the remaining diode as D1.There is no separate schematic file as I did it all in LTspice. If you delete all the simulation crap at the bottom, you can export the netlist, but unless your preferred PCB design package supports working from a raw netlist in a friendly manner, you'd probably do better to manually redraw it.N.B. the switch bounce portion of the sim is buggy and inefficient. I've spent the better part of yesterday sorting that out so itsimulates switch bounce efficiently.

author: Pizzashape23
author_rank: Contributor
timestamp: August 12, 2020, 12:53:27 am
content: Yeah, I just finished redrawing it and it looks great, seriously i cannot express how much of a legend you are and how much help you have provided.

author: Ian.M
author_rank: Super Contributor
timestamp: August 12, 2020, 12:57:23 am
content: Please at least breadboard it and confirm correct operation before you start ordering PCBs! When you get to the layout, I'd probably put a footprint for a 500K multi-turn preset for the timing resistor, (with a 10K 'end-stop' resistor in series), and some spare footprints for extra timing capacitors in parallel, so you can adjust the pulse-width over a considerable range.

author: Pizzashape23
author_rank: Contributor
timestamp: August 12, 2020, 01:11:10 am
content: Of Course, and yeah, the pot and extra footprints sounds like a great idea.

author: ledtester
author_rank: Super Contributor
timestamp: August 12, 2020, 01:18:14 am
content: There are possible solutions using a couple of NAND gates or NOT gates:https://www.electronics-tutorials.ws/sequential/seq_3.htmlso you could use a single CMOS logic IC, e.g. a CD40106 or a CD4093.There are also chips dedicated to this purpose, e.g.: CD4538, 74LVC1G123:https://www.nexperia.com/products/analog-logic-ics/synchronous-interface-logic/multivibrators/74LVC1G123DP.html

author: Pizzashape23
author_rank: Contributor
timestamp: August 12, 2020, 12:02:14 pm
content: I haven't breadboarded Ian.M's circuit as I don't currently have access to the parts but I needed something to do, so I routed the pcb. I have done a few before but it never hurts to get someone else to check it off. The only differences are the 24v to 12v converter and the various connectors. I know the trace width is excessive for the relays but I had the space and would rather too thick than too thin.

author: Ian.M
author_rank: Super Contributor
timestamp: August 12, 2020, 01:13:42 pm
content: As your relays are driving a large solonoid with an expectation of high back-EMFs, I would keep as much as possible of the coil connection tracks out from under the relay footprints, so you can maintain the maximum possible creepage and clearance distances between the contact circuits and the coil circuits.You could replace the Dc-Dc converter with a LM7812 regulator, which shouldn't even require any heatsinking if its only supplying two 555 chips and two 1K pulldowns. Ideally use 24V coil relays so the regulator doesn't have to handle their coil current.Why's Q1 SMD?Consider a ground plane under the whole control circuit area. Obviously you'll have to use parts of that side where tracks need to cross, but at the expense of a few extra vias to minimize the length of slots in the ground plane containing other tracks, youl'l gain considerable extra EMI immunity.

author: Pizzashape23
author_rank: Contributor
timestamp: August 12, 2020, 01:37:26 pm
content: I completely agree with needing to move the control tracks from underneath the relays, the low current one maybe not but definitely the high current relay.The dc-dc converter is what ive got on hand, its a pretty good module that can supply 12v at 2A from between 18v and 36v. Keep in mind it will also be supplying the solenoid control circuitry which uses a pretty beefy mosfet, hence the 12v output.From the short amount of time I spent searching mouser (usual supplier) i didnt see them in a through hole package, but i might have missed them. If you know of one let me know.A ground plane is an interesting idea, but I've never done one before so I will probably do a bit of research tomorroe before implementing it.I feel like I'm starting to repeat myself now, but thank you very much AGAIN. I am really appreciative and would probably have blown up my circuit a couple times without your help. Just curious but what is your background? You are clearly very knowledgeable.

author: Ian.M
author_rank: Super Contributor
timestamp: August 12, 2020, 02:37:00 pm
content: The transistor in the sim for Q1 was just a fairly random choice out of the possible 2N and 2S part numbers, avoiding legacy parts. Constraints were Ic_max, hfe_minand Vceo_max, and I picked what I did without knowing whether you were using on-board or off-board relays, to be able to tolerate a bit of abuse. You've got the data on the relays so can calculate its Ic, and I estimated its base current above, so you can determine the hfe_minrequired to get it far enough into saturation, if there isn't enough base current to run at a forced Beta of 10. I wouldn't go under 30V Vceo.

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2020, 09:15:00 pm
content: Quote from: Ian.M on August 11, 2020, 03:30:59 pmWhy use two 555 timers?The standard 555 timer circuit is not retriggerable. As long as monostable delay is longer, than the bounce time, there's no need to for any debouncing.

author: Ian.M
author_rank: Super Contributor
timestamp: August 12, 2020, 09:30:19 pm
content: Have you considered bounce on switch opening triggering it? Assuming the operator holds the button down till the feed stops, its undesirable for it to immediately resume feeding when the button is released!I'm sure it *COULD* be worked around by careful choice of components in the negative edge pulse shaping circuit, but developing that while retaining good EMI immunity and >10mA, >10V switch wetting current & voltage was more design work than I was willing to do as a freebie. The extra 555 gives me a clean squared up button pulse so I don't have to deal with rising edge bounce.Sometimes for a one-off or very small hand-built production run, throwing extra parts at the problem to save time is more cost-effective.

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2020, 09:48:50 pm
content: Quote from: Ian.M on August 12, 2020, 09:30:19 pmNo, I've not experienced switch bounce, when the contacts open. I suppose it's a possibility. There's no need for two 555 timers, just put a capacitor (try 100nF) across the switch. It will also help to close the contacts, by providing a surge to make the contacts wet.

author: Ian.M
author_rank: Super Contributor
timestamp: August 12, 2020, 10:16:36 pm
content: You are probably right, and that would certainly help with EMI immunity, but I'd like to see a fully worked up design of the single 555 approach. Also see my comments earlier about possible contact damage from shorting a charged cap. Without a detailed spec sheet for the switch, one doesn't know which side of the line one is operating on between an adequate surge current for wetting, and progressively damaging the contacts by ablating the contact surfaces as they micro-bounce on closure. 'Belt and Braces' would be a small series resistor for the cap to limit the peak wetting current.N.B. The switch bounce generator in the sim I posted earlier was half-borked due to undocumented limitations of the LTspice PWL TRIGGER modifier. It produced a bounce pattern but did so very inefficiently. If you want to have a hack at simplifying my design, rather than starting over from scratch, and don't have a good switch bounce generator of your own, please use the switch bounce generator I posted in the topic I previously linked: "... my comments on simulating switches."

author: ozcar
author_rank: Frequent Contributor
timestamp: August 12, 2020, 10:23:29 pm
content: Quote from: Zero999 on August 12, 2020, 09:48:50 pmWith the circuit as it was originally proposed, it would not trigger on switch release until the resistor across the capacitor discharged it. But I've no idea how it evolved - one of the first suggestions was to rip that resistor out.

author: Pizzashape23
author_rank: Contributor
timestamp: August 12, 2020, 10:58:19 pm
content: Yeah, one of the first design changes I made was to change the 4.7k to 10k, remove the 100k across the capacitor and pull up the switch to 12v through a 10k resistor. Thanks to Ian.M we are well past that design, making it simpler would be nice but his circuit contains a lot of safety and stability features that I think are worth the additional complexity. My original design probably would have worked after making the change mentioned above, but at the moment I am running with Ian.M's design.

author: Pizzashape23
author_rank: Contributor
timestamp: August 13, 2020, 12:23:51 am
content: In terms of changing the transistor, if I was to swap it for a BC337 with a beta(min) of 60, assuming a Max current of 300ma (150ma per relay) could I get away with using the same 1k resistor, or should I use something closer to 500ohms?

author: Ian.M
author_rank: Super Contributor
timestamp: August 13, 2020, 01:06:23 am
content: If you are using a bipolar 555 e.g the original NE555, its output high level is up to 3.25V below Vcc. Assuming 12V -5%, that means worst case it could be only 9.15V. Typically it would be somewhat better but you cant rely on typical values. My 1K base resistor and pulldown divide that by two but drop the source impedance to 500 ohms. Assuming Vbe of 0.7V, that gives you 7.7mA base drive, which will get it into saturation at 300mA Ic but with only 50% margin. I'd be happier with a bit more base drive. Decreasing the base resistor to 470R while keeping the pulldown at 1K increases the base current to 17.3mA, which is more than adequate base drive.If you are using a modern CMOS 555 its output will get somewhat closer to Vcc even when sourcing 10mA, so the base drive will improve a bit, but not enough to significantly affect the design.

author: eblc1388
author_rank: Frequent Contributor
timestamp: August 13, 2020, 07:12:11 am
content: Quote from: Ian.M on August 12, 2020, 10:16:36 pmI tend to go along with Zero999. Here is my feeble attempt to create what the OP wants. It survives the contact bounces at release. 555 Trig pin is pulled up via a 2K2 resistor which is fairly strong and should prevent normal EMI false triggerings. I just pull the component values from thin air and perhape you can fine tune it better.

author: Pizzashape23
author_rank: Contributor
timestamp: August 13, 2020, 09:07:35 am
content: This is very similar to my original shcematic posted on StackExchange, however many people pointed out that getting rid of the resistor across the cap and pulling up the switch using a 10k resistor would be better, and for the sake of simplicity the 2k2 resistor could also be 10k. At the moment I am leaning much more towards the dual 555 design, only because i am already printing the pcb so the added complexity and few extra components do not impact time or cost significantly, and because it is supposedly better protected and more stable. In my opinion it's a no brainer, although there is no doubt that it could be simplified.

author: Ian.M
author_rank: Super Contributor
timestamp: August 13, 2020, 10:20:20 am
content: Eblc1388's implementation of Zero999's circuit does quite well, and is a considerable simplification compared to mine. With a couple of tweaks it would be entirely acceptable, provided high level EMI pickup on the button wiring is avoided (e.g in hostile EMI environments, use twisted pair and keep the wiring as short as is reasonably practical).IMHO the 2K2 pullup should be reduced to 1K to get enough wetting current, a 1K (or lower) resistor should be inserted in series with the Discharge pin to control the current, the 100K resistor across the input cap should be made the same as the 91K timing resistor for BOM minimisation, and the 100nF caps should be increased to 220nF to increase the button up debounce period. Also the supply decoupling should be 10uF if a bipolar 555 is used.N.B Zero999 failed to spot the other topic was using 5V levels. The power supply SPICE line needs to be changed to:Code:Vvcc Vcc 0 12V ; power supply

author: Pizzashape23
author_rank: Contributor
timestamp: August 13, 2020, 10:56:12 am
content: So as a "conclusion" to the question, which circuit should I use in the final build? Noting that I have no preference in regards to complexity and number of components as long as it does the job and does so safely and reliably. One point in favour of Ian.M's circuit is that it does not cause an activation on power up.

author: Ian.M
author_rank: Super Contributor
timestamp: August 13, 2020, 11:35:07 am
content: Before you make a decision, breadboard the contenders with grounded foil under the breadboard and about 30cm of switch wiring, lay that switch wiring next to a mobile phone and dial that phone from another. Mobile phones cause a lot of EMI when they go active, and this crude suceptability test is to get some idea what could happen if someone with a mobile phone on a belt clip is right next to your device. You can also try the effect of a Pizeo lighter (for gas - not the sort that makes its own flame), to simulate a strong ESD discharge. Ground its shield and extend the electrode so you can bring it close enough to the button to spark to it.

author: Pizzashape23
author_rank: Contributor
timestamp: August 13, 2020, 11:41:05 am
content: While I do plan to breadboard both, as stated I don't currently have access to the components required to do so. Realistically, a better question would have been; at first glance which circuit would you implement yourself (If you couldnt do a real world test)?

author: Ian.M
author_rank: Super Contributor
timestamp: August 13, 2020, 12:07:11 pm
content: Neither. Analog RC timing is so '80's!Assuming a requirement *NOT* to use a MCU, I'd probably go for an Analog DevicesLTC6993-3TimerBlox one-shot, supplied by a dropper resistor and a 4.7V Zener, driving a low threshold (so-called 'logic level') MOSFET gate via a 100R resistor. It also needs enough decoupling to supply the MOSFET gate charge without a significant V+voltage drop. The TimerBlox trigger input has hysteresis so is directly compatible with RC debouncing / ESD protection, and with one more resistor added to the debounce circuit to make a potential divider, you can also level shift from 12V or even 24V levels at the button down to the logic level input the TimerBlox chip needs. You only need enough debouncing to cope with button release bounce as that specific TimerBlox is non-retriggerable.An introduction to TimerBlox can be found.

author: Pizzashape23
author_rank: Contributor
timestamp: August 13, 2020, 12:39:40 pm
content: In one post you managed to show up both circuits and completely defeat the purpose of my question.In all seriousness though, if you had to pick between either circuit in this topic which would it be? I think i have learned more than enough and don't really feel like opening another can of worms, as interesting as it seems.

author: Ian.M
author_rank: Super Contributor
timestamp: August 13, 2020, 01:51:48 pm
content: OTOH, some flavor of 555 chip is likely to be obtainable for the rest of this century, and you can buy them retail even in 3rd world s--tholes.Fixed that for you:Quote from: Pizzashape23 on August 13, 2020, 12:39:40 pmIts easier to make my version general purpose as it really doesn't care if the input is from a switch or is a 'logic' signal on a wire from something else, but if you can guarantee a real switch with short wiring, eblc1388/Zero999's version is plenty good enough. Add a RC network on its Reset pin to prevent it firing on power-up glitches and, to save parts, use its output to drive a MOSFET via a small gate resistor. If you use a beefy enough MOSFET and a small enough gate resistor, you could probably drive the solenoid directly!

author: Pizzashape23
author_rank: Contributor
timestamp: August 13, 2020, 02:08:16 pm
content: In that case I will probably end up using your design.The final build will not have short switch wiring (I can't have the circuit too close to the furnace), I am still unsure about what switch i'm going to use and I like the idea of being able to reuse the design and pcb for other projects. (Especially when buying bulk parts/pcbs is generally cheaper)I like where you are going with integrating mosfet control into this board but unfortunately thats a no go, part of the idea behind using relays and cutting all the power was to give me the option to easily increase the amount of solenoids in the system. (There are curently 3) It would also remove the sensor from the original circuit. (It would only trigger the solenoid when a rod was correctly seated).The final system should theoretically allow the solenoid to trigger for a set period of time on button press, as long as the sensor is detecting a rod.P.S I ended up using a ground plane, I decided to not extend it to under the relays, would this be an issue?P.P.S Should I post a final circuit and PCB design?

author: Ian.M
author_rank: Super Contributor
timestamp: August 13, 2020, 02:14:11 pm
content: *DO* post your PCB layout and final schematic - peer review is almost always useful.I wouldn't put a ground plane under relays switching power circuits. Others may have different opinions.

author: Pizzashape23
author_rank: Contributor
timestamp: August 18, 2020, 12:29:21 am
content: I just wanted to thank everyone who contributed to my final design, all your help has been greatly appreciated.Attached are my final schematic (Doesn't include connectors, Indicator Led or 24v to 12v convertor), my pcb and the ground plane to make the slots where traces need to cross easier to see.I have ordered the necessary components to bread board the circuit before printing the pcb, so until then any and all feedback in regards to optimizastion, design, design checking, layout, etc is helpful.If I remember I will make sure to come back and post an image of the assembled pcb.

author: Zero999
author_rank: Super Contributor
timestamp: August 18, 2020, 07:50:45 am
content: Quote from: Pizzashape23 on August 18, 2020, 12:29:21 amThat looks good to me. The decoupling capacitors are near the supply pins to the ICs, which is great.Is there any reason why you're not using the NE556 or better still the CMOS TS556/ICM7556? The 556 means it has two 555 timers in the same package, which saves space and makes one of the 10µF capacitors unnecessary. The CMOS versions (TS/ICM7) use much less power and don't draw such big power spikes, when the output changes state, so can use much smaller 100nF decoupling capacitors.

author: MK14
author_rank: Super Contributor
timestamp: August 18, 2020, 07:59:36 am
content: Quote from: Pizzashape23 on August 18, 2020, 12:29:21 amI haven't really been following this thread, so may have missed important details. But at a quick glance, is the poly fuse (F2), in the right position ?It only seems to protect some fairly high value (relative to a poly fuse) resistors (i.e. low current bits of the circuit). Presumably you intended to protect the entire Vcc rail ?

author: Pizzashape23
author_rank: Contributor
timestamp: August 18, 2020, 08:30:43 am
content: Quote from: Zero999 on August 18, 2020, 07:50:45 amI kind of overlooked the 556 from the get go when Ian.M designed it using 2 555's and I saw that they were cheaper than a 556 (Tiny amount, but it just stuck with me) and also space was never really an issue.I'm not using the cmos versions because power draw was never an issue (It is used in conjunction with a high power furnace) and because originally I had planned to drive the relays directly off the output pin until I realised it would be better to use one central board to drive all the solenoids and then switched to a transistor. (I am using those little machined sockets for the 555's so it's easy to change down the line with an ic puller)Quote from: MK14 on August 18, 2020, 07:59:36 amI am pretty sure it is, it is only rated at 50ma, much less than the theoretical max 2A draw of the rest of the circuit (including what is being switched by the relays) and as it is a polyfuse it is only intended to temporarily disable the circuit anyway. When it trips it will "cut" power to the switch disabling inputs to the first 555, while also pulling the reset pin of the second 555 to ground disabling it.Take this explanation with a grain of salt as the circuit was designed by Ian.M, and only in "reverse engineering" the circuit (Not going to produce something I don't understand) I came up with the above explanation, it could very well be a design error but I feel like it makes sense.

author: Ian.M
author_rank: Super Contributor
timestamp: August 18, 2020, 08:52:42 am
content: The 50mA polyfuse is there to protect against shorts from the button wiring to ground. In that event, the second 555 is also reset for 'belt & braces' lockout of the feed system, persisting long enbough to avoid false triggering on glitches if the fault clears and the polyfuse recovers. I assumed the DC-DC converter already has short-circuit protection.Zero999's suggestion of a CMOS 556 dual timer is a good one. It lets you eliminate the 10uF electrolytics from the BOM, as a 330nF caps as used elsewhere will be suitable for decoupling it. As both 555 configurations leave the control voltage at the standard 2/3 Vcc, if you were using a 556 you could also tie the two control voltage pins together and save an additional capacitor.If there is any significant risk of vibration or repeated severe thermal cycling, if you are going to socket the chips, you should also provide a plain PCB hole at either end of the package large enough to get the smallest size of cable tie through, looped over the top of the chip for retention in its socket. Otherwise there's a risk it will tend to 'walk' out of its socket and you'll have to open the unit up annually to reseat the chips.

author: MK14
author_rank: Super Contributor
timestamp: August 18, 2020, 09:05:30 am
content: Quote from: Ian.M on August 18, 2020, 08:52:42 amUnfortunately, that doesn't really make sense.....I understand now, see below.Also, isn't the driver transistor (bottom right hand corner of schematic) unprotected, as regards the back emf's from the relay coils ?Assuming the relays don't have built in diodes.EDIT: It makes sense to me now, the 50ma polyfuse, and worries about switch shorts to ground.

author: Pizzashape23
author_rank: Contributor
timestamp: August 18, 2020, 09:14:26 am
content: Quote from: Ian.M on August 18, 2020, 08:52:42 amI should stop assuming what components do and ask next time im unsure, and yeah the DC-DC converter does have short-circuit protection.I won't really be able to remove the 10uF from the BOM as they are also used in the RC network for the second 555, and saving one or two components was never an issue, rather the amount of individual components as they will be bought in bulk anyway. Either way, if I find the bipolar versions have issues they will be easy to change down the line.While I like the zip tie idea, I'm pretty sure it's unnecesarry as the main board will be in the control room, I could have put the solenoid drivers on the same board but by switching their 12v supply, distance/heat/vibrations shouldn't be an issue. All the wire used between boards has high temp insulation and is more than thick enough.Quote from: MK14 on August 18, 2020, 09:05:30 amThey definitely do have diodes in built, it was one of the selling points for me when I bought them for another project. There is also an inline fuse from the 24v supply into the DC-DC converter rated for 75% of it's max current.

author: MK14
author_rank: Super Contributor
timestamp: August 18, 2020, 09:17:23 am
content: Quote from: Pizzashape23 on August 18, 2020, 09:14:26 amThat's good!Fusing is a nice extra touch as well.

author: MK14
author_rank: Super Contributor
timestamp: August 19, 2020, 04:28:07 pm
content: Sorry, I didn't know about the thread on the other forum, so couldn't reply there. I didn't realise I needed to refer to it, to get the details, I assumed, they would be on this forum.Now I've read it (other forum), I have a question.Why not simply use a 1 second (timing amount adjustable, via switches), off the shelf timing relay (powering additional relay(s), if necessary, to meet the output specs) ?E.g. for around £17 + VAT (if applicable), from RS. There are others they sell, and other suppliers. So, I am just giving an example.https://uk.rs-online.com/web/p/timer-relays/1785021/Product datasheet:https://docs.rs-online.com/e6ce/0900766b817142df.pdfIt seems it can be triggered by a switch, and will refuse to be started again, until it has seen the switch turn off, and then back on again. I.e. holding or shorting the switch, will not cause the 1 second to be exceeded, if I understand it correctly. It seems to have a basic +/- 0.5 % accuracy.QuoteI feel bad, because I came to the thread very late, and the design(s), have already taken place. But, as the thread on the other forum, seems to say. 555 timers, are not especially robust and reliable as such. As nice as designing a custom circuit might seem to be. There are all sorts of gotchas, with such circuits.If you can just buy a ready made, (presumably) robustly/tested version, somewhat cheaply, and replacements are available. It perhaps deserves, some consideration.But feel free to do what you think is best. It is your decision. Others seem to have put a lot of effort into this already, so I feelIf it was me. I'd be tempted to use it as a belt and braces type of unit, even if you still use your circuit. As it should mean that you don't exceed 1 second, even if the control circuitry tries to exceed the time limit.tl;drI really like 555 timers. But, I've also had some bad experiences with them. They can trigger, possibly a bit too easily, and potentially be a bit haywire as regards the timings. I had a poorly suppressed DC motor, which basically turned a 555 timer, into a random number generator, rather than a precise timing unit, it was suppose to be.It was a very long time ago, in my early hobby days.But in fairness, 555 timers are basically reliable. But one needs to take care, if using them.I haven't used timing relays like this (that I can remember). Maybe they have their own problems, I don't know.