Inspired by the advantages of the hierarchical feature extraction of deep learning, this work investigates the development of a Convolutional Neural Network (CNN) algorithm to solve the problem of the mobile robot obstacle avoidance in an indoor environment. The algorithm takes raw images and robot orientation as input and generates control commands as network output. Control commands include go-straight-forward, turn-full-left, turn-half-left, turn-full-right, and turn-half-right. A dataset compiled using depth images (RGBD) and robot orientation data obtained by an Inertial Measurement Unit (IMU). In addition, the performance of the algorithm in terms of training options, hyperparameters, and output precision is evaluated and recommendations are provided accordingly. The final results show that the accuracy can be improved by including the robot orientation in the dataset, increasing the size of data, and tuning the network's hyperparameters. The CNN algorithm has shown great potential to get high path classification accuracy for obstacle avoidance for mobile robots.