user1499: I want to create an AC PWM pulse with arduino. The microcontoller, will be also responsible for specifying the frequency (which will be around 500 Hz).
External electronic components can also be used. Like an H-Bridge perhaps.
EDIT: This is the final waveform I want to produce:

I know the arduino is not capable of producing 36 V output. I plan to just create this waveform, with whatever the arduino can output  and then step up the voltage. But this is the final waveform that I want produced.

user4143: Yes, you want a H-bridge. That is the simplest way to make that "negative*" voltage.
But you can't just create a square wave and throw it blindly at a H-bridge, you have to be much more careful, otherwise you will cause short circuits and dissipate massive amounts of power.
You will need a "discrete" H-bridge where you have proper control over each transistor, and the best way of doing that is with discrete transistors (MOSFETs are best).
The important thing to remember though is than no transistor ever turns off or on instantaneously - so you have to add a "dead zone" into your waveform.  Turn one pair of MOSFETs off, then wait a moment, before turning the other pair on. Otherwise you get a brief overlap in the switching where massive currents can flow straight through everything as all the MOSFETs are turned on (or partially on) at the same time.
Some microcontrollers have programmable dead zones in their PWM outputs, but I am not sure if the AVR chips do - you'll have to check the datasheet - but it's not too hard to arrange a suitable waveform in software or using timers and interrupts (you could look at the tone() function and support code for some ideas for the latter).
The programming sequence, if you have 4 outputs H1/H2/L1/L2 for the HIGH and LOW sides of the H bridge pairs 1 and 2, would be:

Turn on H1 and L2
Pause
Turn off H1 and L2
Brief Pause
Turn on H2 and L1
Pause
Turn off H2 and L1
Brief Pause
Repeat

You haven't specified what your load is, but with an H-bridge it is important to remember that the output is not referenced directly to ground but ground alternates from side to side. If you want to properly isolate it from the Arduino ground a transformer can be used as the load to the H-bridge then use the output of the transformer to drive your real load. You can also use the transformer to change the output voltage (the ratio of windings is the same as the ratio of input to output voltage - so a 1:1 winding transformer will give the same voltage out as it gets in).


"Negative" only that the current flows the opposite way through the load, not an actual negative voltage WRT to Arduino GND.


1499: <p>I want to create an AC PWM pulse with arduino. The microcontoller, will be also responsible for specifying the frequency (which will be around 500 Hz).</p>
<p>External electronic components can also be used. Like an H-Bridge perhaps.</p>
<p>EDIT: This is the final waveform I want to produce:
<a href="https://i.stack.imgur.com/rLOPE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rLOPE.png" alt="enter image description here" /></a></p>
<p>I know the arduino is not capable of producing 36 V output. I plan to just create this waveform, with whatever the arduino can output  and then step up the voltage. But this is the final waveform that I want produced.</p>
 4143: <p>Yes, you want a H-bridge. That is the simplest way to make that &quot;negative*&quot; voltage.</p>
<p>But you can't just create a square wave and throw it blindly at a H-bridge, you have to be much more careful, otherwise you will cause short circuits and dissipate massive amounts of power.</p>
<p>You will need a &quot;discrete&quot; H-bridge where you have proper control over each transistor, and the best way of doing that is with discrete transistors (MOSFETs are best).</p>
<p>The important thing to remember though is than no transistor ever turns off or on instantaneously - so you have to add a &quot;dead zone&quot; into your waveform.  Turn one pair of MOSFETs off, then wait a moment, before turning the other pair on. Otherwise you get a brief overlap in the switching where massive currents can flow straight through everything as all the MOSFETs are turned on (or partially on) at the same time.</p>
<p>Some microcontrollers have programmable dead zones in their PWM outputs, but I am not sure if the AVR chips do - you'll have to check the datasheet - but it's not too hard to arrange a suitable waveform in software or using timers and interrupts (you could look at the <code>tone()</code> function and support code for some ideas for the latter).</p>
<p>The programming sequence, if you have 4 outputs H1/H2/L1/L2 for the HIGH and LOW sides of the H bridge pairs 1 and 2, would be:</p>
<ol>
<li>Turn on H1 and L2</li>
<li>Pause</li>
<li>Turn off H1 and L2</li>
<li>Brief Pause</li>
<li>Turn on H2 and L1</li>
<li>Pause</li>
<li>Turn off H2 and L1</li>
<li>Brief Pause</li>
<li>Repeat</li>
</ol>
<p>You haven't specified what your load is, but with an H-bridge it is important to remember that the output is not referenced directly to ground but ground alternates from side to side. If you want to properly isolate it from the Arduino ground a transformer can be used as the load to the H-bridge then use the output of the transformer to drive your real load. You can also use the transformer to change the output voltage (the ratio of windings is the same as the ratio of input to output voltage - so a 1:1 winding transformer will give the same voltage out as it gets in).</p>
<hr />
<ul>
<li>&quot;Negative&quot; only that the current flows the opposite way through the load, not an actual negative voltage WRT to Arduino GND.</li>
</ul>
