Microgrid is gaining importance and attraction by researchers all over the world as a replacement for conventional grid especially in the remote areas. But due to the continuously varying nature of the renewable energy sources as well as the load, the control of microgrid is a vital task both in standalone mode and grid connected mode. This paper investigates the application of Artificial Neural Network (ANN) for Voltage control in a DC/AC microgrid. The system considered consists of PV, boost converter and an Inverter. The triggering pulse for the boost converter connected to the PV system is obtained by the ANN which is trained to track the maximum power point (MPP) under variable insolation as well as variable temperature conditions. Compared to other conventional methods, ANN trained MPPT is able to track the changes in the load with lesser oscillations and peak overshoot. Also this paper investigates the control of inverter in the grid forming mode by applying ANN. The performance and the stability of the microgrid is enhanced by adopting additional control strategies like getting the reference current signal also from the AC grid, feeding the integration of error signals along with the error themselves as well as by giving the disturbance voltage at the ANN output for better control. The result shows that the ANN controlled inverter is able to maintain the voltage at the required nominal value following the disturbance..