Atmospheric distortion limits the quality of images obtained with ground-based telescopes. Similarly, laser beam propagation through turbulent atmosphere results in discontinuity in satellite optical links. Adaptive Optic techniques provide compensation for the aberrations introduced due to the random refractive index fluctuations of the atmosphere. In this paper, we present the practical details of the successful design and development of a low-cost Shack-Hartmann wavefront analyzer, as well as a closed loop Adaptive Optics system which compensates the global tilt and the local phase fluctuations of a wavefront. The Shack-hartmann sensor measures the wavefront profile in real time and generates correction signals. Global tilt measurements to accuracy of 19 μ radians and phase profiles up to λ/50 have been acheived. Dynamic corrections have been made with tip-tilt mirror and a deformable mirror. The Opto-mechanical system, software design, and implementation are described. Experimental results of wavefront measurements and correction of aberrations are presented.