This document presents a Dragonfly algorithm to optimize load frequency control of a microgrid. A microgrid model is presented consisting of a diesel generator, electric vehicles, and wind turbine supplying loads. Frequency deviations occur due to imbalance between generation and load. A PID controller regulates the frequency but its parameters affect performance. Dragonfly optimization is used to minimize an objective function based on integral square error in order to optimize frequency deviations and improve system performance. Simulation results show the Dragonfly algorithm achieves better frequency regulation with lower error than particle swarm optimization for different operating conditions of the microgrid.