I have a continuous 5V voltage which I would like to switch ON/OFF at a certain frequency. The output should be between 2V - 5V, and the minimum duration between ON/OFF should be 1 ms. The control over the frequency of switching is important, i.e. I need to be able to set the frequency of switch at 100 Hz for example.

Is there a device/chip which does this? Thanks in advance.

TL;DR - Device to convert a continuous voltage to a pulsed voltage at set frequency.

  • 1
    \$\begingroup\$ You could probably do this with a 555 timer chip. Read up on pulse width modulation. \$\endgroup\$ Apr 13, 2022 at 14:52
  • \$\begingroup\$ @Vimanyu you have multiple answers that are seeking your clarification and input. Please look at them and try your best to clarify their doubs/requests for more info promptly. \$\endgroup\$
    – nanofarad
    Apr 13, 2022 at 17:29

2 Answers 2


If you need the simplest configuration you can use a simple LM555.

The setup is done with resistors and capacitors to determine the frequency for Astable configuration.

  • \$\begingroup\$ This does not generate +2 to -5V from +5V, 0V power \$\endgroup\$ Apr 13, 2022 at 15:16
  • \$\begingroup\$ Yes, with some offset to bring 0 to 2 V. \$\endgroup\$
    – winny
    Apr 13, 2022 at 18:05
  • 1
    \$\begingroup\$ I don't think the "2V - 5V" meant literally the voltage output should be from 2V to 5V, it meant the positive output range from 2V to 5V. VCC for LM555 is 5V, but the output can be loaded with a resistor divider or if an actual load is needed a low power n-FET in saturation mode (rated for the target switching frequency). \$\endgroup\$
    – ondas
    Apr 14, 2022 at 8:17
  • \$\begingroup\$ Thanks @ondas! I have been looking into the 555 timer circuit. I saw the use of a potentiometer to control the frequency of the pulse, do you have any example circuit? Or another method to control the frequency from 1 Hz up to say 1 kHz? \$\endgroup\$
    – Vimanyu
    Apr 14, 2022 at 15:40

You have only +5V supply and specified;

a) fixed frequency 100 Hz = 10 ms cycle ( no tolerance given)
b) fixed amplitude range +2V, -5V ( no tolerance or d.f. square wave assumed )
c) rise time 1ms max ( no min. specified)
d) source or load impedance ( not specified)

Is this correct? Pls confirm.

If so, you need to amplify a 5Vpp signal to 7Vpp and clamp V+ to 2V.
First you need a -5V charge pump to create the amplifier with Av = 7/5 .
Then you need a clamp circuit or comparator with a pullup to 2V from -5V.

Output load capacitance will affect driver and DCDC conversion choices.

This is not the only way. Perhaps the requirements might change with other assumptions on circuit changed like Vgs(th) or configuration.

** If you meant 2 ~ 5V swing from 5V with a minimum On duration = 1 ms in a 10 ms that is 10% d.f.,** This must be specified as logic 0 or 1 or a switch closure to ground or 5V with some N or P type transistor or FET. (Which is yet to be confirmed and depends on load.)

Accuracy depends on tolerance specifications but 2% can be achieved with R Ratios in a relaxation oscillator + Vcc tolerance using 0.5% R's. There are many ways to make a Relaxation oscillator with hysteresis to get 10% d.f. And any desired swing and output impedance.


A) CMOS Schmitt trigger with input bias for asymmetry of 10% d.f. and R ratios and 2V Red LED to raise output with 10mA feedback current on output using 74HC' family. The LED anode will be the output and output impedance depends on R values + 50 ohm (approx) CMOS driver + 10 ohm LED impedance. RC=T where dV/dt=V/RC for voltage hystereis,dV and pulse duration dt with both states dt1+dt2=10ms using correct value of C. Schmitt triggers have 1/3, 2/3 approx. thresholds

B) Op Amp relaxation Oscillator with similar feedback as above.

C) 555 timer similar to above have more accurate thresholds of 1/3 , 2/3 for dual comparators. This may be more accurate for timing

D) using a 1kHz clock with a 1 of 10 output Johnson counter for precisely 10% duty cycle using some clock cct.

E) derive the 100 Hz from 50 Hz line using any ZCS , zero crossing switch, pulse design and then a one-shot to create a 1ms pulse.

  • E.g. this can be easily done with a C divider and large 1M resistor into a XOR CMOS gate and another 1M resistor with a 1ms delay to Vcc/2 to create a 100 Hz 1ms with the Vdd clamped to +2V with a 2V 10mA biased RED LED, so the output is from 2V to 5V. This is non isolated but current limited by 3 or more R's to withstand line voltages and is best PE earth grounded. (I've used that for a Triac Light Organ back in the '70's with sequencer clock & sound and manual dimmer control of 8x 1kW spot lights.)

There's a dozen other ways to do this too.

I assume you know how to search for timer circuits, or you will try.

This is a quick and dirty one but sensitive to CMOS threshold variations. It shows how to use a diode + RC for the narrow pulse and the larger RC for the overall frequency. A 1% change in R or C will change the result. There is some interaction between d.f and f. in changes. You can do this with any device.

enter image description here

  • 4
    \$\begingroup\$ 2 V - 5 V sounds like a positive range, not a statement like "2 V, negative 5 V". ON-OFF sounds like edge-to-edge (high time), not rise time. Hopefully op clarifies promptly \$\endgroup\$
    – nanofarad
    Apr 13, 2022 at 15:30
  • \$\begingroup\$ TY @nanofarad . \$\endgroup\$ Apr 13, 2022 at 17:17
  • 1
    \$\begingroup\$ Hi Tony, thanks again for this. The voltage output is between +2V to +5V max to clarify. I have been looking into a 555 timer circuit which can do this, and use a potentiometer to control the set frequency of the output. Is there an example circuit I can use? Another user replied, @ondas, and mentioned the Astable configuration. \$\endgroup\$
    – Vimanyu
    Apr 14, 2022 at 15:36
  • \$\begingroup\$ @Vimanyu For some 555 pulse circuits see my answers here: electronics.stackexchange.com/questions/613071/… and here: electronics.stackexchange.com/questions/615104/… \$\endgroup\$
    – GodJihyo
    Apr 14, 2022 at 19:12

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.