Author Topic: LED blinking question  (Read 1563 times)

0 Members and 1 Guest are viewing this topic.

Offline caiusTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: it
    • Caius Arcade Repairs & Engineering
LED blinking question
« on: November 28, 2022, 10:28:41 pm »
Hi all,
I have the need of blinking a LED when certain logic conditions are satisfied (specifically when a signal is low and another one is asserted).The simpliest solution is to use a MCU (or a PIC) but I think it's a waste for such small task.
I tried the monostable timer with 555 like explained here :

https://electronzap.com/brief-555-timer-monostable-one-shot-mode-circuit/

It works fine but only with one condition is satisfied (a fixed low signal)
Thanks in advance for any suggestion or help.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11859
  • Country: us
Re: LED blinking question
« Reply #1 on: November 28, 2022, 10:33:09 pm »
Use a blinking/flashing LED so you don't need any extra circuits at all?
 
The following users thanked this post: SeanB

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: LED blinking question
« Reply #2 on: November 28, 2022, 10:33:29 pm »
Have you considered just using a blinking LED, the kind with a built in IC to handle the blinking? Then you just need a logic gate. A single AND gate with an inverter on one of the inputs ought to do. You could use an IC with multiple NAND gates to accomplish the same thing.
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 2568
  • Country: gb
Re: LED blinking question
« Reply #3 on: November 28, 2022, 10:39:03 pm »
Quote
when a signal is low and another one is asserted
what state is the  asserted one? if its also low the a nor and flashing led,or use the left over nors as an oscilator to flash the led
 

Offline caiusTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: it
    • Caius Arcade Repairs & Engineering
Re: LED blinking question
« Reply #4 on: November 28, 2022, 10:42:58 pm »
Yes, I considered to use a blinking LED but the probem is that the LED is used on another circuit does not require blinking.I forgot to say that the assertion of one of the two signal is ~2.5us  (while the other one is fixed low)
 

Offline caiusTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: it
    • Caius Arcade Repairs & Engineering
Re: LED blinking question
« Reply #5 on: November 28, 2022, 10:45:25 pm »

what state is the  asserted one? if its also low the a nor and flashing led,or use the left over nors as an oscilator to flash the led

As said, the state of the asserted signal is low (the signal is active low) and the assertion is  ~2.5us.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: LED blinking question
« Reply #6 on: November 28, 2022, 11:02:43 pm »
So it sounds like you need to use that signal to load a latch.

The flashing is trivial, any sort of oscillator can flash an LED. If you need to use the LED for other purposes you can use a logic gate to gate the flash signal. For example, if you want a logic high to make the LED flash, feed the oscillator to one input of a AND gate and the enable signal to the other.
 

Offline caiusTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: it
    • Caius Arcade Repairs & Engineering
Re: LED blinking question
« Reply #7 on: November 28, 2022, 11:15:41 pm »
This is the logic : if signal 'A' is low when signal 'B' is asserted, the LED blink. If signal 'A' is high when signal 'B' is asserted, the LED stop blinking.
 

Offline caiusTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: it
    • Caius Arcade Repairs & Engineering
Re: LED blinking question
« Reply #8 on: November 28, 2022, 11:29:22 pm »
Perhaps a latch like a 74LS373 can do the job?
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: LED blinking question
« Reply #9 on: November 28, 2022, 11:43:53 pm »
This is the logic : if signal 'A' is low when signal 'B' is asserted, the LED blink. If signal 'A' is high when signal 'B' is asserted, the LED stop blinking.

Sounds like a D flip flop is what you need. Signal A goes to the data input, signal B goes to the clock input. Take the output of the DFF and AND it with the output of whatever oscillator you use.
 
The following users thanked this post: caius, EPAIII

Offline EPAIII

  • Super Contributor
  • ***
  • Posts: 1057
  • Country: us
Re: LED blinking question
« Reply #10 on: November 29, 2022, 04:47:11 am »
While there may be some 555 trick circuit that would do what you want, I don't know of it. And it is not in the 555 Cookbook. So I fear you will need two ICs as James suggests. You describe the classic case of a data latch, triggered by a clock or trigger pulse. The D flip flop is made just for that. Then the 555 or some other oscillator can be triggered by it;s output.

But a single chip u-processor (PIC) can do it all by itself and with a lot less additional components. This is an inexpensive one that is easy to program. And the first program in the manual is for a blinking LED.

https://www.sparkfun.com/products/10803

Another thought is to use the 556 timer IC which has two 555s in one package. The first one can be used as a flip flop while the second one will flash the LED when enabled by the output of the first. I was unable to find a ready made circuit for this, but it can probably be done. A PIC processor would still be simpler because of the number of other components (Rs and Cs).

This is the logic : if signal 'A' is low when signal 'B' is asserted, the LED blink. If signal 'A' is high when signal 'B' is asserted, the LED stop blinking.

Sounds like a D flip flop is what you need. Signal A goes to the data input, signal B goes to the clock input. Take the output of the DFF and AND it with the output of whatever oscillator you use.
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: caius

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: LED blinking question
« Reply #11 on: November 29, 2022, 05:00:32 am »
Easiest single IC solution probably is a microcontroller, something like one of the tiny little SOT-23-5 packages. I do see the appeal of doing it in hardware though.
 

Offline caiusTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: it
    • Caius Arcade Repairs & Engineering
Re: LED blinking question
« Reply #12 on: November 29, 2022, 09:49:42 am »
I tried the circuit with a D flip-flop and a 555 as oscillator, it works fine.Like you all said, I coud save some parts and use an IC instead.Anyway, since I will use a CPLD to embed all the logics, I want to do an oscillator with gates instead of using a 555.Which could be a good design to achieve it?With NAND or inverter gates?
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: LED blinking question
« Reply #13 on: November 29, 2022, 01:44:19 pm »
Which flip-flop IC did you use?

The CD4013 can be configured as an astable. I've tested the circuit below with the CD4013. It might also work with the 74HC74, but not all brands.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2389
  • Country: gb
  • Recovering Electrical Engineer
Re: LED blinking question
« Reply #14 on: November 29, 2022, 03:28:11 pm »
Everyone. You need to get past this 555 thing and the evil torturing FFs.Get some therapy.
Any old CMOS nand will do! If you dont have one get a tiny logic or other baby loner.
 

Offline caiusTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: it
    • Caius Arcade Repairs & Engineering
Re: LED blinking question
« Reply #15 on: November 29, 2022, 05:39:34 pm »
Which flip-flop IC did you use?

I used a 74LS74 current sourcing which triggers a 555.Anyway, I also used a 74LS74 current sinking and a blinking LED instead of the 555.Both designs are working fine, I attach schematics.
 
« Last Edit: November 29, 2022, 05:42:49 pm by caius »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: LED blinking question
« Reply #16 on: November 29, 2022, 05:44:00 pm »
I tried the circuit with a D flip-flop and a 555 as oscillator, it works fine.Like you all said, I coud save some parts and use an IC instead.Anyway, since I will use a CPLD to embed all the logics, I want to do an oscillator with gates instead of using a 555.Which could be a good design to achieve it?With NAND or inverter gates?

Is there a clock in the design? If so you can use a counter to divide it down to a reasonable frequency to blink an LED. It doesn't take a crazy amount of stages to divide down tens of MHz even.
 

Offline caiusTopic starter

  • Regular Contributor
  • *
  • Posts: 150
  • Country: it
    • Caius Arcade Repairs & Engineering
Re: LED blinking question
« Reply #17 on: November 29, 2022, 10:07:54 pm »
Is there a clock in the design? If so you can use a counter to divide it down to a reasonable frequency to blink an LED. It doesn't take a crazy amount of stages to divide down tens of MHz even.

Yes, there is a 8MHz clock signal feeding a MCU (which has no spare GPIO, otherwise I woud have used it for LED blinking).
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: LED blinking question
« Reply #18 on: November 30, 2022, 12:04:34 am »
Divide that down and use that to blink the LED. You can use something like this:

Clock_div: process(clk)
begin
   if rising_edge(clk) then
      ClkCount <= ClkCount + 1;
      clk_slow <= ClkCount(6);
   end if;
end process;

 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2389
  • Country: gb
  • Recovering Electrical Engineer
Re: LED blinking question
« Reply #19 on: November 30, 2022, 07:29:08 am »
I've got spare PC. I just put a serial port card in it. Now I can test for logic levels- I usually get the whole screen to flash!
Now, where is my IOT logic probe....?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf