SLAM is a prominent feature for autonomous robots operating in undefined environments. Applications areas such as consumer robotics appliances would clearly benefit from low-cost and compact SLAM implementations. The SLAM research community has developed several robust algorithms in the course of the last two decades. However, until now most SLAM demonstrators have relied on expensive sensors or large processing power, limiting their realms of application. Several works have explored optimizations into various directions; however none has presented a global optimization from the mechatronic to the algorithmic level. In this article, we present a solution to the SLAM problem based on the co-design of a slim rotating distance scanner, a lightweight SLAM software, and an optimization methodology. The scanner consists of a set of infrared distance sensors mounted on a contactless rotating platform. The SLAM algorithm is an adaptation of FastSLAM 2.0 that runs in real time on a miniature robot. The optimization methodology finds the parameters of the SLAM algorithm using an evolution strategy. This work demonstrates that an inexpensive sensor coupled with a low-speed processor are good enough to perform SLAM in simple environments in real time.