Author Topic: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates  (Read 1607 times)

0 Members and 1 Guest are viewing this topic.

Offline javi14Topic starter

  • Newbie
  • Posts: 5
  • Country: es
Hello everyone!,
this is my first post here, so I hope I can explain my question in an undestandable way!

My purpose is to use a HCF4093BE to blink some leds and build a led display. With this IC, there are 4 outputs, so I expect to be able to ligth 4 arrays of leds, forming 4 characters (displaying a person's name, for example). I attach the datasheet of this component.

I have tried the IC using a single NAND gate first, and I checked that everyting worked. By adding a capacitor and a resistor, I could get a beautiful oscillator. Then, it was time to add the other outputs to check that everything worked correctly. I am using transistors to drive de LEDs because I expect to drive many of them with a single output (thus increasing the current needed). I attach the schematic (note that I don't have 4 transistors of the same type, so I have mixed them) and the circuit (I am using a 5v 1A USB supply to power the circuit)

* hcf4093.pdf (348.84 kB - downloaded 77 times.)

When I powered the circuit up, I expected to see all 4 leds blinking. Maybe their frequencies would be different, as I expect the passive components to not be perfect. But for my surprise, the LEDs were blinking with an unexpected behaviour! They are following some kind of pattern, but then changing it randomly, so I really don't understand what is going on. I have recorded it and uploaded to Youtube, so you can see the leds blinking quite "randomly".

https://youtu.be/Qxqr4AZS23k

I will be grateful if someone can explain this to me, and provide me with a solution to this (if it exists), as I would want to blink them synchronously. The reason why I am using separate outputs, is because I want to be able to turn on and off some otputs, while keeping others on.

I guess that I have fallen into a trap for young players!
Thank you!

EDIT 1: Added a 100nF ceramic cap between VDD and GND, as close to the IC as possible. The behaviour of the circuit seems to be the same.
« Last Edit: January 05, 2020, 08:18:50 pm by javi14 »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #1 on: January 05, 2020, 05:04:25 pm »
With a 100k base resistor, I doubt that the transistors are turning completely on.  Stop the oscillation and measure the voltage between collector and emitter.  Ideally, you want to see the number around 0.2V or whatever VceSat is for the particular transistor.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 17952
  • Country: lv
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #2 on: January 05, 2020, 05:09:50 pm »
Quote
But for my surprise, the LEDs were blinking with an unexpected behaviour! They are following some kind of pattern, but then changing it randomly, so I really don't understand what is going on. I have recorded it and uploaded to Youtube, so you can see the leds blinking quite "randomly".
I don't see anything unusual. Each LED blinks independent of others, if you see any "pattern" at some points of time, it's just because oscillator frequencies are very close but not exactly the same.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #3 on: January 05, 2020, 05:15:19 pm »
I don't see any power supply decoupling, it's possible that your power rails are glitching and causing one channel to affect the others.
 
The following users thanked this post: javi14

Offline javi14Topic starter

  • Newbie
  • Posts: 5
  • Country: es
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #4 on: January 05, 2020, 05:16:04 pm »
Quote
But for my surprise, the LEDs were blinking with an unexpected behaviour! They are following some kind of pattern, but then changing it randomly, so I really don't understand what is going on. I have recorded it and uploaded to Youtube, so you can see the leds blinking quite "randomly".
I don't see anything unusual. Each LED blinks independent of others, if you see any "pattern" at some points of time, it's just because oscillator frequencies are very close but not exactly the same.

But arent they oscillating tooo differenly for the passive component errors? I expected to see it more slightly similar.
 

Offline javi14Topic starter

  • Newbie
  • Posts: 5
  • Country: es
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #5 on: January 05, 2020, 05:16:50 pm »
I don't see any power supply decoupling, it's possible that your power rails are glitching and causing one channel to affect the others.
Must try that!
 

Offline wraper

  • Supporter
  • ****
  • Posts: 17952
  • Country: lv
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #6 on: January 05, 2020, 05:23:29 pm »
Quote
But for my surprise, the LEDs were blinking with an unexpected behaviour! They are following some kind of pattern, but then changing it randomly, so I really don't understand what is going on. I have recorded it and uploaded to Youtube, so you can see the leds blinking quite "randomly".
I don't see anything unusual. Each LED blinks independent of others, if you see any "pattern" at some points of time, it's just because oscillator frequencies are very close but not exactly the same.

But arent they oscillating tooo differenly for the passive component errors? I expected to see it more slightly similar.
If there is say 10% difference in oscilator frequency, 10 cycles is enough for one oscillator producing one pulse less than other. Also they don't blink "randomly" as you said. They blink independently of each other but at certain frequency individual for each LED.
« Last Edit: January 05, 2020, 05:32:05 pm by wraper »
 
The following users thanked this post: javi14

Offline wraper

  • Supporter
  • ****
  • Posts: 17952
  • Country: lv
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #7 on: January 05, 2020, 05:28:14 pm »
Electrolytic caps usually are rated for +/-20%, IC input threshold voltages are not quite precise too.
 
The following users thanked this post: javi14

Offline javi14Topic starter

  • Newbie
  • Posts: 5
  • Country: es
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #8 on: January 05, 2020, 08:17:47 pm »
Electrolytic caps usually are rated for +/-20%, IC input threshold voltages are not quite precise too.

So, is it possible that each NAND input has a different threshold voltage? I understand that this would make my circuit useless, as I wouldn't be able to control the LEDs precisely.

But, what still bothers me, is that the LEDs are not oscillating at a fixed frequency (each of them, separated frequencies). It looks like their individual frequency is changing with time.  So my question is now, is it possible that the threshold voltage of the NAND inputs changes every oscillation period?

Thank you for your help, I really appreciate it.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 17952
  • Country: lv
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #9 on: January 05, 2020, 08:25:59 pm »
Electrolytic caps usually are rated for +/-20%, IC input threshold voltages are not quite precise too.

So, is it possible that each NAND input has a different threshold voltage? I understand that this would make my circuit useless, as I wouldn't be able to control the LEDs precisely.

But, what still bothers me, is that the LEDs are not oscillating at a fixed frequency (each of them, separated frequencies). It looks like their individual frequency is changing with time.  So my question is now, is it possible that the threshold voltage of the NAND inputs changes every oscillation period?

Thank you for your help, I really appreciate it.
I don't know why you want separate oscillators to begin with. If you want LEDs blinking synchronously, you need single oscillator. Even if you use super precise oscillators, they will go out of sync eventually. If you want to disable certain LEDs, you do it after oscillator, not create bunch of oscillators.
 
The following users thanked this post: javi14

Offline wraper

  • Supporter
  • ****
  • Posts: 17952
  • Country: lv
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #10 on: January 05, 2020, 08:37:07 pm »
Quote
It looks like their individual frequency is changing with time.
Of course frequency drifts by certain degree. However it has nothing to do with what you are observing. Your brain is just fooling you. Remove any 3 LEDs at a time and observe that each separate LED blinks at stable pace. Or just cover them with something non transparent if you are not convinced.
« Last Edit: January 05, 2020, 08:38:46 pm by wraper »
 
The following users thanked this post: javi14

Offline javi14Topic starter

  • Newbie
  • Posts: 5
  • Country: es
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #11 on: January 05, 2020, 11:03:49 pm »
Electrolytic caps usually are rated for +/-20%, IC input threshold voltages are not quite precise too.

So, is it possible that each NAND input has a different threshold voltage? I understand that this would make my circuit useless, as I wouldn't be able to control the LEDs precisely.

But, what still bothers me, is that the LEDs are not oscillating at a fixed frequency (each of them, separated frequencies). It looks like their individual frequency is changing with time.  So my question is now, is it possible that the threshold voltage of the NAND inputs changes every oscillation period?

Thank you for your help, I really appreciate it.
I don't know why you want separate oscillators to begin with. If you want LEDs blinking synchronously, you need single oscillator. Even if you use super precise oscillators, they will go out of sync eventually. If you want to disable certain LEDs, you do it after oscillator, not create bunch of oscillators.

So I will disable/enable them after oscillation. Using a single oscillator. It is definitely a better idea. Now I need to figure out the circuit to do it.
Thank you for your detailed responses!
This topic can be closed now.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates
« Reply #12 on: January 06, 2020, 01:48:31 am »
Ah, I thought the goal was to have them individually flashing out of sync was the goal, otherwise yeah use one oscillator and then use the other gates to individually enable the LEDs you want to flash.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf