How to Transform a Roomba Bot Into a LifeGuard




Introduction: How to Transform a Roomba Bot Into a LifeGuard

As each day passes, the need and desire for space exploration by humans is approaching. Technological advances are allowing public and private sectors to begin to explore the possibility of sending a human to Mars. Because the day is coming when, not just a human but, humans will set foot on Mars, we set out to create a robot that will act as the explorer's personal lifeguard.

Parts and Materials required:


2.) iRobot's Create2 robot

3.) Desktop or Laptop

4.) Micro USB

5.) Raspberry Pi with sd card

6.)Wifi accessibility

Our desired inputs include:

1.) Time

2.) Distance

3.) Bump

Our desired outputs include:

1.) Image

2.) Sound

These will be the variables that allow our robot to do its job. As it reads the code we wrote for it, it will decide by itself how to respond to various situations. We want our robot to warn the explorer when threats and obstacles are ahead. The LifeGuard will sound an alarm, take a picture, and send the picture back to the explorer. Lets get started!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Install a Local Copy of MATLAB on Your Computer

1. Navigate to

2. Create a MathWorks account.

3. Download latest version of Matlab to your computer.

4. You should download and install ALL available toolboxes for the newest release.

5. If you have an older computer, it is OK to run an earlier version of MATLAB.

Step 2: Obtain the Roomba Toolboxes

1. Open MATLAB and create a new project folder to keep all of your project files together.

2. Use this script to install/update the required files: roombaInstall.m (Picture 1 and 2 show required code)

3. All the files should now be shown in your new folder. Right click in the current folder window and select "Add to Path" to add that path to the list of directories where MATLAB looks for files.

4. Make sure you have the latest version of the toolbox. To do this execute the command r=roomba and then r.getVersion. If your version is not the most recent, download the updated toolbox.

*follow this link to obtain the roomba toolboxes:

Step 3: Connect to Your Roomba Robot

1. Connect your laptop to the wireless network 'EFD Roomba Linksys' the password is ef230bot.

2. Add folders and subfolders to the path in MATLAB - in your current folder window navigate to the folder where you have the roomba toolbox stored, right click on them, and add them to your path. If you get an error regarding the path or undefined functions, this is because you skipped this step. Hint: If you use the Set Path icon and add your path to the top, you can add the path permanently so you don't have to do this every time.

3. Take your robot off its charger, using the handle to transport it. Carefully plug in the micro usb to the bottom port of your Raspberry Pi.

4. Hard reset the roomba with the 2 finger salute - press spot and dock buttons simultaneously for 10 seconds until the light dims and then release. You should hear a short scale play after you release the buttons.

5. To connect to the robot, use the code r=roomba(#). (where # represents your robot's respective number)

6. The clean button should be lit up with a solid green color, if not Press the clean button once.

7. Connect to the robot.

Step 4: Start Contructing Your Code

1. Begin with your end goals in mind.

We started with our end goals in mind by designating our desired inputs and outputs. In this case, because we want a robot that provides safety for our explorer, our inputs are time, distance, and bump relative to the robots sensors. We designated our outputs to be an image and sound (i.e. the warnings that the robot provides).

Step 5: Use a 'while Loop'

We used a while loop to allow the robot to sift through multiple commands while producing the correct output as it identifies its current inputs. In the first stages of your code, designate 'bumpers' as a variable and assign a value of '1' to each bumper. Then write your code so that your robot produces your desired output when the robot reads a value of one for the bumper. In our case, the desired output was sound. When the bumper reads a value of one, the robot will beep.

Step 6: Light Bump Sensors

Next, we want our robot to read its distance away from an approaching obstacle. Assign a variable to the 'light bump' sensors less than or equal to the robots corresponding values. In this case, it is 1000, 2500, 4500, and 10000 respectively. Our desired output is a change in the pitch of the sound the robot produces. When the robot is approaching an obstacle and reads a value less than or equal to the previous quantities, it will produce a higher pitch of the beep to warn the explorer.

Step 7: Cliff Sensors

Because we do not want our robot or the explorer to fall off a cliff, we designate a variable for the cliff sensors to identify a certain value. When the robot reads a value greater than 2500, we code the robot to stop. After it stops, the robot will back up, pause for 1 second, then turn 75 degrees and continue through the 'while' loop.

Step 8: Put Your Robot to the Test!

At this point, your code should be complete, and the robot should be ready to save lives. Before we send the robot to Mars, it is important we test it first. Create an obstacle course for your robot to test its abilities. You should add sturdy obstacles that it will be able to run into, and a section that portrays a cliff. Use white paper to portray the cliff. In our case, we used 'Big Orange' rocks!

Be the First to Share


    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest



    2 years ago

    That's a fun idea :)