HCF4027B delayed commutation.

Thread Starter

q12x

Joined Sep 25, 2015
1,657
I have this IC, HCF4027B - to datasheet
I find out there is a newer version of it, an equivalence probably, or its predecessor CD4027. Both do the same thing and have the same pins functions.
Building this circuit, i realize my IC is doing something strange.
When I activate with +5V on pin 3, - if i keep the wire, or button or contact long enough, like 500ms, it activates in ON state, and the led stays on. If I keep the wire very short period, like 10ms, so very fast contact, it commutes to OFF state.
If im trying to switch normally, same time period for bots on/off, it will stay mostly on, or randomly off.
The cycle between on and off, is the normal one, i only have problems with how much time i make the contact.
Maybe the IC is damaged? or its normal behaviour?
I tried with a simple wire, with a switch, and an LDR. Ldr is more sensitive and it amplify this behavior and i can clearly see this big diference when moving hand to switch.
What do you recommend?
Probably i should make the scheme im using now, with all the values , since im experimenting and i dance around the original circuit values from the link i post here ?
But basically, I want a clean OFF and a clean ON, and not as analog as it is now, dependent for delays in commutations, to do its proper job.
Thank you very much.
 
Last edited:

Dodgydave

Joined Jun 22, 2012
11,284
Firstly what are you trying to do, apply a positive trigger and get a low signal out, or any trigger and get a low signal out, ?if you can use a different chip to get the same response then I would do so...
 

Papabravo

Joined Feb 24, 2006
21,159
What are you doing with the other pins? J, K, SET, RESET. You do realize that not only do you have to account for the other pins on the part of the chip you are interested in, but all of the other pins as well. That's right you have to account for all the pins on FF2 as well.
 

dl324

Joined Mar 30, 2015
16,845
I have this IC, HCF4027B.
https://pdf1.alldatasheet.com/datasheet-pdf/view/243173/STMICROELECTRONICS/HCF4027B.html
I find out there is a newer version of it, an equivalence probably, or its predecessor CD4027. Both do the same thing and have the same pins functions.
When comparing part numbers, you need to pay attention to the suffix. CD4027 would generally be considered to be CD4027B (B is for buffered inputs and/or outputs). HCF is the prefix STM uses instead of CD. Motorola/OnSemi used MC14027.

Part numbers without a suffix could also be the original unbuffered 4xxx series CMOS.
When I activate with +5V on pin 3, - if i keep the wire, or button or contact long enough, like 500ms, it activates in ON state, and the led stays on. If I keep the wire very short period, like 10ms, so very fast contact, it commutes to OFF state.
It could be a problem with switch bounce or multiple triggers if you're using a wire instead of a switch.

The format used for the schematic you referenced is poor for conveying circuit intent. With a single flip flop, it's not too tedious to read, but it would be painful for a more complex circuit.

clipimage.jpg
EDIT: grounded set pin.

We normally assign the flip flop with the smaller pin numbers as "A" or "1". Whoever did the schematic used a different convention.

In my schematic editor, the package type is used for the suffix. N = through hole, D = surface mount.
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
1,657
I made the original circuit as shown in image and is working somewhat fine with very little glitches.
My intention is to make it light activated switch.
All i did was to add an LDR circuit in place of S1 switch. With this, I can feel more better what is going on, on that pin 3, by waving my hand over LDR.
The output is pin1 with the led on it.
The input is on pin3 through all that amplified ldr circuit.
I show in the graph the behavior i could understand from the circuit i made. It's values are not absolute.
Shadow enter probably is not the same as i draw it there, but the most noticeable was shadow leave. Too short or too long, and the switch is not executed correctly.
I did so many tests i forget things, but i think on 3V the circuit was behaving as it should without this very visible weird behavior i get from 5V.
hcf copy 1.jpg
 
Last edited:

dl324

Joined Mar 30, 2015
16,845
You have the collector and emitter terminals of the transistor reversed.

You may have problems with a slow rise time on the clock. The datasheet specifies the maximum rise time to be 15us for a 5V supply. You'll get better performance if you replace the transistor with a comparator.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,657
You have the collector and emitter terminals of the transistor reversed.
I know the PNP pins are reversed but it just works as that. Dont ask me why. If i mount it corectly, it just lay dead.
I think my IC is broken. But i thought on using the other half of the IC. I have to test it and come with the results.
 

AnalogKid

Joined Aug 1, 2013
10,986
Both of your circuits are missing power supply decoupling between Vdd and Vss.

Also, all of the inputs for the unused flipflop *must* be connected to either Vdd or Vss. CMOS devices do *not* like floating inputs.

With the components shown, the LED current is approx. 0.3 mA. That is very low, and your LED probably is very dim.

ak
 

dl324

Joined Mar 30, 2015
16,845
I know the PNP pins are reversed but it just works as that. Dont ask me why. If i mount it corectly, it just lay dead.
Operating in inverted mode will only give a small current gain. Wire it correctly and troubleshoot the circuit and you'll get about 10X more current gain.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,657
So embarrassing, I have a bunch of transistors, most of them I took out from boards, and I'm using this little very handy GM328A Transistor Tester. I was so sure i read it right before. Now i checked again and the transistor was in the normal and correct way, I just read the pin numbers wrong, and thought its just a weird transistor (from factory or whatever). So sorry for that, but you happen to jump up very hard on the issue, which is good.
Ive also modify the image, and corrected the pnp T1 pins.
Back to my problem. Is my IC bad? Or is just a normal behavior?
See, I dont have an oscilloscope to read it's switch contact in detail. I have to rely on very primitive ways, like the one i just explained so far. It also happens that i want it to be light switch activated so the ldr must be there. I read what mister dl324 sugested , using a comparator IC. I sincerely, didnt play too much with comparators in my life so ill have to play with them, if i find one in my spares (also collected from boards).
I already buy some new cd4027 from ebay, and they will arive in 2 months or so, but until they arrive, i want to try this one that i have. I hope is not damaged. It still doing something. As i mentioned, at 3V is more stable than on 5. Maybe to lower down its voltage with a 3.3V zenner ? (i also get some from ebay too, so i must wait for those also).
Ive built this circuit like 15 years ago, I found the board and i want to re-make it now. But a lot of the components are missing and the circuit board is a mess... i wasnt that good back then, but i make it work for some good time as a room light switcher, waving my hand and the room light got switched. I remember holding my hand in the light beam, and quickly moving out to make the switch, both for on and off states. But now... its a bit uneven, and i want it even, the on and the off time switch.
 
Last edited:

MrChips

Joined Oct 2, 2009
30,708
Going from 5V to 3V is should not be a problem. This is a red herring.
What have you done with pins 4, 5, 6, 7, 9-13?

Why do you have J and K both high?
Show us a photo of your actual layout.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,657
I thought is obvious, MrChips, I used exactly the same circuit as in the original one. I only changed the mechanical switch, with the ldr circuit. But I will make the entire circuit, its not a problem, and sorry if i was presuming too much. Its true, sometime i presume too much and too quickly.
 

dl324

Joined Mar 30, 2015
16,845
I used exactly the same circuit as in the original one.
What they're getting at is that the unused flip flop could be oscillating or experiencing abnormal power dissipation. If you ground all of the inputs, you can prevent that from happening.

Similarly, decoupling caps can prevent problems caused when the outputs change states. There's a brief time that both output transistors are on and that can put spikes on the supply that can cause misbehavior.

I rarely show decoupling caps on schematics unless I'm making a board. It's usually understood that supply decoupling is being used. Some will also complain if power connections aren't shown. My schematic editor hides them and I like it that way because it's usually just a distraction. You can't please all of the people all of the time but, here, it's more likely that there are some people that you can't please at all and they'll nitpick you.
 

MrChips

Joined Oct 2, 2009
30,708
You also need to define what it is that you are trying to do.
With J and K both high, this is a toggle-flip/flop.
This is not likely the solution you want when trying to interrogate a mechanical push-button.

What do you want to happen when you pass your hand over the LDR?
 

Thread Starter

q12x

Joined Sep 25, 2015
1,657
....I rarely show decoupling caps on schematics unless I'm making a board.....
Yes, about this. You are very right. Im using them when I power from a transformer. Or filtering caps they are called. Immediately after the rectifying bridge.
But right now, im using a variable bench power supply, like this one:
https://i.ebayimg.com/images/g/bDUAAOSwZcZZ1gni/s-l500.jpg
My first 15 y old circuit, i prototype it with its own 6V transformer back then. I think its the most healthy way of designing circuits like that. But its also a bit clumsy with all the wires, so, if i already have my bench Power supply, why not use it. Its a very good diagnostic tool in the same time, if used with some brain.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
10,986
It still is not clear to me what you want the circuit to do. What are you trying to achieve? Do you want the LED to come on at night and go off during the day? Or something else?

ak
 

Thread Starter

q12x

Joined Sep 25, 2015
1,657
It still is not clear to me what you want the circuit to do. What are you trying to achieve? Do you want the LED to come on at night and go off during the day? Or something else?

ak
Not at all. I just want to switch the light. That simple. But not from a mechanical switch, but more fancy, from a light beam. (from a led toward the ldr, which i didnt include in the circuit design). I planned back then to also use instead of a led, a laser toward ldr. Today i have the means to test that. But not yet, until the proper switching.

The story goes like this:
I did this circuit while the filament lights were the most used commercially, and in absolutely every home. And it worked Perfectly.
Then, I installed a long neon tube, and i could not use my circuit with this type of light source. very short after this experiment, the neon light bulbs appeared on the market. The first capacitive dropper circuits i think. I think i try it with those too, and also my circuit didn't work.
And now, are the watt led light bulbs. So... what the heck, right? Or ill switch back to filament just for the pleasure of having light beam switching back.
:)
But i put all this circuit + relays + transformer, in paralel with the 220Vac light bulb. So it was interfering with it, especially the neon ones.
This time i will use power outlet, and not the same light bulb wires. Thats the plan. I'll have to deal with the wiring, but it will solve any type of light bulb. I did thought about this back then for sure. But i didnt liked the idea of wiring. Now, i dont mind.
 
Last edited:
Top