Educational Robotics has had an important impact in recent years as it offers a number of advantages for students. The inclusion of robotics in any educational stage requires teachers with adequate predisposition and training, making it necessary to know the opinions of pre-service teachers. The aim of our study is to analyze the perceptions and self-confidence of 109 pre-service primary education teachers before and after an intervention based on educational robotics and challenge-based learning to teach scientific and mathematical content, in their third academic year. A quasi-experimental design was used involving pretest and posttest, using the nonparametric Mann-Whitney and Wilcoxon U tests. The results showed a significant improvement in the overall mean self-confidence. In addition, the intervention led to a more positive perception of the benefits and possibilities of robotics for teaching of scientific and mathematical content, although it also increased the difficulties of implementation due to the lack of training in this digital resource. It is concluded that interventions are required based on educational robotics that allow pre-service teachers to gain the necessary self-confidence and perception to facilitate its introduction for the teaching of scientific and mathematical content.