Jump to main content

Robot, Make Me a Sandwich!

15 reviews


Active Time
10-20 minutes
Total Project Time
10-20 minutes
Key Concepts
Robotics, programming
Ben Finio, PhD, Science Buddies
A peanut butter sandwich made by a robot with jars of jelly and peanut butter


Have you ever wanted a robot assistant that could do all your household chores? Science fiction has been showing us such robots for decades, but they're still not available! What's taking so long? In this project you will investigate some of the challenges in programming a "robot" to do a simple household task, such as making a sandwich.

This activity is not recommended for use as a science fair project. Good science fair projects have a stronger focus on controlling variables, taking accurate measurements, and analyzing data. To find a science fair project that is just right for you, browse our library of over 1,200 Science Fair Project Ideas or use the Topic Selection Wizard to get a personalized project recommendation.


  • Bread
  • Peanut butter
  • Jelly
  • Knife
  • Plate
  • Paper towels
  • Volunteer
  • Pencil and paper
  • Surface that can tolerate a little bit of mess

Prep Work

  1. Think about the procedure you follow to make a peanut butter and jelly sandwich. Break it down into a series of steps, one at a time.
  2. Write this procedure down as a numbered list (step 1, step 2…). Make sure you include all the steps, even ones you think are obvious.
  3. Note: in order to avoid wasting food, you might want to have your volunteer make half or quarter-sized sandwiches.


  1. Give your written procedure and other materials to your volunteer. Your volunteer probably already knows how to make a peanut butter and jelly sandwich. Explain that you need them to pretend they have never made a sandwich before. You want them to do it by following your written directions exactly. They need to act like a robot and do whatever the instructions tell them to do—even if that results in making a mistake. They also should not assume any steps that are missing.
  2. Watch carefully as your volunteer follows the procedure. Do they make any mistakes? If so, at what step(s) of your program? Write down the step(s) and what problem(s) occurred.
  3. Now you need to "debug" your program by fixing the bugs, or errors, in the code. Based on your notes on any mistakes you observed, write a new version of your program and ask your volunteer to try again. Do they make the same mistakes as last time? Are there any new mistakes?
  4. Repeat the debugging process until your volunteer successfully makes a normal peanut butter and jelly sandwich.
    Think about:
    How many attempts did it take your volunteer to successfully make a sandwich?

What Happened?

You might have been very surprised to find out that at first, your volunteer failed to follow what you thought were a very simple set of instructions. There are a lot of tiny steps you take when making a sandwich that you might do automatically, without giving them much thought, and you could have forgotten to include these in your program. For example what if your program just said "spread the peanut butter on the bread"? That seems obvious enough to you. However, your volunteer might have done something silly, like used their fingers to spread peanut butter on the bread bag! But remember, your volunteer is a robot that needs very specific instructions. You did not specify that they should use a knife to spread the peanut butter, or that they needed to take a piece of bread out of the bag first!

There are a lot of other simple mistakes that can happen during this project—such as using the wrong end of the knife, not taking the lid off a jar first, putting the wrong sides of the pieces of bread against each other, etc. Each time you catch a mistake you will have to change your program to correct it and try again. It might take several attempts before you can fully debug your program!

Digging Deeper

Movies and TV are full of robots that can look, feel and act like humans. They can fly, talk, run, jump and do many other things. In the real world, however, robots are much more limited. Humans have gotten very good at building machines or making computer programs that can do one specific thing much better or faster than a human can. For example, we have computer programs that can beat humans at games such as chess, or TV game shows including Jeopardy. There are robotic arms that can rapidly assemble cars in a factory, much faster and more accurately than people can. You can even buy a robot vacuum cleaner that will automatically clean your floors!

Imagine, however, taking any of those robots and asking it to do a simple household task, such as folding your laundry or cooking dinner. They couldn't do it! They would need to be specifically built and programmed to perform those tasks. In this project focused on the programming side of this problem. A computer program is a set of instructions for a computer or robot to follow. Computers are very literal and will follow the instructions exactly, even if you make a mistake when writing the instructions. Things that might seem simple or obvious to a human, such as making a sandwich, will not be obvious at all to a robot. The robot has to be told exactly what to do. In this project you wrote a "program" for a person to make a peanut butter and jelly sandwich. As you may have discovered, this is more difficult than it sounds!

Note: building a robot that can do all the things a human hand can do—such as picking up objects with wildly different shapes without breaking them—is another entire problem on its own. In this project you will ask a volunteer to act like a robot, so you don't have to worry about building one. See the Additional Resources section for a link to a project on building a robotic hand.

icon scientific method

Ask an Expert

Curious about the science? Post your question for our scientists.

For Further Exploration

  • Try doing this project with verbal commands instead of written instructions.
  • Try this project with other household tasks, such as washing dishes, folding laundry, or cleaning your room.


STEM Activity
6 reviews
How do scientists and engineers control robots that drive around other planets millions of miles away? It's nowhere near as easy as driving a toy remote-control car here on Earth. In this activity you will experience some of the challenges you face when driving a "robot" that you can't see! Read more
STEM Activity
78 reviews
Do you know anyone who has had a hand or an arm injured in an accident? What if you could build them a robotic hand to help them accomplish everyday tasks like writing, picking up a glass, or opening a door? This activity will show you how to build a simple robotic hand using common household materials. Read more


Career Profile
Have you watched "The Transformers" cartoon series or seen the "Transformers" movies? Both shows are about how good and evil robots fight each other and the humans who get in the middle. Many TV shows and movies show robots and humans interacting with each other. While this is, at present, fantasy, in real life robots play a helpful role. Robots do jobs that can be dangerous for humans. For example, some robots defuse landmines in war-stricken countries; others work in harsh environments like… Read more
Career Profile
Computers are essential tools in the modern world, handling everything from traffic control, car welding, movie animation, shipping, aircraft design, and social networking to book publishing, business management, music mixing, health care, agriculture, and online shopping. Computer programmers are the people who write the instructions that tell computers what to do. Read more
Career Profile
Have you tried to install new video-game software or connect a new printer to your computer? Doing something like this can be a little scary because of concerns about what may happen to your computer if you don't do it properly. So you read the instructions pamphlet that came with the software or printer and follow it step by step. Thankfully, the instructions are clear and you are successful with the installation! You can credit a technical writer for creating those helpful directions that… Read more
Career Profile
A medical equipment repairer, or medical equipment technician, has an essential role in the fields of healthcare and engineering. From X-ray machines to electric wheelchairs, the medical equipment repairer can fix a wide array of machinery used in hospitals and clinics. They have detailed knowledge of how machines and instruments are to be maintained, how they function, and how to repair them. Broken medical equipment costs hospitals and providers time, money, and may pose safety risks for… Read more
Free science fair projects.