In this thesis, we built an autonomous navigational system that can support any roaming device exactly plot its position from a starting point. The system is based on ADNS-2610 optical chip and Hitachi HM55B Compass Module which together with basic stamp 2 module gathers information about its position and plots it in simulation software in real time. The simulation software consisted of some fields to show values such velocity, acceleration, and displacement, heading etc of the device (robot) in real time and plot the movement on a 2D map. The 2D map is in fact a continuous line on the grid that shows the path that is traveled by the robot. This helped us to visually detect any flaws in our simulation software. We also have implemented a line following algorithm and built a corresponding required hardware from scratch. This helped us to cause the robot to follow a line and along with the simulation software plot in. The last part of the thesis was to detect the end of the line when reached, the robot stops as it does so.