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

Discussion in 'Homework Help' started by Layan_AK, Apr 20, 2017.

  1. Layan_AK

    Thread Starter New Member

    Mar 28, 2017
    20
    0
    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 ^_^
     
  2. crutschow

    Expert

    Mar 14, 2008
    14,489
    3,692
    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: Apr 20, 2017
  3. Dyslexicbloke

    Active Member

    Sep 4, 2010
    441
    20
    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
     
  4. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    5,072
    1,436
    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: Apr 22, 2017 at 12:00 AM
  5. crutschow

    Expert

    Mar 14, 2008
    14,489
    3,692
    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?
     
  6. Layan_AK

    Thread Starter New Member

    Mar 28, 2017
    20
    0
    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 :(
     
  7. crutschow

    Expert

    Mar 14, 2008
    14,489
    3,692
    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.
     
  8. Dodgydave

    AAC Fanatic!

    Jun 22, 2012
    5,756
    890
    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
     
    Layan_AK likes this.
  9. AnalogKid

    AAC Fanatic!

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

    ak
     
  10. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    5,072
    1,436
    The 1/4 - 3/4 version. As dangerous as this is to say out loud, I think your frequency equation is incorrect.

    ak
     
    Last edited: Apr 21, 2017 at 7:10 AM
  11. crutschow

    Expert

    Mar 14, 2008
    14,489
    3,692
    Well, I was lazy and just derived the formula empirically from the simulation, so no guarantees. :rolleyes:
    What do you think the equation should be?
     
  12. crutschow

    Expert

    Mar 14, 2008
    14,489
    3,692
    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: Apr 21, 2017 at 9:01 PM
    Layan_AK likes this.
  13. Layan_AK

    Thread Starter New Member

    Mar 28, 2017
    20
    0

    Could you provide me with a schematic ?

    Thanks in advance :)
     
  14. crutschow

    Expert

    Mar 14, 2008
    14,489
    3,692
    Is this homework?
     
    Layan_AK likes this.
  15. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    5,072
    1,436
    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
     
  16. Layan_AK

    Thread Starter New Member

    Mar 28, 2017
    20
    0
    Yes ..
    I will try to build a circuit and then post the result here :)

    Regards ;)
     
  17. crutschow

    Expert

    Mar 14, 2008
    14,489
    3,692
    Show us your results and we will help you with any questions or problems you may have.
     
    Layan_AK likes this.
  18. crutschow

    Expert

    Mar 14, 2008
    14,489
    3,692
    My empirical calculation gave a value of 2.2, so that's close enough for government work. :rolleyes:
     
  19. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    5,072
    1,436
    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
     
  20. Layan_AK

    Thread Starter New Member

    Mar 28, 2017
    20
    0
    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 ^^
     
Loading...