Square wave generation

Thread Starter

engelbrekt

Joined Apr 21, 2021
6
Hello, Im asking for advice on making a small circuit. Square wave, 200hz, 10% duty cycle, amplitude of 12v. How do i make this as compact and easy as possible?
 

Irving

Joined Jan 30, 2016
1,497
But that won't give a 10% duty cycle... this version might... (though I agree the TS did, confusingly, ask for a square wave, not a pulse...)

1621607292459.png

But the ubiquitous 555 still is the best option... and 1 less part! (and yes, I know its 90% not 10% duty cycle, but that can be fixed by swapping pins 3 and 7 and adding a pull-up resistor to pin 7, or just using an inverter on the output.)
R1 = 56k, R2 = 6k8, C = 100nF
https://www.allaboutcircuits.com/tools/555-timer-astable-circuit/

1621607756112.png
 
Last edited:

Irving

Joined Jan 30, 2016
1,497
hi Irving,
Just for ref ONLY.

Problem is these types of PG's are very voltage and temperature dependant.
E
:)I agree, but the TS said simple, compact and easy, which as we all know != temperature or voltage stable. But good quality low-TC resistors, and a class 1 ceramic C0G/NP0 dielectric capacitor will cover the worst effects and is probably good enough for this (unspecified) environment & the 555 timing is pretty reasonable wrt voltage.:D
 

ericgibbs

Joined Jan 29, 2010
12,902
hi Irving,
The voltage problem lies within the CD4093 itself also the timing varies for same the R/C components when using a selection of CD4093's, especially from different manufacturers.

We had an application some years ago and we ran into this problem and had to go with an alternative solution.
I agree the 555 is a preferred solution.
E
 

Thread Starter

engelbrekt

Joined Apr 21, 2021
6
But that won't give a 10% duty cycle... this version might... (though I agree the TS did, confusingly, ask for a square wave, not a pulse...)

View attachment 239197

But the ubiquitous 555 still is the best option... and 1 less part! (and yes, I know its 90% not 10% duty cycle, but that can be fixed by swapping pins 3 and 7 and adding a pull-up resistor to pin 7, or just using an inverter on the output.)
R1 = 56k, R2 = 6k8, C = 100nF
https://www.allaboutcircuits.com/tools/555-timer-astable-circuit/

View attachment 239199
https://gyazo.com/2a502042989cf22e508f2fd1dcbfc65d

Would a BJT do the job as a NOT logic gate?
 

Thread Starter

engelbrekt

Joined Apr 21, 2021
6
As the output inverter? Yes, as your simulation shows... (what simulator is that?)
I realized when building the circuit that I didn't have the transistor that I was planning to use. I tried swapping pins 3 and 7 and adding a pull-up to pin 7. But it seems like I'm getting a 50% duty cycle. Is there something that I haven't considered?
 

click_here

Joined Sep 22, 2020
182
If you had access to 5V power I would be thinking about using a microcontroller - Something small like the PIC10F20x series using the 6pin SOT23 package. You can use the internal oscillator, and the program would be tiny!

You would then need a MOSFET to switch the 12V
 

Irving

Joined Jan 30, 2016
1,497
Proteus, first time working with this simulator. I will build the circuit on a breadboard and try it out. Thank you for your help Irving.
You're welcome.

I realized when building the circuit that I didn't have the transistor that I was planning to use. I tried swapping pins 3 and 7 and adding a pull-up to pin 7. But it seems like I'm getting a 50% duty cycle. Is there something that I haven't considered?
Ah, my bad, it does invert the signal but has the 'side-effect' of forcing the duty cycle to 50% (which is the only way to get 50% duty cycle on a 555). I'd forgotten that!

Almost any NPN or PNP transistor will do as an inverter. Or a small logic gate MOSFET, eg 2N7000/7002...
 

AnalogKid

Joined Aug 1, 2013
9,248
I'm getting a 50% duty cycle. Is there something that I haven't considered?
With the circuit straight off the datasheet, the positive half-cycle pulse width of a 555 astable multivibrator cannot be less than 50% of the output period. There is a modified version that uses external diodes to produce shorter pulse widths. It is very similar to the NAND gate oscillator in the same post.

This site has excellent tutorials on the 555. See figure 5.2:

https://forum.allaboutcircuits.com/threads/leds-555s-flashers-and-light-chasers.19075/#post-117641

ak
 
Last edited:

Irving

Joined Jan 30, 2016
1,497
Below is the LTspice simulation of an example 555 circuit, using a diode to give a 10% duty-cycle:
That's an option too, though I've found with small capacitor and large resistor values the charging current is quite small and, on the breadboard, the diode characteristics can impact on the on/off times, which rarely shows up in simulations. This is particularly so with lower Vcc (as thresholds are 1.66/3.33v at Vcc = 5v) though with 12V it should be OK (though don't recall trying it for real).
 

Irving

Joined Jan 30, 2016
1,497
I would think there would be less than a 100mV differences between diodes which, will have only a small effect on the on-time capacitor charging current/time.
Admittedly the effect is minimal in this non-critical scenario, about 1% of the pulse width between 15 and 30degC on 12v, 2% on 5v, but I've seen worse where it did become a problem, lower volts, higher temperature spread and smaller pulse widths.:D
 
Top