PWM driving 4017ic chip

Thread Starter

Steevefrench

Joined Sep 7, 2020
15
Good day,
I trying to get a adjustable pwm (ZK-PP2K) to drive a 4017 chip.
The purpose of this is to make the PWM more accurate by diving its signal by 10. The output "carry out" (pin 12) of the 4017chip could drive a mosfet or an other 4017 chip for even more accuracy.

I have not been able to find a stable way to make this work. Many hours of reading and destroying chips. :(

I was hoping someone could steer me in the right direction. thank you.

I am powering the system with 5vdc right now.
 

DickCappels

Joined Aug 21, 2008
10,153
Are you paying attention to factors such as maximum clock rate, minimum pulse widths?

If you are actually destroying chips, something very serious must be going on. Do you have a schematic you can post? The more you share with us, the better out ability to help.

Edit:ZK-PP2K P: Are you sure the output voltage is compatible with your 5 volt CMOS? Do you realize that as you get close to a 0% duty cycle the '4017 will stop counting?
 

Alec_t

Joined Sep 17, 2013
14,280
I trying to get a adjustable pwm (ZK-PP2K) to drive a 4017 chip.
Perhaps I'm misunderstanding what you are trying to do, but the 4017 is clocked when the clock pulse reaches a threshold voltage level, as set by Schmitt trigger action, so I don't see how the pulse width (providing it exceeds a certain minimum) is important?
 

KeithWalker

Joined Jul 10, 2017
3,063
Good day,
I trying to get a adjustable pwm (ZK-PP2K) to drive a 4017 chip.
The purpose of this is to make the PWM more accurate by diving its signal by 10. The output "carry out" (pin 12) of the 4017chip could drive a mosfet or an other 4017 chip for even more accuracy.
I don't understand what you mean by saying you want to make it more accurate. The 4017 will just divide the frequency of the positive going input pulses by 10. What is the purpose of your application?
 

Thread Starter

Steevefrench

Joined Sep 7, 2020
15
Thank you guys!

The purpose for this experiment is rather simple:

Accuracy: the Zk-pp2k is only accurate to a point, first it only allows for 1hz change at the time. Also when I use my oscilloscope I found that it is at best 3-5% accurate. by dividing the signal by 100 ( using the 4017ic) putting 100hz on the pwm would give me 1hz.
After dividing it by 100 it would be even more accurate, so lets say the actual output of the pwm if 99.5z or 100.9hz, after using two 4017ic I would get 0.995hz and 1.09hz respectively.

on top of that I would get the option to adjust the frequency of a cheap pwm much more accurately.
I would be able to get 1.5hz with some measure of accuracy.

The main purpose of this is to conduct a research on brain plaque and possible removal of it. which is a leading cause of Alzheimer's disease.
Long story short, we have found very strong evidence that Gamma wave (rarely occurring under normal daily activity) is able to remove such plaque.

For the purpose of this research I have to create a fairly accurate pwm for cheap as we are always lacking money....
Up until now I was able to waffle my way through all the technical items,
(classical electrodynamics back ground) but for the life of me I cant figure out this IC4017..... so I decided to talk to the expert.

hope this helps.

All I need for the time being, is a way to divide the pulse of a pwm by 100. :)
you guys tell me how I could achieve this using the ZK-PP2K, and I will forever be in your debt. :)
 
Last edited:

Ian0

Joined Aug 7, 2020
9,667
Dividing it isn't going to make it more accurate.
If it is 105Hz when it should be 100Hz, then dividing it by 100 will make it 1.05Hz when it should be 1.00Hz, still 5% out.
 

dl324

Joined Mar 30, 2015
16,839
After dividing it by 100 it would be even more accurate, so lets say the actual output of the pwm if 99.5z or 100.9hz, after using two 4017ic I would get 0.995hz and 1.09hz respectively.
There's more to PWM than just the frequency. Compare the following scenarios:
1663706678043.png
Note that in both cases, the output waveform is the same. You lose all kinds of information by trying to divide by 10. That's ignoring the complexities caused by 0 and 100% duty cycle.
 

Papabravo

Joined Feb 24, 2006
21,157
How about we show you an actual circuit for generating an accurate PWM signal. Your approach is, to be charitable,...misguided.
 

Thread Starter

Steevefrench

Joined Sep 7, 2020
15
Dividing it isn't going to make it more accurate.
If it is 105Hz when it should be 100Hz, then dividing it by 100 will make it 1.05Hz when it should be 1.00Hz, still 5% out.
YES you are right, I did not mentioned that the %accuracy of the pwm appear top be a bell curve of accuracy, being less acurrate sub 50hz, also the diving will give me the option to have a better selection of the frequency, example : 1.1hz or 3,6hz something I can not do with the zk-pp2k
 

Thread Starter

Steevefrench

Joined Sep 7, 2020
15
Likely your scope is off by 3-5%.

If you have a signal that is 5% off and you divide by 100 it is still off by 5%.

You cannot divide a PWM signal and get any PWM.
Ok, question:
If I have an original frequency of 100hz and (through the magic of the pixies of logic gates that I dont understand) make it go through a 4017ic that divide that original 100hz to 10hz, I would consider this dividing the original signal of 100hz by 10 to get 10hz? what is the proper wording for this operation ?
:)

The goal of this conversation is simply for me to get my hands on (building it if I have too ) :" how to make an adjustable pwm from 0hz to 100hz with a precision of 0.1hz increment. For as low of price as possible. Do not have nasa budget yet!

I was hoping to build this using a 4017ic.
 

Papabravo

Joined Feb 24, 2006
21,157
PWM is not usually expressed in terms of frequency; it is expressed in terms of duty cycle as a percentage of the period. For example, if the basic period of a waveform is 10 msec, which corresponds to a frequency of 100 Hz, and you want a duty cycle of 47%, the waveform will be on, or high for 4.7 msec and low for 5.3 msec. You can change the duty cycle in such a way that the frequency stays the same and you adjust the duty cycle. It would be less common to fix the duty cycle and adjust the frequency, but such applications do exist. It would be most uncommon to vary both frequency and duty cycle independently.

In circuit terms, one classic method of generating a PWM signal is to use a triangle waveform with a fixed frequency and compare the triangle wave voltage to a fixed or variable reference voltage. This is often done in SMPS (Switch Mode Power Supplies) and DC to AC Inverters.
1663718126298.png
U1 generates a triangle wave that goes between -1.01 VDC and 1.01 VDC, Set the green trace labeled V(ramp). The frequency of the triangle wave is 3kHz times 12 = 18 kHz.
V1 is a reference sinewave generator with a peak amplitude 0.99 Volt-Peak at a frequency of 3 kHz.
U2 is a generic comparator, which outputs +10 VDC when the + input is greater than the - input, and 0 VDC otherwise.
U3 is a generic 2nd order low pass filter with a corner frequency of 3.5 KHz, which is slightly above the frequency of the reference sinewave, with a Q of 0.707.
The output of the filter is an amplified replica of the input reference sinewave.
 

ThePanMan

Joined Mar 13, 2020
773
Let us first try to understand HOW PWM works. It takes a frequency, in theory any frequency, but in practice, generally a fairly high frequency of what I understand to be 20KHz. PWM, Pulse Width Modulation, doesn't change its frequency when you adjust it, it changes how much time it spends at HIGH versus at LOW. If you have a primary voltage of 10 volts and PWM is set to 50% duty cycle (as)
it is expressed in terms of duty cycle as a percentage of the period.
half the time the voltage is high and half the time the voltage is low (High and Low refer to "ON" and "OFF"), the average voltage is 5V. Changing the duty cycle (High versus Low) you change the output. 70% High results in 7 volts (as is with my random example of 10 primary volts). If you chop that duty cycle by 10 you have 10% of the primary voltage. You no longer have an adjustable PWM source. Dividing it with another 4017 you end up with 1 volt. You're not going to increase accuracy, you're just going to change an adjustable voltage to either 10% or 1%.

Final synopsis - it's not going to work the way you think.
 

ronsimpson

Joined Oct 7, 2019
2,985
The purpose of this is to make the PWM more accurate
Let's start over.
1) You don't want "PWM" but you want a signal. (Frequency not duty cycle)
2) You don't want "more accurate" but more resolution. Right now, you have 1hz and you want 0.01hz.

So yes, dividing the frequency by 100 will get you better resolution.
Set your ZK-PP2K to a frequency 100x what you want. Now the "1hz resolution" on the ZK-PP2K will result in 0.01hz on the output.

Many hours of reading and destroying chips.
We should be working on why you are destroying chips.
 

Thread Starter

Steevefrench

Joined Sep 7, 2020
15
Thank you, s
Let's start over.
1) You don't want "PWM" but you want a signal. (Frequency not duty cycle)
2) You don't want "more accurate" but more resolution. Right now, you have 1hz and you want 0.01hz.

So yes, dividing the frequency by 100 will get you better resolution.
Set your ZK-PP2K to a frequency 100x what you want. Now the "1hz resolution" on the ZK-PP2K will result in 0.01hz on the output.


We should be working on why you are destroying chips.
Yes, I am grateful you have explained to me the right word to use, RESOLUTION,
I need to be able to take the output of the PWM and make it higher resolution.
I have been able to to make the output of the PWM drive a 4017ic chip to 500hz, getting the "Resolution" of 5hz stable only.

I apreciate the the "signal" and "resolution"
 
Top