A square wave generator suitable for use with an electrosurgical device is provided. The square wave generator includes a voltage source configured to output a waveform and a comparator operatively coupled to the voltage source and configured to output energy in the form of a square wave. The generator may also include at least one sensor configured to sense an operational parameter of the energy outputted from the comparator and to provide a sensor signal corresponding thereto and a controller adapted to receive the at least one sensor signal and in response thereto control the voltage source.