I need a help to design a 1Khz square wave with adjustable duty cycle !!

Thread Starter

Layan_AK

Joined Mar 28, 2017
79
Hi All,

I need a help to design a 1Khz square wave with adjustable duty cycle ..
I Need to use LDR to adjust the duty cycle depending on light intensity ^^

Could anyone provide me a schematic ?

Regards ^_^
 

crutschow

Joined Mar 14, 2008
34,283
Here's a PWM circuit that has a voltage input to vary the duty-cycle (which is difficult to do with 555 type circuits).
It can go from 0% duty-cycle (full off) to 100% duty-cycle (full on).
The LDR can be used to provide the control voltage for the circuit at the Mod_In input (eliminate the pot and two resistors) shown in the schematic.

Any questions on that just post here.
 
Last edited:
If you dont wat to use a microprocessor you will probably want to create a sawtooth or triangle waveform at your clock speed and then use a comparitor to switch the output on when the signal is above the threshold derived from your control voltage.

Interestingly a 555 will give you a usable waveform on the discharge pin that effectively monitors the cap voltage.
Note that this will not be absolutely linear but with a low threshold on a relatively large cap it may get you close enough.

Of course there a mired ways to generate the clock, not least chips designed to generate waveforms, it depends what you need and how accurate you need to be. A 555 or even an opamp with a large on/off histerisis running as an occilator, which is essentally what a 555 is, may be a good place to start.

I built an AVR for a generator once using this method and I have also used it to position an RC servo, surprisingly well.

Al

Edit....
Probably should have looked at the link first...
At least I wasn't wrong... Sorry
 

AnalogKid

Joined Aug 1, 2013
10,987
Side question. If Wally's circuit trips at capacitor voltages of 1/4 and 3/4 Vcc, and a 555 trips at 1/3 and 2/3 Vcc, why are the equations for the operating frequency the same?

Correction, the 555 equation is not the same. See post #15.
ak
 
Last edited:

crutschow

Joined Mar 14, 2008
34,283
Side question. If Wally's circuit trips at capacitor voltages of 1/4 and 3/4 Vcc, and a 555 trips at 1/3 and 2/3 Vcc, why are the equations for the operating frequency the same?
I did a mod today to the circuit to change it from 1/3 and 2/3 to 1/4 and 3/4.
Which version are you looking at?
 

Thread Starter

Layan_AK

Joined Mar 28, 2017
79
thanks all :)
Crutschow i have tried the circuit you in the link ..
it worked fine :)

but i need to use 555 timer to do that as my doctor request from me :(

i found the following circuit i works fine ..
but i dont know how to use LDR in the circuit instead potentiometer :(
 

Attachments

crutschow

Joined Mar 14, 2008
34,283
but i need to use 555 timer to do that as my doctor request from me
Is that your teacher? So this is a homework problem?
He's asking you to use a component that's ill-suited to the job and that's not good engineering practice.

As I stated, 555s don't readily work as voltage-controlled PWM modulators.
On way is to get a limited PWM duty-cycle variation is to feed a voltage into the CV (Control Voltage) input.
 

Dodgydave

Joined Jun 22, 2012
11,285
The only way is to use pin5 as a Sweep vco using your Ldr in series with one of the resistors R3 /R4, this will just alter the frequency as the light level fades or increases, Vr1 sets the middle frequency.


NV_1200_Marston_Fig16.jpg
 

AnalogKid

Joined Aug 1, 2013
10,987
"adjustable duty cycle" over what range? Without knowing that we are just guessing; there is no way to design a working circuit.

ak
 

crutschow

Joined Mar 14, 2008
34,283
Okay, back to the 555 circuit.
You can use two 555's (or one 556) to generate a 1kHz PWM circuit from the variable resistance of the LDR.
Is that allowed by the doctor?

The first is configured as a 1 KHz astable multivibrator, adjusted to give a short negative going pulse.
This triggers a second 555 configured as a one-shot multivibrator with the LDR resistance controlling the one-shot period.
This will give a 1kHz signal out from the second 555 with the duty-cycle controlled by the LDR resistance.
 
Last edited:

Thread Starter

Layan_AK

Joined Mar 28, 2017
79
Okay, back to the 555 circuit.
You can use two 555's (or one 556) to generate a 1kHz PWM circuit from the variable resistance of the LDR.
Is that allowed by the doctor?

The first is configured as a 1 KHz astable multivibrator, adjusted to give a short negative going pulse.
This triggers a second 555 configured as a one-shot multivibrator with the LDR resistance controlling the one-shot period.
This will give a 1kHz signal out from the second 555 with the duty-cycle controlled by the LDR resistance.

Could you provide me with a schematic ?

Thanks in advance :)
 

AnalogKid

Joined Aug 1, 2013
10,987
What do you think the equation should be?
First, let me correct myself in post #4. The constant in your equation is not the same as the one for a 555 astable (memory burp). However, it is the same as the one for a CD4060 oscillator section. In any case, I do not think it is correct for the circuit you show.

Before, 0.33 and 0.67 trip points --> 1.44.
Now, 0.25 and 0.75 trip points --> 2.47.

ak
 

AnalogKid

Joined Aug 1, 2013
10,987
I've never thought this through before, but this tells me something new about the CD4060. The internal simplified schematic shows hysteresis on pin 9, but pin 11 must also be a hysteresis input, with trip points designed at .365 and .635.

ak
 

Thread Starter

Layan_AK

Joined Mar 28, 2017
79
Show us your results and we will help you with any questions or problems you may have.
I tried what i understood ^^

I built the following circuit ..

I start with full light intensity the output was a square wave of 1Khz with a certain duty cycle ..when i decreased the light intensity the duty cycle increased and the frequency still 1khz.
but when i decreased the light intensity under a certain point the frequency decreased as the intensity decreased :(

in simulator i used a pulse generator of 1khz on trigger pin instead of the first 555 timer astable ..

regards ^^
 

Attachments

Top