In case you are looking to make a Buck controller based on arduino, this is a simple circuit to drive the PMOS transistor mainly for buck circuit applications.
This circuit is simple and only consist of NPN and 1 PNP transistor. The circuit above is part of my MPPT solar charger circuit.
I have tested this circuit with my MPPT solar charge controller project and it working. It is operating at 100kHz. Take not that this circuit is designed for input voltage up to 20V. You might need to modify some resistors to make it work on higher voltages.
Here’s the simulation of the circuit using LTSpice software.
On this circuit I used 2 MOSFETS back to back to prevent reverse current from battery to the solar panels connected on the input. With only 1 MOSFET, the ESD diode inside the MOSFET will allow the current to pass from output to input.