Not understanding behaviour of HCF4093BE: Schmitt Trigger NAND gates - Page 1
Forum section: electronics / beginners

author: javi14
author_rank: Newbie
timestamp: January 05, 2020, 04:57:26 pm
content: 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 86 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/Qxqr4AZS23kI 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.

author: rstofer
author_rank: Super Contributor
timestamp: January 05, 2020, 05:04:25 pm
content: 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.

author: wraper
author_rank: Unknown
timestamp: January 05, 2020, 05:09:50 pm
content: QuoteI 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.

author: james_s
author_rank: Super Contributor
timestamp: January 05, 2020, 05:15:19 pm
content: 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.

author: javi14
author_rank: Newbie
timestamp: January 05, 2020, 05:16:04 pm
content: Quote from: wraper on January 05, 2020, 05:09:50 pmBut arent they oscillating tooo differenly for the passive component errors? I expected to see it more slightly similar.

author: javi14
author_rank: Newbie
timestamp: January 05, 2020, 05:16:50 pm
content: Quote from: james_s on January 05, 2020, 05:15:19 pmMust try that!

author: wraper
author_rank: Unknown
timestamp: January 05, 2020, 05:23:29 pm
content: Quote from: javi14 on January 05, 2020, 05:16:04 pmIf 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.

author: wraper
author_rank: Unknown
timestamp: January 05, 2020, 05:28:14 pm
content: Electrolytic caps usually are rated for +/-20%, IC input threshold voltages are not quite precise too.

author: javi14
author_rank: Newbie
timestamp: January 05, 2020, 08:17:47 pm
content: Quote from: wraper on January 05, 2020, 05:28:14 pmSo, 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.

author: wraper
author_rank: Unknown
timestamp: January 05, 2020, 08:25:59 pm
content: Quote from: javi14 on January 05, 2020, 08:17:47 pmI 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.

author: wraper
author_rank: Unknown
timestamp: January 05, 2020, 08:37:07 pm
content: QuoteOf 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.

author: javi14
author_rank: Newbie
timestamp: January 05, 2020, 11:03:49 pm
content: Quote from: wraper on January 05, 2020, 08:25:59 pmSo 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.

author: james_s
author_rank: Super Contributor
timestamp: January 06, 2020, 01:48:31 am
content: 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.