Circuit for generating one pulse? - Page 1
Forum section: electronics / beginners

author: Technological
author_rank: Newbie
timestamp: June 05, 2023, 11:33:57 am
content: I'm working on installing a Battery Management System for a Li-ion battery, 20 cells in series.I'm going to activate startups and shutdowns remotely.The BMS needs to apply voltage of 3-5 V for a couple of seconds to one of the inputs to start up after a shutdown. The manufacturer suggests connecting a Li-ion battery briefly to this input.This input takes 2mA of current so I can't leave it connected to the battery.I need a circuit to- turn the output on when the input comes on- turn the output off after ~2 seconds- keep the output off as long as the input is onWould anyone suggest me the simplest reliable way to implement the circuit?I was thinking towards a 555 timer. But the complexity of implementation is significant. It would require a power supply to power the 555 from 80V battery voltage, another PCB. The parts count raise significantly. Can the circuit be implemented simpler?

author: brucehoult
author_rank: Super Contributor
timestamp: June 05, 2023, 11:55:42 am
content: If this is not a "I really want to learn how to use a 555 and design analogue circuitry with long time constants around it" thread, then get the cheapest microcontroller you can find, preferably one with an internal oscillator and able to be programmed using the Arduino IDE.My go-to for this is the ATTiny85.When powered from 5V and running on the internal oscillator at 1 MHz they use a bit less than 2 mA, but you could presumably have it sleep most of the time and just wake up to check the input from time to time (or trigger an interrupt when the input changes). In sleep it uses 5 µA.There are significantly cheaper chips now, but at a couple of bucks, with no external components needed (once programmed). It's not that expensive for a 1-off project.

author: Technological
author_rank: Newbie
timestamp: June 05, 2023, 12:32:22 pm
content: Learning microcontroller programming could be a more time consuming task for a 1-off project. Would you suggest how to start?Any ideas of an analog circuit that latches off after a certain period of "on" time?

author: Ian.M
author_rank: Super Contributor
timestamp: June 05, 2023, 12:55:43 pm
content: A NE555 timer has a typical supply current of 2 mA @5V so there would be no advantage using one for any attempt to eliminate a 2 mA continuous drain!Quote from: Technological on June 05, 2023, 11:33:57 amFirst define 'remotely'! Do you mean over a wired link, or are you intending on some sort of wireless, infrared, or network control? If the latter, how is the receiver powered when the BMS is shutdown?

author: Benta
author_rank: Super Contributor
timestamp: June 05, 2023, 07:13:05 pm
content: The MC14541 (onsemi) or CD4541 (TI) will do exactly what you want.

author: krzysssztof
author_rank: Contributor
timestamp: June 05, 2023, 07:16:52 pm
content: Monostable multivibrator, example 74hc123 - rising (or falling edge) on the input will generate single pulse on the output. Pulse duration can be selected by RC values. Static value (high on low) on the input will keep output off.Requires low voltage supply, similar to 555 timer.

author: brucehoult
author_rank: Super Contributor
timestamp: June 06, 2023, 01:08:48 am
content: Quote from: Technological on June 05, 2023, 12:32:22 pmThat's why I specified to use a microcontroller that can be programmed using Arduino IDE and libraries. It so so easy a child can do it.There are people who put down Arduino because using an AVR with Arduino libraries it is hard to deal with time intervals below a couple of µs, while with hand-written C or asm fiddling with IO registers directly you can do sub-µs. Arduino is not "real" microcontroller programming.It's a valid point.But when the time scales you are dealing with are ms -- or your case *seconds* -- it's just completely fine. And literally childs' play.

author: MMMarco
author_rank: Regular Contributor
timestamp: June 08, 2023, 09:00:09 pm
content: Quote from: brucehoult on June 06, 2023, 01:08:48 amThat'squitefar from the truth. People who have absolutelyNOexperience in Programming will find it hard to do basic things, even with Arduino.Quote from: brucehoult on June 06, 2023, 01:08:48 amIt's child play for us (experienced programmers) because we knowexactlywhat and why we're doing things - that doesn't apply to a beginner at all.That Arduino is written in C++ makes it even harder, because C++ is a very complex language, with some of the dangers associated with C.The Arduino documentation isn't helpful either, because they actively try to hide the fact that their platform is running on top of C++.An example would be:QuoteWhich is a pretty awful way of phrasing "the input parameter will possibly get evaluated more than once" ; stating thatabsis afunctionis also technically incorrect.What I'm trying to say is, if you're going to use Arduino, prepare to go deeper than just their "Language Reference" - many things will need extensive knowledge about the underlying system.And C++ isdefinitely NOTa good first language to learn---I second the recommendation of using a 555 timer, there should be plenty of examples/tutorials online.

author: Ian.M
author_rank: Super Contributor
timestamp: June 08, 2023, 10:03:33 pm
content: Maybe a CMOS '555' would do the job, but as I mentioned above a regular bipolar NE555 has a similar quiescent current to the 2mA drain the O.P's trying to eliminate if he leaves the Enable active all the time, so isn't useful unless a pulse is needed for other reasons.

author: james_s
author_rank: Super Contributor
timestamp: June 09, 2023, 12:47:29 am
content: There are people here, myself included, that could write the code for an Arduino compatible micro to do this in about 2 minutes and post it here. I think it would be faster for an absolute beginner to code this than to work out how to make a 555 or other analog parts do it.

author: BillyO
author_rank: Super Contributor
timestamp: June 09, 2023, 01:30:10 am
content: Quote from: MMMarco on June 08, 2023, 09:00:09 pmReally?C was my first language.

author: MMMarco
author_rank: Regular Contributor
timestamp: June 09, 2023, 01:32:39 am
content: Quote from: BillyO on June 09, 2023, 01:30:10 amC and C++ aredifferentlanguages, C is a good first language to learn IMO (if taughtproperly).

author: brucehoult
author_rank: Super Contributor
timestamp: June 09, 2023, 02:19:52 am
content: Quote from: MMMarco on June 08, 2023, 09:00:09 pmThat is contradicted by more than a dozen years of experience around the world.

author: BillyO
author_rank: Super Contributor
timestamp: June 09, 2023, 03:09:05 am
content: Quote from: MMMarco on June 09, 2023, 01:32:39 amC++ is an OO superset of C. Most C code will run unmodified under C++. Thanks for the update, but I'm, how should I put it, ahhh .. well versed in both languages .. and a few others as well.

author: james_s
author_rank: Super Contributor
timestamp: June 09, 2023, 07:28:48 am
content: Doesn't really matter. I don't want to start a religious war over programming languages, but Arduino has been around for quite a while now, and it is the defacto standard for kids learning to program hardware. There are loads of 10 year olds that have learned it on their own, and it's widely used in schools.

author: EPAIII
author_rank: Super Contributor
timestamp: June 09, 2023, 09:28:43 am
content: Well, a 555 or monostable MVB or even a microprocessor can certainly do this. But this is the classic POWER ON reset circuit with an 80 Volt twist. That suggests a Voltage regulator with an 80 or greater Volt input and 5 VDC output, followed by a simple RC and inverter circuit - all with low quiescent current. Here is one suggestion (drawing below).The ZXTR2005 is just the first Voltage regulator that I found with less than 1mA of quiescent current and the 80V in, 5 V out needed. Then almost any CMOS logic IC that inverts an input can be used. The 74HC series is just a suggestion. Feel free to experiment and/or substitute for either of these chips. Three capacitors and one resistor and the circuit is finished.When power if first applied the 1uF, 10V capacitor on the input of the inverter is discharged so the inverter's output goes high. That capacitor then takes about 2 seconds to charge to the 50% point (2.5V) whereupon the inverter switches to a low. It will remain low as long as power is present and the capacitor remains charged. When power is removed the capacitor discharges again and the circuit is ready for the next cycle.Two seconds is a long time and 3M Ohms a rather large value so you may need to play around with the exact value to get the pulse time correct. The 1uF, 10V capacitor should have a low ESR.The parts count is relatively low and with modern components both the cost and footprint should be fairly small.

author: MMMarco
author_rank: Regular Contributor
timestamp: June 09, 2023, 01:01:36 pm
content: Quote from: brucehoult on June 09, 2023, 02:19:52 amKids aren't people. I have met a good amount of people who weren't able to do basic things with Arduino.Adding to this, people have all sorts of problems writing code, even in higher level languages like PHP, Python or JS.You're trying to make something sound very easy, when it's in fact not.Creating a pulse with Arduinomightbe easy, but as soon as you dig a little deeper you'll find lots of things that areoff¹ ; it's kinda like saying"C++ is like child's play".¹ because the abstraction isn't perfect. Their "Language" or whatever doesn't change the fact that it's still C++. Everything that applies to C++ also applies to Arduino because Arduino is C++.Quote from: BillyO on June 09, 2023, 03:09:05 amNo it is not. Seehttps://stackoverflow.com/questions/3777031/what-prevents-c-from-being-a-strict-superset-of-c.Also seehere:QuoteQuote from: james_s on June 09, 2023, 07:28:48 amDoesn't apply to people. It's not a secret that kids are way better at learning new things.Saying "even a kid can do it" doesn't really tell you much about how difficult a problem is.A good example is learning new languages, kids are absolutely amazing at that, adults not so much.Another example is the use of a smartphone. For younger "people" it's very easy to get accustomed to the navigation, interaction etc., for older people it's not that easy.But that doesn't matter. The main reason I strongly disagree is that Arduinois still C++, so all the mistakes you can do in C++ you can also do in Arduino.Arduino isnota new language, it's simply a library written in C++. When you're using "Arduino" you're using a library written in C++.I do realize we're going off-topic here, so I won't post another reply in this thread.

author: james_s
author_rank: Super Contributor
timestamp: June 09, 2023, 06:51:29 pm
content: Quote from: MMMarco on June 09, 2023, 01:01:36 pmOk, well anybody who's not an idiot can do it. There are examples included right in the software package that already do basic stuff like this, writing a simple Arduino program is as basic as tying one's shoes, or following a simple recipe in a cookbook. If you can read and follow instructions then you can write a program that does something like blink an LED, which is more than the program under discussion needs to do. Programming can get very complex, and being a competent developer is certainly not easy, but this is equivalent to a "hello world" program, and if someone is unable to follow the most basic example tutorials to get that working then I don't see how they're going to get very far in electronics or any other engineering discipline. We're talking about literally 4 or 5 lines of code.// the setup function runs once when you press reset or power the boardvoid setup() {pinMode(2, OUTPUT); // Initialize digital pin 2 as outputdigitalWrite(2, HIGH); // Set pin 2 highdelay(2000); // Wait for 2 secondsdigitalWrite(2, LOW); // Set pin 2 low}// the loop function runs over and over again forevervoid loop() {// Loop here doing nothing}

author: BillyO
author_rank: Super Contributor
timestamp: June 09, 2023, 07:07:33 pm
content: Quote from: MMMarco on June 09, 2023, 01:01:36 pmSplitting hairs a bit.It's like saying the Australians speak a different language than Americans. I guess technically they do, but they are both English and we don't often call them different languages. Well, some of us don't..

author: TimFox
author_rank: Super Contributor
timestamp: June 09, 2023, 07:08:37 pm
content: Similarly, a non-illiterate person can look into many 555 books, including this old onehttps://worldradiohistory.com/UK/Bernards-And-Babani/Babani/Bababi-IC-555-Projects.pdf.

author: sparkydog
author_rank: Regular Contributor
timestamp: June 09, 2023, 09:39:08 pm
content: Re-reading the original post, I realize that I don't think most respondents understand the actual problem.I'm going to restate; @Technological, it would be great if you can confirm if this is correct.My understanding is that you have some sort of remote input. This input generates a short 'startup' voltage pulse, but does not represent a reliable power supply. You also have an input 'X' that needs to be fed +5V for at least 2s when the 'startup' pulse is seen. The only 'onboard' power supply you have is the battery bank itself. You can feed 'X' its +5V indefinitely, but doing so from the battery bank is strongly undesirable.If that's the case, I think you have only three choices:Have the 'startup' pulse deliver the input signal you need. That is, the pulse needs to last the full 2s.Convert the battery 80V to a more usable voltage.Add a secondary power supply that can power 'X'.I'm guessing (1) is a problematic solution. You may be stuck with (2).That said, I came up withthispossibility for (2) or (3). It needs quite a few parts, but has the advantage that the power supply is disconnected (physically, if you use EMRs rather than SSRs). The 'startup' pulse does need to be long enough forbothrelays to engage. This might make (3) feasible, but at least it achieves the objective of disconnecting 'X' after the required interval.This works as follows... The top voltage represents an always-available supply, e.g. the batteries stepped down to 5V. The bottom voltage plus momentary switch is the 'startup' pulse. Note that this needs to be isolated from everything else. The bottom relay momentarily energizes the circuit. The 555 is set up as a monostable vibrator; as soon as power is supplied, it turns on, and stays on for 2s (adjust the 200k resistor to change the timing). The output is connected to aseparaterelay (top) that connects the supply to the circuit. This acts like a start-latch; powering it either via the 555 output or the lower relay turns it on, and since it is back-fed from the 555, it stays on until the 555 turns off, allowing power to the lower relay to be interrupted.The caps drain through the 555 and the whole thing resets relatively quickly (<0.2s). Because it just connects power that is already connected, repeated 'startup' signals during the 2s do nothing.To be clear:somethinghas to power the timing circuit; I don't know of anymechanicalway to accomplish what you're asking. It seems, however, that your problem with the manufacturer's suggestion "connect a Li-ion battery briefly to this input" is that you need an unattended way todisconnectsaid battery again. IOW, you need a magic switch that can connect the supplemental power supply for 2s when it receives an input signal, then disconnect it again... and doesn't draw power when it's 'off'. This is exactly option (3) with the circuit shown. The 555 is powered by the same supplemental supply that powers 'X'. It draws no power when off (everything is physically disconnected by EMRs), and uses an electrically isolated signal to turn 'on' that can be a fairly short pulse. While it does draw a modest amount of power while 'on' that is in addition to your load, it seems like that may be acceptable for your use case?...and if I'm totally misunderstanding and 'startup' is just a constant voltage until the whole thing turns off, then EPAIII's answer is probably the way to go. You can implement that with a 555 by ripping out the relays and the output-to-relay connection and just feeding voltage to the resistors/Vin/rst.

author: vk6zgo
author_rank: Super Contributor
timestamp: June 10, 2023, 12:09:25 am
content: A relay & a big, fat, electrolytic capacitor.

author: james_s
author_rank: Super Contributor
timestamp: June 10, 2023, 02:07:30 am
content: It actually doesn't need to be a very big capacitor even, you can use a transistor to drive the relay and a simple RC delay, if the exact timing of the delay is not critical. I did something like that years ago in a power amplifier I built in order to eliminate the turn-on thump.

author: EPAIII
author_rank: Super Contributor
timestamp: June 10, 2023, 07:46:38 am
content: The OP has an80 Volt battery that is supplying the power, "It would require a power supply to power the 555 from 80V battery voltage, another PCB." And says, "The BMS needs toapply voltage of 3-5V for a couple of seconds to one of the inputs to start up after a shutdown."So, is it the "big, fat, electrolytic capacitor" or the "relay" that provides the 3-5 Volts from 80 Volts?? Or do they somehow do it together??I want to see the circuit!Quote from: vk6zgo on June 10, 2023, 12:09:25 am

author: vk6zgo
author_rank: Super Contributor
timestamp: June 10, 2023, 11:33:43 pm
content: Quote from: EPAIII on June 10, 2023, 07:46:38 amThe relay & cap provide the single pulse, & one of the spare contacts connects the 3-5v which is obtained whatever way you can provide it.It just relies on the CR time constant of the relay coil resistance & the capacitance.You need to use whatever "make or break" contacts are needed.It is how such things were done before 555s & the like existed.

author: Technological
author_rank: Newbie
timestamp: June 11, 2023, 11:32:07 am
content: Thanks everyone for your replies!The BMS is activated by applying battery voltage (Li-ion 20S 85V) to it's "power in" pin and then applying 3-5 V to separate two "boot pins" for a short moment of time to activate boot.I'm going to activate the BMS with a mechanical switch and with a wireless link. The activation signal is full battery voltage on a wire for as long as the BMS is needed to be powered on. The activation signal is going to control a MOSFET switch consisting of two MOSFETs which applies battery voltage to BMS power in and 3-5V to "boot pins".The manufacturer suggested to remove voltage from "boot pins" afterwards.The manufacturer didn't think that anyone would want to power the BMS on and off. They designed it to boot once and leave it on.When I need to power the BMS down, the voltage on the control wire is removed thus removing voltage on the "power in" pin.I was able to find LR8N3 linear regulator in my local electronics store. It can accept 17 - 450 V of input voltage to produce 3.5 V of output. I'm going to connect it to BMS "boot pins" for as long as BMS is needed to be powered on and neglect power consumption of 2mA on this pins.I would use the solution provided byEPAIIIusing 74HC if my arrangement shows any drawbacks.I think using 74HC is the most simple and compact circuit for the task.

author: RogerThat
author_rank: Regular Contributor
timestamp: June 13, 2023, 09:11:03 am
content: Simplest way: 74HC14on one of the inputs you put a capacitor in series and then a pull down resistor (AC coupled). Adjust the capacitor and resistor values to adjust the 'on' time of your pulse.