With 3.3v logic, it turns out you don't even need the transistor - just a capacitor and bias resistors.