This article discusses a novel approach to collective mapping that usesautonomous sensors to create safe routes in environments with gas leaks. The useof multiple mobile sensors seek to delimit different regions and assign them dif-ferent tasks according to their momentary needs. This collective approach aimsto optimize the routes to a gas source, offering safer alternatives for access toand from the environment. The sharing of information between sensors is essen-tial so that the mapping and optimization of safe routes are always balanced,with respect to the different functions of the mobile sensors. In this study, robotgroups act as multiple composite sensors that can move independently accordingto the functions assigned to them. Autonomous detection, collective mapping,and collective decision-making of the robots are behaviors bioinspired from thecognitive mechanisms observed in bacterial colonies. These colonies continuouslyseek to maintain the lives of their species based on their collective decision-making in searching for energy sources and changing colony size. Furthermore, although the sensors have a collective memory in all tasks, each sensor has anautonomous behavior of searching for gas leaks, during initial measurements. Inaddition, as gas dispersion in the environment increases, the received data fromthe sensors aids collective decision- making, assigning different functions, such asmapping, environment exploration, and routes creation, to groups of mobile sen-sors. Depending on the momentary need, the number of sensors in each groupchanges. The proposed method in this study was based on real mobile robots withcharacteristics that enable varying levels of scalability in size. Subsequently, itwas evaluated in a simulated system and developed for experimentation with gasand mobile sensors in a dynamic and realistic environment. Several experimentswere also designed to elucidate the collective contributions of mapping and creat-ing safe routes in environments subject to gas leakage. In addition to presentingthe agreement between the multiple mobile sensors, this study further contributesto the analysis of multiple tasks in homogeneous sensor groups in executing dif-ferent tasks. Furthermore, this work introduced a simulated experimental systemto test different topologies of multiple mobile sensors.