0
\$\begingroup\$

Is it possible to make bi-polar square signal from PWM signal?

Im talking about 40 kHz frequency and 0.5v /-0.5v peak to peak signal.

The PWM dose is %50. And the PWM frequency is 40 kHz too. The PWM is generated with an Atmel MCU with no extra parts. The MCU digital pins are rated at 5V.

\$\endgroup\$
  • 1
    \$\begingroup\$ Sure, A high pass filter is the easiest. If that won't work then you could use a comparator with the needed power supply rails. Or float a digital buffer/ inverter. (I think you meant to call this bipolar and not bidirectional.) \$\endgroup\$ – George Herold Sep 26 '14 at 13:14
  • \$\begingroup\$ As pointed out by @GeorgeHerold Do you mean bipolar? Bidirectional suggests its capable of being an input or an output, bipolar means the output switches between a positive and a negative level. You can make a suitable level shift circuit with an op-amp \$\endgroup\$ – Warren Hill Aug 11 '17 at 14:52
  • \$\begingroup\$ Yes bipolar. I changed the title. \$\endgroup\$ – user30878 Aug 11 '17 at 15:01
6
\$\begingroup\$

All you need is a capacitor to block DC and a resistor divider to attenuate the signal:

This example will have a output impedance of about 3 kΩ.

\$\endgroup\$
  • \$\begingroup\$ The capacitor will not distort the signal? \$\endgroup\$ – Martin Petrei Sep 26 '14 at 13:49
  • 2
    \$\begingroup\$ @Martin: Everything distorts a signal, the right question is whether the added distortion is within acceptable limits. In this example, the RC time constant is at least 10 ms. The 12.5 us levels are therefore 1/800 time constants long. The end of each level will therefore droop only 0.13% to the other level, or 1.3 mV. If that's not good enough, use a bigger capacitor. \$\endgroup\$ – Olin Lathrop Sep 26 '14 at 13:54
  • \$\begingroup\$ You're right. Thanks for the clarification. Good answer! \$\endgroup\$ – Martin Petrei Sep 26 '14 at 14:00
  • 1
    \$\begingroup\$ @ Olin: What the OP specifically asked was: "Is it possible to make bi-directional ( symmetrical) square waveform from PWM signal?". The answer, of course, is "no" but, as we all know, what he meant was: "Is it possible to cause a PWM signal which swings between 0 volts and some positive voltage to swing, instead, symmetrically between positive and negative voltages while maintaining its mark-to-space ratio? The answer is, of course, "yes", but since your answer didn't preserve the symmetry of the voltage swing over even the slightest range of duty cycle, it's invalid. \$\endgroup\$ – EM Fields Sep 26 '14 at 16:57
  • 1
    \$\begingroup\$ My belief is that, since the OP used the acronym, "PWM", his interest lies in duty cycles other than just 50%. If that's true, then your scheme clearly fails to meet the symmetry criterion requested by the OP and should be flagged as an error, regardless of your self-serving opinion as to the relevance of the error. \$\endgroup\$ – EM Fields Sep 27 '14 at 2:39
4
\$\begingroup\$

You can use a circuit like:

schematic

simulate this circuit – Schematic created using CircuitLab

where \$V_{ref}\$ is the level below GND that shifts the signal. For example, if the PWM signal is 1V amplitude, with \$V_{ref}\$ = 0.5V you get a square signal \$\pm\$0.5 V.

Of course, you can add a circuit for limiting or attenuating the output of the operational amplifier. The slew rate of this device is not too critical for the frequency of 40 k, and easily find such devices on the market.

Attention

The scheme I present is only a guideline for implementation. You must take into account the gain levels of OPAMP (adjusted with external components), or if you use a comparator, the levels of signal excursion, according to the power supply.

\$\endgroup\$
0
\$\begingroup\$

Use an inverting buffer and non-inverting buffer. You can use op-amps with +-5V supply to get the voltages you want, using gain resistors etc. for the voltage you need. Probably 1/10 gain to get down to the 0.5V level.

40kHz bandwidth is not much, so a general purpose (low slew rate) op-amp should be able to do it well enough. Especially because it will be a very low/fractional gain the slew rate should not be an issue at all.

\$\endgroup\$
  • \$\begingroup\$ are you sure that using cascaded inverting buffer and non-inverting buffer would give square wave? \$\endgroup\$ – Harsha Sep 26 '14 at 13:21
  • \$\begingroup\$ not cascaded, they both come off the same input signal. They will have the same phase. \$\endgroup\$ – KyranF Sep 26 '14 at 13:29
  • \$\begingroup\$ @Harsha see my comment above, I forgot to tag you in it \$\endgroup\$ – KyranF Sep 26 '14 at 15:40
  • \$\begingroup\$ How to get down the voltage level using the op-amp's gain? \$\endgroup\$ – user30878 Aug 11 '17 at 14:40
  • \$\begingroup\$ @user30878 with an inverting op-amp you can create a gain of less than 1. you can then un-invert it using another inverting unity gain (gain of 1) buffer after it. or you can use resistor dividers to reduce voltage, and then buffer the output of the resistor junction with the op-amp. \$\endgroup\$ – KyranF Aug 11 '17 at 22:29
0
\$\begingroup\$

The short answer is yes.

But you will need to pass the output from your PWM signal though some additional external circuitry in order to offset the center point of the signal and limit the range of voltages to the levels you want to see. That could be as simple as a couple of transistors or more likely an op-amp. Your circuit will also need to provide a negative voltage rail too.

It really depends what it is you want to be doing with the final output. Are you driving a motor, generating an audio signal or something else?

\$\endgroup\$
  • \$\begingroup\$ I plan to use this signal in water salinity/conductivity measurements \$\endgroup\$ – user30878 Oct 6 '14 at 12:00
0
\$\begingroup\$

As already mentioned above, you need to specify what load you are driving. It may even be possible to split your DC bus using a pair of caps if your load does not need to be referenced to DC ground.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
-1
\$\begingroup\$

Using an comparator with open loop configuration will do the job.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.