Author Topic: Circuit for generating one pulse?  (Read 2281 times)

0 Members and 1 Guest are viewing this topic.

Offline TechnologicalTopic starter

  • Newbie
  • Posts: 3
  • Country: 00
Circuit for generating one pulse?
« on: June 05, 2023, 11:33:57 am »
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 on

Would 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?
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3971
  • Country: nz
Re: Circuit for generating one pulse?
« Reply #1 on: June 05, 2023, 11:55:42 am »
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.
 

Offline TechnologicalTopic starter

  • Newbie
  • Posts: 3
  • Country: 00
Re: Circuit for generating one pulse?
« Reply #2 on: June 05, 2023, 12:32:22 pm »
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?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12753
Re: Circuit for generating one pulse?
« Reply #3 on: June 05, 2023, 12:55:43 pm »
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!
I'm going to activate startups and shutdowns remotely.
First 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?
« Last Edit: June 05, 2023, 10:17:58 pm by Ian.M »
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5817
  • Country: de
Re: Circuit for generating one pulse?
« Reply #4 on: June 05, 2023, 07:13:05 pm »
The MC14541 (onsemi) or CD4541 (TI) will do exactly what you want.
 
The following users thanked this post: RJSV, Technological

Offline krzysssztof

  • Contributor
  • Posts: 14
  • Country: pl
Re: Circuit for generating one pulse?
« Reply #5 on: June 05, 2023, 07:16:52 pm »
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.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3971
  • Country: nz
Re: Circuit for generating one pulse?
« Reply #6 on: June 06, 2023, 01:08:48 am »
Learning microcontroller programming could be a more time consuming task for a 1-off project. Would you suggest how to start?

That'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.
 
The following users thanked this post: Technological

Offline MMMarco

  • Regular Contributor
  • *
  • Posts: 69
  • Country: ch
  • Hobbyist. ⚠️ Opinionated
Re: Circuit for generating one pulse?
« Reply #7 on: June 08, 2023, 09:00:09 pm »
It so so easy a child can do it.

That's quite far from the truth. People who have absolutely NO experience in Programming will find it hard to do basic things, even with Arduino.

And literally childs' play.

It's child play for us (experienced programmers) because we know exactly what 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:

Quote
Because of the way the abs() function is implemented, avoid using other functions inside the brackets, it may lead to incorrect results.

abs(a++); // avoid this - yields incorrect results

// use this instead:
abs(a);
a++;  // keep other math outside the function


Which is a pretty awful way of phrasing "the input parameter will possibly get evaluated more than once" ; stating that abs is a function is 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++ is definitely NOT a good first language to learn  :-DD

---

I second the recommendation of using a 555 timer, there should be plenty of examples/tutorials online.
« Last Edit: June 08, 2023, 09:24:22 pm by MMMarco »
27 year old Software Engineer (mostly JavaScript) from Switzerland with a taste for low level stuff like electronics 😊

 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12753
Re: Circuit for generating one pulse?
« Reply #8 on: June 08, 2023, 10:03:33 pm »
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.

 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Circuit for generating one pulse?
« Reply #9 on: June 09, 2023, 12:47:29 am »
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.

 

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1315
  • Country: ca
Re: Circuit for generating one pulse?
« Reply #10 on: June 09, 2023, 01:30:10 am »
And C++ is definitely NOT a good first language to learn  :-DD
Really?

C was my first language.  :scared:
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
Want to see an old guy fumble around re-learning a career left 40 years ago?  Well, look no further .. https://www.youtube.com/@uni-byte
 

Offline MMMarco

  • Regular Contributor
  • *
  • Posts: 69
  • Country: ch
  • Hobbyist. ⚠️ Opinionated
Re: Circuit for generating one pulse?
« Reply #11 on: June 09, 2023, 01:32:39 am »
And C++ is definitely NOT a good first language to learn  :-DD
Really?

C was my first language.  :scared:

C and C++ are different languages, C is a good first language to learn IMO (if taught properly).
27 year old Software Engineer (mostly JavaScript) from Switzerland with a taste for low level stuff like electronics 😊

 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3971
  • Country: nz
Re: Circuit for generating one pulse?
« Reply #12 on: June 09, 2023, 02:19:52 am »
It so so easy a child can do it.

That's quite far from the truth. People who have absolutely NO experience in Programming will find it hard to do basic things, even with Arduino.

That is contradicted by more than a dozen years of experience around the world.
 

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1315
  • Country: ca
Re: Circuit for generating one pulse?
« Reply #13 on: June 09, 2023, 03:09:05 am »
C and C++ are different languages, C is a good first language to learn IMO (if taught properly).

C++ 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.   :-+
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
Want to see an old guy fumble around re-learning a career left 40 years ago?  Well, look no further .. https://www.youtube.com/@uni-byte
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Circuit for generating one pulse?
« Reply #14 on: June 09, 2023, 07:28:48 am »
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.
 

Offline EPAIII

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: us
Re: Circuit for generating one pulse?
« Reply #15 on: June 09, 2023, 09:28:43 am »
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.
« Last Edit: June 09, 2023, 09:43:11 am by EPAIII »
Paul A.  -   SE Texas
And if you look REAL close at an analog signal,
You will find that it has discrete steps.
 
The following users thanked this post: Technological

Offline MMMarco

  • Regular Contributor
  • *
  • Posts: 69
  • Country: ch
  • Hobbyist. ⚠️ Opinionated
Re: Circuit for generating one pulse?
« Reply #16 on: June 09, 2023, 01:01:36 pm »
It so so easy a child can do it.

That's quite far from the truth. People who have absolutely NO experience in Programming will find it hard to do basic things, even with Arduino.

That is contradicted by more than a dozen years of experience around the world.

Kids 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 Arduino might be easy, but as soon as you dig a little deeper you'll find lots of things that are off¹ ; 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++.



C and C++ are different languages, C is a good first language to learn IMO (if taught properly).

C++ is an OO superset of C.

No it is not. See https://stackoverflow.com/questions/3777031/what-prevents-c-from-being-a-strict-superset-of-c.

Also see here:

Quote
However, C is not a subset of C++,[3] and nontrivial C programs will not compile as C++ code without modification. Likewise, C++ introduces many features that are not available in C and in practice almost all code written in C++ is not conforming C code.



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.

Doesn'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 Arduino is still C++, so all the mistakes you can do in C++ you can also do in Arduino.

Arduino is not a 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.  :D  :-+
« Last Edit: June 09, 2023, 01:36:31 pm by MMMarco »
27 year old Software Engineer (mostly JavaScript) from Switzerland with a taste for low level stuff like electronics 😊

 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Circuit for generating one pulse?
« Reply #17 on: June 09, 2023, 06:51:29 pm »
Doesn'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 Arduino is still C++, so all the mistakes you can do in C++ you can also do in Arduino.

Ok, 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 board
void setup() {
  pinMode(2, OUTPUT); // Initialize digital pin 2 as output
  digitalWrite(2, HIGH);   // Set pin 2 high
  delay(2000);                 // Wait for 2 seconds
  digitalWrite(2, LOW);   // Set pin 2 low
}

// the loop function runs over and over again forever
void loop() {
  // Loop here doing nothing
}
 

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1315
  • Country: ca
Re: Circuit for generating one pulse?
« Reply #18 on: June 09, 2023, 07:07:33 pm »
No it is not. See https://stackoverflow.com/questions/3777031/what-prevents-c-from-being-a-strict-superset-of-c.

Also see here:

Splitting 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..
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
Want to see an old guy fumble around re-learning a career left 40 years ago?  Well, look no further .. https://www.youtube.com/@uni-byte
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7910
  • Country: us
  • Retired, now restoring antique test equipment
Re: Circuit for generating one pulse?
« Reply #19 on: June 09, 2023, 07:08:37 pm »
Similarly, a non-illiterate person can look into many 555 books, including this old one  https://worldradiohistory.com/UK/Bernards-And-Babani/Babani/Bababi-IC-555-Projects.pdf  .
 

Offline sparkydog

  • Regular Contributor
  • *
  • Posts: 225
  • Country: us
Re: Circuit for generating one pulse?
« Reply #20 on: June 09, 2023, 09:39:08 pm »
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 with this possibility 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 for both relays 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 a separate relay (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: something has to power the timing circuit; I don't know of any mechanical way 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 to disconnect said 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.
« Last Edit: June 12, 2023, 04:57:22 pm by sparkydog »
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: au
Re: Circuit for generating one pulse?
« Reply #21 on: June 10, 2023, 12:09:25 am »
A relay & a big, fat, electrolytic capacitor.
 
The following users thanked this post: Ed.Kloonk, Circlotron

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Circuit for generating one pulse?
« Reply #22 on: June 10, 2023, 02:07:30 am »
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.
 

Offline EPAIII

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: us
Re: Circuit for generating one pulse?
« Reply #23 on: June 10, 2023, 07:46:38 am »
The OP has an 80 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 to apply voltage of 3-5 V 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!



A relay & a big, fat, electrolytic capacitor.
Paul A.  -   SE Texas
And if you look REAL close at an analog signal,
You will find that it has discrete steps.
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: au
Re: Circuit for generating one pulse?
« Reply #24 on: June 10, 2023, 11:33:43 pm »
The OP has an 80 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 to apply voltage of 3-5 V 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!

A relay & a big, fat, electrolytic capacitor.

The 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf