RC charging delay circuit help - Page 1
Forum section: electronics / beginners

author: ManlishPotato
author_rank: Regular Contributor
timestamp: August 19, 2020, 10:51:59 am
content: Hi!Just a newbie over here trying to understand the basics of electronicsAn idea that's been stuck in my head for long is to create a delay using only a capacitor, resistor and a bjt. The problem i'm having is that in idea the bjt would abruptly and quickly turn on the collector current when reaching nominal voltage at the base. But instead what happens is that it gradually comes on when it's nearing the correct voltage. So rather then having the delay and then turning on the LED, it instead wait's a little bit, and the gradually turns it on. Is there anyway i could achieve my goal with only using more jellybean components like resistors, capacitors and transistor for example? In other words no micro controllers or ICs in general.Thanks in advance!//Benji

author: Zero999
author_rank: Super Contributor
timestamp: August 19, 2020, 12:36:46 pm
content: You need a more complex circuit than that. As the voltage slowly falls, the current through the base gradually falls, causing the collector current to slowly go down, gradually reducing the brightness of the LED.To get a definite on/off, you need two transistors and positive feedback, forming a monostable.EDIT: If forgot the all important diode, D2, which is required to stop the capacitor discharging into the switch. It sort of works without it, but the delay will be much shorter, than it otherwise would be and is more dependant on the supply voltage and temperature.

author: Vovk_Z
author_rank: Super Contributor
timestamp: August 19, 2020, 02:14:30 pm
content: 'Slow opening' is a natural way for simple circuits with RC-controlled transistors. But you may add a positive feedback (from output) to you circuit to it was fast.

author: ManlishPotato
author_rank: Regular Contributor
timestamp: August 19, 2020, 03:19:35 pm
content: That's a good start, is there a way to do the opposite?In other words i want it to be like this:I press the buttondelayThe LED turns onunimportant delayThe LED turns off / fades offThe delay after the LED is turn'd on is not important, it may fade off too.The important thing is that you press the button, there is a certain amount of delay, and then it turns on. Right now it turns on immediately, and after a delay it turns off.

author: Ian.M
author_rank: Super Contributor
timestamp: August 19, 2020, 04:02:21 pm
content: To do what you want with only BJTs and other discrete components, (without kludging it by driving the LED via a large capacitor so it only gets enough energy to stay on for a limited time), you'd need to either cascade two RC delay + BJT switching blocks, or start both delays at the same time but have them of different periods and connect the LED (+ series resistor) between the two BJT switching block outputs, or implement a discrete window comparator so the output is only on while the capacitor voltage is in a defined range.Another topology for a well defined threshold and snap action switching that may be easier to cascade:Its a non-inverting Schmitt trigger. Q1 acts as a comparator with its threshold set by Zener D1 + its own Vbe voltage drop. R3 keeps D1 biased. Positive feedback via R4 provides Hysteresis. The ratio of R2 to R4, and the voltage swing at Q2 collector set the width of the hysteresis band. R5 limits Q2 base current, and R6 'mops up' any leakage current in Q1 when off so Q2 turns off properly.If you wanted an output that drives high hard, you could flip the whole circuit from R2 onward upside-down, swapping NPN for PNP transistors and visa-versa and keeping the Zener cathode positive. Swap R1 and C1 to change from initially low, goes high to initially high, goes low.LTspicesimulation attached.Keywords:BJT (Bipolar Junction Transistor)ComparatorHysteresisSchmitt Trigger

author: ledtester
author_rank: Super Contributor
timestamp: August 19, 2020, 10:24:29 pm
content: Quote from: ManlishPotato on August 19, 2020, 10:51:59 amCMOS logic gates (especially those with Schmitt trigger inputs) are often used in this kind of configuration.Here's a web page with various timer circuit ideas:http://www.zen22142.zen.co.uk/ronj/cmt1.htmlAnd here's another one with more oscillator type circuits:https://makingcircuits.com/blog/simple-multivibrator-circuit-projects-astable-bistable-monostable/

author: ManlishPotato
author_rank: Regular Contributor
timestamp: August 21, 2020, 08:48:40 am
content: Hey!Find what i was looking for, the solution in theory is to use a comparator to set the target voltage of the capacitor. I linked a simulation on falstad, but i intend to use bjt transistor to form the final circuit. Anyway this is a good step in the right direction.Thanks!//Benjihttps://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWEBmZB2aaAcA2NBOZMPZBUpAFnxCQUgCgAmSaxxi8Cj5SDsLqFFiQIMOGHiSWRVGmTUw9AOYpenbshzqo9AErhGWbVkjbTpiqermhCegCdwaLfw5s+A0xLgOQ77f7MRl7w9JasCFqMaIwoCLHRsaLQWgC0MMhYJkT4WPhyBMiWaEKQjEQ6+jxulqpu7IIWVo22ynXt1SjMOo6kCTEgFMR+AyE+xLFDUQMUOG4DsQAmAKYAZgCGAK4ANgAuqdvLi+AtYooqs-OT+NOxDADufg1BT25ZOo+MkX7vge8M+jAYASkCMJj8oJatWsjWgdkcQIS30R7TGDARwL8yMxLzRbRRnQJmg+4Bx3y+UW+DAAzgYjK4nC5PCddvZNst6AB7AwgOaCcLWYTsIaWHBfUrwfI4SLi0xJWLILlOXkcJr4BTmYRwKUypAQJIlZAgVIAHWpAAdOfZdvQgA

author: ManlishPotato
author_rank: Regular Contributor
timestamp: August 27, 2020, 03:48:59 pm
content: Hey!For anyone seeing this thread asking the same question, here is the final schematic i've come up with.It's essentially a schmitt trigger with a capacitor charging up to the target voltage creating the delay. I have tested it in reality and it works! Only replace the 100 ohm resistor in series to the capacitor to something like 1k ohm instead, this was only to make the simulation go faster.//Benjihttps://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWECAstIIEwDZsHZNJ8MAOZSZcgKACcQSBmTETBbepkJiizQ2js1bsAnJjLCoLfgBd6cLg3aNmDJVIgBaNHzAoEeImIaQxZPNBJgGJBCJOmUOFAwCmmsBDBwBKroXoRdm4NeCo5EiD-CjNojShobBxIF0IbbCZrPATsEhxWNgzc-Wwkb0gqAHcQWJMUGvEWNigqwS4sBrIGDorq2vVantbalJqUerqWuhFxrlGZ+pQFCnKfMCSxifmxOfrmABNXADMAQwBXABsZTQvXffApHlgwKgBnEEM95s+WEjIVkAyGhnVxUADGH1GanYPyWPAScAgCGgIhEdhQqIQGEgJgy7jAmAEP3E5ih6hWPjoxL+ICSexpFLCVLJygU0Kkakp8go7JICjhoR8AAdIRN1HTFOwIDxWsTmn5JL02t1mH4BUqJSTaZgxewNTrJdrFstWhKBbCTdULRQ+RR1a1bSABWrLW0BQsna7Uaptsx7X1Zu6dv7RU12HYhM19caKBHPTKAG7IYMKOOKqRLSjwmAIKgAe3AzGw9TtphECPgeCS9hmCAYBKQMHgpirbFYUmYBK4VCAA

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: August 27, 2020, 04:08:57 pm
content: Here's the problem. It's 2020. A microcontroller is a jellybean part now!

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: August 27, 2020, 04:13:52 pm
content: Oh and I don't know why you want a BJT. This is an analog component, you want something that is by nature bistable...https://en.wikipedia.org/wiki/Unijunction_transistorhttps://www.electronics-tutorials.ws/power/unijunction-transistor.htmlhttps://www.digikey.ca/en/products/detail/central-semiconductor-corp/CMPP6028-TR-PBFREE/5325265?s=N4IgjCBcoLQExVAYygFwE4FcCmAaEA9lANogCsIAuvgA6pQggC%2BT%2BCkpmAVvZU0AYou can buy 384 one cent microcontrollers for that price...

author: ledtester
author_rank: Super Contributor
timestamp: August 27, 2020, 04:26:14 pm
content: Remember the OP's intent for starting this thread:Quote

author: Zero999
author_rank: Super Contributor
timestamp: August 28, 2020, 08:19:52 am
content: Quote from: ManlishPotato on August 27, 2020, 03:48:59 pmI'm glad the circuit does what you want it to, but it isn't a Schmitt trigger. There's no positive feedback and hysteresis: the on and off thresholds are the same. It's two NOT gates in series, which has a much higher gain than a single BJT, so the LED has a much sharper on/off characteristic, than you got with a single transistor. It can be made into a Schmitt trigger, by connecting a resistor from the collector for the right hand transistor, to the base of the transistor on the left. Please use designators Tr1, Tr2, C1, R1 next to symbols, it makes it easier to refer to components.That circuit also has a few quirks which might be undesirable:It uses more power when the LED is off, than when it's on, because the transistor short circuits it to turn it off.The delay increases, with ingreasing supply voltage, because if the capacitor is charged up to a higher voltage, it will take longer to discharge to the 2.6V, required for it to turn off. Why 2.6V? It's because a transistor typically requires a base-emitter voltage of 0.6V to turn on and there's a potential divider consisting of 3k3 & 1k on the base, which divides the capacitor's voltage by 4.3, so the transistor won't turn off until the voltage on the capacitor falls below 4.3*0.6 = 2.58V, but there's no point in using more than one significant digit for the calculation, as the base-emitter voltage isn't that precise.The delay is temperature dependant. The threshold is set by the the base-emitter voltage, which varies with the temperature. At room temperature it's around 0.6V, but it can vary significantly from hot to cold. The higher the temparature, the longer the delay, because it has a negative temperature co-efficient, which means the threashold voltage drops, with increasing temprature. The lower the threshold voltage, the longer it will take for the capacitor to discharge to that votlage.The other circuits posted by Ian.M and me are somwhat sensitive to temperature and supply voltage fluctuations, but temperature is less of an issue.

author: Ian.M
author_rank: Super Contributor
timestamp: August 28, 2020, 09:53:47 am
content: Here's my version in Falstad.The lamp is on for about 0.8 seconds before the capacitor charges past the reference voltage. Reset the sim to repeat.OT: My opinion of Falstad is virtually unprintable.When compared to LTspice, the only good things I can say about it, is its online and animated!

author: ManlishPotato
author_rank: Regular Contributor
timestamp: September 04, 2020, 09:54:02 am
content: Hi guys sorry for the delay!I wanted to complete the ultimate version of the circuit i was trying to design, i went ahead and learned ltspice as that seems to be preferredSo far i think it definitely has a learning curve, but its a powerful tool in the end.I attached pictures of sim and schematic down below, as well as the asc file. Sorry if my schematic is a little messyThe circuit has a latching circuit to the left, and a comparator / two NOT gates in series on the right. The latching circuit charges up the capacitor until it reaches the target voltage of the two NOT gates which switches on the output LED and powers off the latch, this has an additional smaller capacitor to give a little delay of about 0.5s until it switches off. The circuit also has in the middle a inverted latch output which immediately discharges the capacitor after the latch is powered off.In the sim the latch is powered on with a 0.5s pulse from V3, you can then see how it charges up to about 2.8V when the LED or output is powered on, the cap about 0.5s later discharges as the LED powers off.I have tested the circuit on a breadboard and it works as intended! It is in no way exact, but it was a personal challenge for me to keep it as simple as possible, precision and practicality wasn't a concern for this project. In retrospect it would have been way smarter to have the delay on the discharge, not on the charge of the capacitor. That way would have been way easier i think to get a long delay, but i wanted to see if i could do it this way and you certainly can.Your welcome to roast my circuit haha, but hey it works right?//Benji

author: Ian.M
author_rank: Super Contributor
timestamp: September 04, 2020, 11:35:10 am
content: You've designed it, simmed it, breadboarded it, and confirmed it operates as designed in real life, I'd count that as 100% win!Maybe even 110% for weaning yourself off Falstad!I've seen a lot worse schematic layout from LTspice novices. Some of my early layouts were impenetrably dense. You've already got the hang of the conventions of left to right signal flow and for power rails, most positive at the top, most negative at the bottom, which is more than some young graduate EEEs seem to manage!A couple of things that will help you avoid crowded hard to read layouts are:Always use a minimum of 1 'unit' of wire length inline with the pins of two pin components before you go off at a rightangle.Vertical text is generally an abomination:Try to avoid creating vertical net labels.A one unit horizontal bend or T from a wire lets the label be horizontal. A two unit T centered on the wire lets the label be horizontal above or below the end of the wire and centered on it.When you rotate a part 90 degrees don't leave the designator, value and other attributes vertical. Edit each to horizontal and reposition them appropriately, for easy readability. Also I recommend changing their alignment to the side closest to the component so they don't wander off as the relative font size jumps as you scale the schematic!Avoid making four wires meet at a point - if you don't notice there's a little dot its far too easy to see it as two wires crossing. Offset one of them min. one unit, or see if it makes more sense to move stuff around so you've only got T junctions.Try to avoid unnecessary zigzag bends in wires - if you space stuff out a lot more you can often reduce it to one or even no bendsTry to avoid sideways and upside-down ground symbols, and upside-down voltage sources.Detach sources that wont be part of the 'as-built' schematic, put them somewhere out of the way and hook them up with (meaningful) net labels.

author: ManlishPotato
author_rank: Regular Contributor
timestamp: September 05, 2020, 08:18:40 am
content: Thanks that means a lot Ian.M!Great tips appreciate it!//Benji

author: ManlishPotato
author_rank: Regular Contributor
timestamp: September 09, 2020, 12:48:44 pm
content: Hi guys!This is the final perfboard circuit that i soldered. It took quit a while because for some reason one of the transistors i used, BC550, is supposed to be a NPN transistor, and yet it lets current pass from collector and emitter to base, not the other way around, which normally NPN transistors do. Took quit a lot of head scratching to figure that out haha!Anyway happy that it finally works!//BenjiVideo:https://drive.google.com/file/d/1ErM8BkVOwt2m9ApOKUi-BZ3G0KMr8skR/view?usp=sharing