1

I want to turn on a LED with a single push button. When the button is pressed, the LED has to be turned on for an X amount of time. But what I also want, is to turn of the LED with the same push button in this X time period. I've searched the internet for quite a time now but I never found the solution for this problem. Is there anyone who can help me with this ?

Thanks in advance

  • Could you better define the on and off conditions for the LED? Is the LED blinking or does it turn off only once after turning on? – kanoo Oct 20 '20 at 14:58
  • I'm sorry. The LED is not blinking or anything. It is just a simple case of turning on. The led has to be turned by hand with an push button and than automatically turned off after 30 mins. I want to be able to turn the led off during those 30 mins by the same push button. Hope this is a clear explanation. – leon bouman Oct 20 '20 at 15:14
  • Can you use a latching push button? If so pressing it once could supply power to a mono-stable , pressing it again would turn it off. – HandyHowie Oct 20 '20 at 15:27
  • 5
    30 minutes? This is *not* a job for a 555. To get a 30 minute period with a 555, you're going to need a ridiculously huge capacitor. I'd use a tiny microcontroller, which will also make it easy to implement the logic of "turn off after time elapses or when the button is pushed." Just the cap you'd need with the 555 will cost more than a microcontroller. – Jerry Coffin Oct 20 '20 at 15:31
  • Does this answer your question? [Is the NE555 the IC I need, and if not, what do I replace it with?](https://electronics.stackexchange.com/questions/486156/is-the-ne555-the-ic-i-need-and-if-not-what-do-i-replace-it-with) – Marcus Müller Oct 20 '20 at 15:45
  • Specifically, [this](https://electronics.stackexchange.com/a/486167/64158) answer about timers. – Marcus Müller Oct 20 '20 at 15:47
  • @JerryCoffin Thank you for your answer. Do you have any particular microcontrollers in mind ? Or a suggestion where i should look ? – leon bouman Oct 20 '20 at 16:52
  • Depends (heavily) on the surrounding circumstances. If this is a one-off hobbyist thing, then you typically care most about one-time costs (programmer, dev tools), in which case I'd consider something like a CH552, which has a built-in USB core, so you can just wire it up to a USB cord to program it, and it uses an 8051, for which there are lots of free tools. OTOH, if you're going to produce any quantity, spending $50-100 on a programmer to say $1/piece on the parts is a reasonable investment. Likewise, your ability to deal with surface mount parts helps determine the packaging you want. – Jerry Coffin Oct 20 '20 at 17:21
  • As far as things like the instruction set of the micrcontroller or included peripherals go: unless you're doing to do more with it than this, they barely matter. You need one input pin for the switch, and one output for the LED. Unless you decide to implement other stuff as well, the code should be no more than 20 lines of code. If you really needed to, you could probably get by with 32 bytes of ROM and 0 of RAM (which would have meant something in 1975, but today a chip with ~1-2K of Flash and at least a little RAM is so cheap that trying for less doesn't mean much). – Jerry Coffin Oct 20 '20 at 17:26

1 Answers1

0

enter image description here

I once designed a circuit to do that as shown above.

Each time the push button is pressed the 7555 generates a short pulse which toggles the D-Type flipflop resulting in the 4060 timer being enabled to run or held in reset.

C5/R7/D2 are a power on reset circuit.