4
\$\begingroup\$

Ok to the issue I have been plagued with for some time now. The circuit is powered by a 4s Battery Pack (max VBAT = 16.8V, well below the CD4017 max V of 20V) After the Power-ON stage it is branched out to Voltage Regulators, see below.

I have designed (copied) a circuit using the (in)famous CD4017 decade counter as a pushbutton ON/OFF circuit.

  1. Hold pushbutton 3-4s decade counter switches from Q0 to Q1. This will power the MOSFET stage providing power to everything
  2. Hold pushbutton 3-4s decade counter switches from Q1 to Q2, which is tied into the Reset, which will reset it.

With the initial design I encountered some problems.

  1. Floating GND issue
  2. The reason I'm here. The CD4017 just resets itself, after just a very short ON pulse on Q1
To problem 1. The MOSFET stage is combined out of an n-channel MOSFET (pulled down) switching a p-channel MOSFET (pulled up), which then in turn switches the positive side of three different voltage regulators (12V, 5V, 3.3V).

Now you may wonder why n-channel to p-channel? I found the Voltage regulators tend to dislike a "floating" GND, which is the case, when switched by n-channel MOSFET. In the case of floating ground, these silly voltage regulators switch INCOMING directly to OUTPUT. (Yeah, don't ask me how I found out. Let's just say smoke was involved) <\For background information only>

Problem 2 (Actual reason I'm here) Now while the first problem also dealt with Power-ON issues, it was ultimately the floating ground prompting a re-design.

With Load attached (any one, or all Voltage regulators at same time) the CD4017 briefly switches Q1 HIGH, then resets itself. I have done the testing with only a single Voltage regulator connected and also with all three connected. Further downstream from the Voltage Regulators, there are no other loads during the testing, except of the status LEDs for each voltage.

Without any of the Voltage Regulators connected, the CD4017 switches happily between Q0 -> Q1 and then from Q1 -> Q2 (reset)

What have I tried so far?

  1. Due to inductive load, I have tried to add a freewheeling diode in multiple places, no luck
  2. disconnected capacitor C101 from the reset line, as I thought maybe the RST-spike comes from here. But later found the forum below explaining it is to deal with uncertain state on power-up, so I reconnected it.
  3. removed the load, powered on and then connected the load. Same issue.

I have searched the internet before posting and spend a good amount behind the oscilloscope to get an idea what is wrong, but seemingly I have hit my limits. More on the oscilloscope can be found below

This is one of the other posts I found, describing a similar problem, however in the end it did not help me. Power-on Reset for CD4017 gives unexpected results

Below are now some images, hopefully these will help. First is the schematic, followed by some oscilloscope traces.

Please, somebody with more in-depth understanding guide me into the right direction here. Been dealing with this for a month now :-/

schematic normal power on normal power off with load clock spikes 1 with load clock spikes 2 with load clock spikes 3 pushbutton rst spikes

\$\endgroup\$
5
  • 3
    \$\begingroup\$ I don't see any local power supply decoupling capacitors on the 4017. How are your grounds laid out? \$\endgroup\$
    – vir
    Commented Nov 17, 2022 at 18:52
  • \$\begingroup\$ Hi mate. thanks for the quick reply! Do you mean I need to add a capacitor between VBAT and PGND? Not sure i understand what is meant by decoupling capacitor \$\endgroup\$ Commented Nov 17, 2022 at 19:01
  • \$\begingroup\$ Do you see VBAT spike down as soon as a load is activated? If it does (due to high output impedance of battery) then perhaps 4017's VDD suddenly falling is causing it to reset. \$\endgroup\$
    – td127
    Commented Nov 17, 2022 at 19:39
  • \$\begingroup\$ I should lower R106 (1k) and C101 (10n). \$\endgroup\$
    – Antonio51
    Commented Nov 18, 2022 at 10:11
  • \$\begingroup\$ Thanks Antonio, I will give that a try this morning. What is the thought process behind this change? I'm guessing the smaller capacitance will provide less voltage for secondary spike and also deplete faster? How would I ensure the CLK signals stays HIGH the minimum required pulse length though? \$\endgroup\$ Commented Nov 18, 2022 at 17:13

3 Answers 3

7
\$\begingroup\$

The CD4017 specifies a minimum rise time or fall time of 15 microseconds on the clock input. Devices of this vintage do not have input hysteresis, so your clock signal slowly creeps up to the logic threshold. When there is no load, fine. But when there is a load, your power voltage drops slightly due to the inrush current, and the clock signal dips back below the threshold, then rises again, giving you an extra pulse, which moves you to Q2 and the reset.

To solve this using the CD 4017, you would need to have the clock input remain above the threshold when the load kicks in. One method is to add a comparator with some hysteresis.

\$\endgroup\$
3
  • \$\begingroup\$ Cheers for that @John Birckhead I will look further into this. Does not sound like an easy solution for existing circuit board :-/ Do you happen to have examples for a comparator, or maybe even a similar circuit design using a less vintage chip? Thanks heaps \$\endgroup\$ Commented Nov 17, 2022 at 20:33
  • \$\begingroup\$ analog.com/media/en/training-seminars/tutorials/MT-083.pdf contains a discussion of a hysteresis approach. Look for any logic device that has a Schmitt Trigger input - I only know of one (CD4093, quad NAND) from the 1970's era CD4000 family. Most modern IC's won't handle the 12 volts. \$\endgroup\$ Commented Nov 17, 2022 at 22:27
  • \$\begingroup\$ I have tried adding a decoupling capacitor across pin 16 and 8. Used a 100nF ceramic legged cap (the small droplet yellow style). However, it did not fix the issue. Not I don't even get the short temporary flash of the 12V indicator LED. Also added some wires so I can get more oscilloscope measurements tomorrow morning. Any other ideas in the meantime will be greatly appreciated.! \$\endgroup\$ Commented Nov 18, 2022 at 8:50
4
\$\begingroup\$

This mystery has been solved! I wanted to provide an update, so other can benefit as well.

First I followed @Antonio51 advice to lower R106 (1k) and C101 (10n), but that alone didn't provide the desired results. So I've added a number of tiny wires, so I can easily connect to my oscilloscope.

After messing about with it for a good long time, going through various measurements with load and without load, I finally checked CLK signal vs supply voltage directly on the IC itself with a load connected and noted the was a slight drop in voltage.

I then added a small ceramic capacitor of 100nF to the voltage pins of the IC. But it still showed a drop in supply voltage. That's when I opted to add the largest electrolytic cap I was able to find in my parts inventory to the screw terminal block where the main 16.8V is fed into the board. It was a 470UF, rated 25V.

And that did the trick. However, looking at the oscilloscope I was not able to tell a noticeable difference between the voltage dip before and after adding the large cap. But it works, and I'm sure the electrons know what they're doing.

This wouldn't be complete without some photos! Picture below shows two caps connected to the screw terminal (well the legs of 2nd one are visible), but I later reduced it to a single 470uF, 25V

VBAT and CLK oscilloscope PCB wires for oscilloscope caps installed

\$\endgroup\$
0
\$\begingroup\$

You only used the CD4017 as a "flip-flop" switch, therefore you only need a Schmitt trigger to do so, which incidentally would also solve your pseudo-bouncing issue.

A CD40106 would fit the SOP-16 pad, but it would require extensive trace cuts & rewiring.

If you repurpose the SOP-16 pad to a SOP-8 one and leverage a NE555 on it, you can wire it as a Schmitt trigger and enjoy a glitch free circuit.

I agree your solution is much better as it doesn't involve so much effort, but hey... Replacing anything with a NE555 always gets you extra hacker karma.

Here is a schematic that would fit your existing PCB. I left out the capacitor on CLK, as there's already C102 in your PCB. That said, you also have to remove D102. The discharge part will be taken care of by the NE555.

NE555 as Schmitt Trigger

I'd leverage the bottom 8 pins that are currently mostly unused :

SOP-16 pin SOP-8 pin
5 1
6 2
7 3
8 4
9 5
10 6
11 7
12 8

You just have to cut the trace from pin 8 of SOP-16 pad as it should be tied to VCC, or at least kept floating.

\$\endgroup\$
3
  • \$\begingroup\$ Oh. I didn't notice that the max voltage was 16.8 which is higher than the 16V from the NE555. You could swap it out for a SE555, which is rated to 18V, but I agree, the "wow" factor isn't that great anymore. \$\endgroup\$ Commented Nov 23, 2022 at 8:59
  • \$\begingroup\$ Wow, what a great suggestion! I will definitely try this circuit out. Unlikely I will modify the existing one, as it's already deeply built-into my Robot, plus wait time for parts order... But I constantly order PCBs. This would only take like 30 minutes to sketch on a small pcb and get ordered. Thank you @Steve Schnepp for this in-depth suggestion, I appreciate you taking the time! Will update this post, once I get to test this. \$\endgroup\$ Commented Nov 23, 2022 at 17:49
  • \$\begingroup\$ The circuit is actually very simple. I tweaked it a little to adapt it to your existing PCB. \$\endgroup\$ Commented Nov 23, 2022 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.