Maker Pro
Maker Pro

CD4017B has the jitters

Bruce Ratcliffe

Aug 5, 2012
14
Joined
Aug 5, 2012
Messages
14
I've built an infrared-responsive circuit that toggles a relay OFF/ON. Sometimes, it toggles OFF/ON/OFF several times with a single press of a TV remote control button. I'm thinking a capacitor inserted somewhere would fix that flaw, but I can't find the right spot. Can you?PXL_20230221_230658906.jpg
 

Delta Prime

Jul 29, 2020
1,914
Joined
Jul 29, 2020
Messages
1,914
This is a trick question right?
You have 120 volts RMS applied directly to the 4017b my apologies via a relay to the 4017b.
"Max Smoke!" :eek:
 

danadak

Feb 19, 2021
751
Joined
Feb 19, 2021
Messages
751
Your relay circuit should include these basic circuit topology and
components :

1677034020047.png

I do not see any bypass parts for the chip power pins, like a .1 uF ceramic in parallel
with a 10 uF or better polymer tanatalum capacitor.

The chip is a micro I presume, have you established a routine to bounce in
and out the signal from the handheld controller ?

Regards, Dana.
 

Bruce Ratcliffe

Aug 5, 2012
14
Joined
Aug 5, 2012
Messages
14
This is a trick question right?
You have 120 volts RMS applied directly to the 4017b my apologies via a relay to the 4017b.
"Max Smoke!" :eek:
Dear Delta Prime,
ThaNks for getting back to me so quickly : ) I may have erred in drawing the circuit, but on the relay' blue plastic case, it says it can take up to 220 VAC. The relay DOES function as hoped--turning a 120 VADC lamp off and on. The CD4017B is powered by an 18650 Lithium battery (4.1 VDC) the whole thing works fine--sometimes. The problem is sometimes the relay does not just turn the lamp off (or on) when I press button on remote. It "chatters"--rapidly turns the relay on and off a bunch of times.
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
Without the flywheel diode (as per Danadak, post #3) the voltage spike when the relay coil switches off could have damaged the IC.
You might also need a decoupling capacitor (several uF) connected directly between pins 8 and 16)
 

AnalogKid

Jun 10, 2015
2,884
Joined
Jun 10, 2015
Messages
2,884
The output of a TV remote is *not* a simple on/off LED. It is a series of short bursts of a (approx.) 38 kHz square wave. The bursts vary depending on which button is pressed. Your circuit probably is responding to the bursts, which explains the chattering. However, your circuit does not show anything useful about the IR receiver device, circuit, module, or whatever. Without that, no one knows.

And, the 4017 needs power supply decoupling. And, there is that whole 220 V thing.

The 220 V rating on the relay is for the maximum voltage the contacts can switch. Separate from that is the rating for the coil. What is that? Also, please measure the coil resistance.

ak
 

crutschow

May 7, 2021
839
Joined
May 7, 2021
Messages
839
And you definitely don't want the circuit ground to be connected to the AC ground, as that's a serious shock hazard.
That's one purpose of the relay, to isolate the control from the output.

You should be able to eliminate the multiple switching by connecting a large capacitor (try 470µF or so) from the transistor base to ground (simulation below).

Be sure to add diode D1 to your circuit to protect the transistor.

1677080463887.png
 

Bruce Ratcliffe

Aug 5, 2012
14
Joined
Aug 5, 2012
Messages
14
Thaks so much Crutschow! I see my understanding of electronics is as a drop to the tank of a pre-lows flush toilet tank (~5 gallons = 454,600 drops) I have no idea what "PULSE (4 0 0 1U 1U 5MS 10) .tran 0.5s uic" means but I can see the reason for the 1N 4148 (to allow potentially dangerous back emf developed when coil is turned off to be harmlessly dissipated. and the 470 uF cap makes sense, too. I'll try both this weekend : )

Bruce (Know Nothing, but not letting that stop him from playing electronics) Ratcliffe
 

Delta Prime

Jul 29, 2020
1,914
Joined
Jul 29, 2020
Messages
1,914
Bruce (Know Nothing, but not letting that stop him from playing electronics) Ratcliffe
Know nothing? Then I know even less.. Thank you for your explanation.
In return. Tell Bruce... Playing around with 120VAC will not only kill him it will hurt the whole time he is dying. I have seen it with my own eyes. If Bruce can remember that then he'll have fun the rest of his life playing with electronics,
Thanks again
 

danadak

Feb 19, 2021
751
Joined
Feb 19, 2021
Messages
751
Thaks so much Crutschow! I see my understanding of electronics is as a drop to the tank of a pre-lows flush toilet tank (~5 gallons = 454,600 drops) I have no idea what "PULSE (4 0 0 1U 1U 5MS 10) .tran 0.5s uic" means but I can see the reason for the 1N 4148 (to allow potentially dangerous back emf developed when coil is turned off to be harmlessly dissipated. and the 470 uF cap makes sense, too. I'll try both this weekend : )

Bruce (Know Nothing, but not letting that stop him from playing electronics) Ratcliffe

Spice commands for .tran and PULSE :



Regards, Dana.
 

danadak

Feb 19, 2021
751
Joined
Feb 19, 2021
Messages
751
What is your relay coil current requirement or DC resistance ?

A 1N4148 may be too small a diode for this application. Same for BC547.....


Regards, Dana.
 

Bruce Ratcliffe

Aug 5, 2012
14
Joined
Aug 5, 2012
Messages
14
Dear Alec_t, Analog Kid, Crutschow, Delta Prime, and Danadak,

A big apology for me to you--If I'd thought about it, having a common ground for my 4.1 VDC (lithium ion battery)-powered IR detector/CD4017 AND the 120-VAC being controlled by the reLAY was a reaLEY dumb / dangerous idea. I wrote it in the drawing--guilty as charged--but would never have actually hooked up the circuit that way. (I'm a know nothing, but not a dumb know nothing.

On another happier note, I would like to thank all of you who jumped it to help me with my jittering CD4017 circuit. I hope to fix the issue this weekend, when I'll have time to spend hours, in needed, troubleshooting.

I suspect that with your expertise, I'll be able to solve it in minutes.

In any case, nice to meet y'all!

Bruce
 

AnalogKid

Jun 10, 2015
2,884
Joined
Jun 10, 2015
Messages
2,884
That looks like it has the driver transistor and transient protection built-in. You might be able to eliminate R2 and T1 in your post #1 drawing.

Link to vendor page?

ak
 

crutschow

May 7, 2021
839
Joined
May 7, 2021
Messages
839
A 1N4148 may be too small a diode for this application.
Not likely, unless it's a really large relay.
The diode only has to carry the relay coil current for the short time it takes to dissipate the coil inductive energy so, unless that current is above the peak current rating of the diode (500mA for the 1N4148), I don't see a problem.
 

crutschow

May 7, 2021
839
Joined
May 7, 2021
Messages
839
I have no idea what "PULSE (4 0 0 1U 1U 5MS 10) .tran 0.5s uic" means
The PULSE command determines the characteristics of the signal generated by the voltage source (generator) V1 (here a 4V to 0V pulse that's on for 5ms with a 10ms period, 1µs rise and fall times, for 10 pulses total, and then stays at the initial voltage (4V) for the rest of the time).
That simulates the multiple input pulses you are apparently seeing.

The ".tran 0.5s" command tells SPICE to do a transient simulation (calculation of all the various circuit voltages for any changes in all the sources voltage with time) for a half second of simulation time.
"uic" tells SPICE not to do an initial DC bias point calculation, which would otherwise mess up the start of the transient analysis.

Big slap to head:
On second though, I did a wrong interpretation of the problem, since the pulses are likely multiple triggering the CD4017.
So ignore my first circuit.
Below should be a solution for that, for a series of 38kHz pulses from the remote:

1677271769582.png
 
Last edited:

Bruce Ratcliffe

Aug 5, 2012
14
Joined
Aug 5, 2012
Messages
14
I'd like to thank all the people that helped me with my CD4017 IR activated remote control project. After many hours, I've failed to get 4 different designs to work. I didn't have any BC547 transistors, so I used 2N3704. Both of these creoss to an SK 3854. Granted, some of the YouTube videos are in incomprehensible (to me) languages, but the images, and part labels are a universl language. All four work great. You can see it right on your monitor! I'm writing because I'm beginning to think that a sizeable portion of "how to" YouTube videos are scams. I call to you attention: 40 perpetual motion machines. I don't know if people are so incompetent that they can't build a working circuit, but the videos I'v tried DO build a working circuit. You can see it right on your monitor! Last year, my Green Energy students spent 2 weeks building a "Methane Generator" that mixed leaves and lime. On the video, they guy boiled a big pot of water with the gas he'd made. We followed his directions perfectly but never got any methane. This is disappointing, that so many members of the human family take such delight in hoodwinking poor gullible people like me. I'm going to send post this now, as I must get back to my bench. I've found a circuit that makes an IR-activated latching switch using a CD4017. I'm sure it will work. It shows just that at the end of the video.
Discouraged in Fresno,
Bruce Ratcliffe
 

Attachments

  • PXL_20230226_002958495.jpg
    PXL_20230226_002958495.jpg
    341.9 KB · Views: 7

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
I'm sure it will work.
It looks correct, apart from the fact that there should be a reverse-biased diode (e.g a 1N4148) across the relay coil to protect the BC547 (and possibly the IC) from the back-emf voltage spike created when the coil is de-energised . Good luck.
 

Bruce Ratcliffe

Aug 5, 2012
14
Joined
Aug 5, 2012
Messages
14
It looks correct, apart from the fact that there should be a reverse-biased diode (e.g a 1N4148) across the relay coil to protect the BC547 (and possibly the IC) from the back-emf voltage spike created when the coil is de-energised . Good luck.
Why, thanks, Alec_t. I'll add that most sensible component in when I jump back to working on this project this weekend. Bruce
 
Top