Algorithm animations are a resource that assists in learning algorithms by visually displaying the behavior of an algorithm at a higher level of abstraction than source code. On the other hand, augmented reality is a technology that allows extending visible reality in a mobile device, which can result in greater emotional well-being for the student. However, it is not clear how to integrate algorithm animations with augmented reality. The article makes two contributions to this concern. On the one hand, we describe an architecture that allows generating interactive algorithm animations, integrating them appropriately in the context of immersive augmented reality. This way the user can watch the source code of the algorithm, augmented with textual explanations, visualizations and animations of its behavior. We illustrate the use of the architecture by instantiating it to the well-known Dijkstra’s algorithm, resulting in an augmented reality tool that generates text, 2D and 3D visualizations. On the other hand, the influence of the tool on the user’s emotions has been studied by conducting an experience with face-to-face and online students. The results show that, with the joint use of augmented reality and visualizations, the students: experienced significantly more positive than negative emotions, experienced more agitation and stimulation than inactivity or calm, enjoyed as much as they expected, and their feeling of boredom decreased during the experience. However, students felt anxiety from the beginning and it increased with the use of augmented reality. The study also found that the face-to-face or online learning model influences emotions and learning outcomes with augmented reality.