Controlled by RPi 3.3V GPIO and driven by 5V. Square wave of desired frequency have to be generated by software. Volume is set by 100k trimmer. Schottky diode protects 3.3V pin against overvoltage in case some failure pass-through from 5V occurs. 500pF cap simulates MOSFET gate capacitance. 16 Ohm is RPi output impedance.