Pinwheel Magic: Take a Spin with Animation
AbstractDo you enjoy watching cartoons and animated movies? Do you have fun playing video games? What do all of these things have in common? Fantastic computer animation, that's what! It's a cool job to take an interesting story or game and make it more entertaining by animating it. In this computer science project, you won't animate a full-length feature movie, but you will animate a pinwheel—a project that can go a long way toward creating your own longer animations! You will create an animated pinwheel that can spin as a result of a push of a button or puff of breath. How? Not by magic, but by writing a simple computer program. Don't worry, even if you've never programmed before, this pinwheel animation magic is within your reach. Sound interesting? Then read this science project and get started!
In this computer science project, you will create a pinwheel animation in Scratch that will spin as a response to user input from the PicoBoard.
Michelle Maranowski, PhD, Science Buddies
Cite This PageGeneral citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.
Last edit date: 2017-09-27
It's fun to enjoy a nice day at the park. There might be just enough breeze to fly a kite and enough space to run with a pinwheel and watch it spin with each step. You already know that a pinwheel needs wind in order to spin, even if it is just someone blowing on it. But what if you could make a pinwheel spin without wind, and instead, by pushing a button, a slider, or blowing into a microphone? That would be different and interesting! But how can you do this? Well, you can write a computer program that will make a pinwheel appear on your computer screen and spin when you push a button, puff a breath of air, or provide some other kind of user input. You might be asking, what is a computer program and what is user input? How do you put together a computer program? Let's start with some quick definitions.
Figure 1. This girl is having fun blowing on and spinning a real pinwheel—something you can do, too, on the computer screen! (istock.com, 2010.)
A computer program is a set of algorithms (instructions) that tell a computer exactly what to do. What can you use to put together such a set of instructions? One way you can put together a computer program is in Scratch, an easy-to-learn programming environment for your computer. Scratch is easy to use, so even if you've never written a program before, you'll be able to use Scratch! Plus, Science Buddies has put together a lot of help resources, including the Procedure of this project, to help you get started. You can write all kinds of programs in Scratch, including animations, stories, and games. Scratch offers the user (in this case, you!) many different types of instructions, called blocks, which you can snap together. All you have to do is to drag and drop the blocks that you need into the editing window and you can create something amazing!
Scratch offers all kinds of instruction blocks—blocks to change the appearance of objects on the screen, blocks that can make objects on the screen move, and even blocks that ask for user input. Wait, what is user input? User input is information that the user (the person using the computer) shares with the computer program, like pushing a button or talking into a microphone. The computer program then uses the user input to run the tasks in the program. Even now, as you, the user, read this on the computer monitor, you're giving the computer input. You're probably clicking the mouse or using an arrow key to tell the computer that you want to scroll down the page. The computer program, in this case your Internet browser, responds to that input by moving to the next part of the webpage. In Scratch, there is an instruction block that asks the user a question. Once the program receives an answer (user input), it then uses the answer to the question to make the rest of the computer program run the way you want it to.
You can also use a simple device called a PicoBoard to share information with the computer program. A PicoBoard is a collection of sensors. A sensor is a device that detects the presence or absence of something. An example of sensors with which you might be familiar is the Wii remote controller. Depending on the buttons you push or motions you make with the Wii remote (these are the sensors), different things will happen on the screen. The PicoBoard is similar—it is a small board with a button sensor, a slider sensor, a light sensor, a microphone, and other sensors. You can program in Scratch to receive information from the PicoBoard, then use any of these sensors to share information and interact with the computer program.
In this computer science project, you will build an interactive pinwheel animation using Scratch and a PicoBoard. The beauty of computer programming is that it allows you to create just about anything you can imagine, and this science project is a great way to get started. You can create a very cool computer science project, while having lots of fun!
Terms and Concepts
- Computer program
- User input
- Computer science
- Flow chart
- What is computer science? Is computer science all about programming?
- Can you describe examples in your home or at school where you see computer science demonstrated?
- What are some areas of study within the computer science field?
- Can you write out an algorithm for an everyday activity, like doing the laundry or making a sandwich?
These resources will introduce you to Scratch:
- Science Buddies Staff (n.d.). Scratch User Guide: Introduction. Science Buddies. Retrieved September 14, 2017 from https://www.sciencebuddies.org/science-fair-projects/references/scratch-user-guide-introduction
- Scratch Team (n.d.). Getting Started with Scratch version 1.4. MIT. Retrieved September 14, 2017 from https://download.scratch.mit.edu/ScratchGettingStartedv14.pdf
- Scratch Team (n.d.). Reference Guide Scratch version 1.4. MIT. Retrieved September 14, 2017 from https://download.scratch.mit.edu/ScratchReferenceGuide14.pdf
These resources provide more information about the Picoboard and using it with Scratch:
- Science Buddies Staff (n.d.). Scratch User Guide: Connecting & Using a Picoboard with Scratch. Science Buddies. Retrieved September 14, 2017 from https://www.sciencebuddies.org/science-fair-projects/references/using-a-picoboard-with-scratch
- SparkFun Electronics (n.d.). Picoboard. Retrieved September 14, 2017 from https://cdn.sparkfun.com/datasheets/Widgets/picoboard03.pdf
- Huang, B. (n.d.). Using the SparkFun Picoboard and Scratch. SparkFun Electronics. Retrieved September 14, 2017 from https://learn.sparkfun.com/tutorials/using-the-sparkfun-picoboard-and-scratch
News Feed on This Topic
Materials and Equipment
- Computer with an Internet connection
- PicoBoard (1), including alligator clip cables (4); available from SparkFun Electronics at www.sparkfun.com/products/10311
- Mini-USB cable (1); available from SparkFun Electronics at www.sparkfun.com/products/11301
- Optional: Digital camera
Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at firstname.lastname@example.org.
Pinwheel Magic: Take a Spin with Animation
Scratch Project Note
This project idea was written using Scratch version 1.4, which is available for download here. A Science Buddies tutorial for Scratch 1.4 is available here and additional tutorials are available on the download page.
The newest version of Scratch (2.0) is based on Adobe Flash Player, which will be retired in 2020 due to security flaws. Due to these security risks, Science Buddies has chosen not to update these instructions to Scratch 2.0. However, this project will work in Scratch 2.0. If you want to use Scratch 2.0, you can download an offline version here. If you must use the browser-based version (for example, you are using a school computer where you cannot install software), you can access it here. You may need to enable Adobe Flash Player in your browser to get Scratch to work.
Programming Your Pinwheel Animation
- In this computer science project, you will create a pinwheel animation in Scratch that will spin as a response to user input from the PicoBoard. It can use any of the sensors from the PicoBoard—the light sensor, the microphone, or the slider.
- The first thing you should do is download the Scratch program from http://scratch.mit.edu/scratch_1.4/.
- If this is your first time using Scratch, read the Science Buddies Installing & Getting Started with Scratch page. This short guide will familiarize you with Scratch.
- Now that you have downloaded Scratch, you need to get your computer set up to work with the PicoBoard. Read this Connecting & Using a PicoBoard with Scratch page to learn how to get your PicoBoard working and to learn more about the sensors on the PicoBoard.
- Once you have read all of the help documents and feel comfortable in the Scratch programming environment and with the PicoBoard, it is time to start the project. As noted at the beginning of the procedure, this science project follows the engineering design process.
- Define a need. In this case, you'll create a fun, interactive pinwheel. But you should first think about things like who is going to play with it and what colors might they like. First, define who your audience is and what features in a pinwheel they would like to see.
- Develop the project requirements. Before you start programming, you'll need to make a decision about what the pinwheel will look like and what the user will do to make it spin. Write down all your decisions.
Establish design criteria. Once you have settled upon the project requirements, you need to get down to the business of developing the specific details. These details are called the design criteria. Having a good set of design criteria will help you focus your efforts. The following is a set of questions to help you think about your design criteria. Note that it is not a complete list. You can either use this list of questions to develop your design requirements, or you can develop your own.
- How long will the pinwheel spin when the input is given?
- How many sprites will you use in the animation? From where will you get the sprites and how will they look? For example, will the pinwheel have three wings or four wings? Will you take a digital picture and then upload the image into Scratch or draw your own pinwheel using the paint feature in Scratch?
- Will you provide an instructions background sometime during the animation so that the viewer will know how to make the pinwheel spin?
- How many backgrounds do you plan to use in the course of the animation? Will you take a digital picture and then upload the image into Scratch?
- Would you like to use music in your animation? Will the animation be associated with a background or a sprite?
- How many different categories of blocks do you want to attempt to use?
- Try to use at least two blocks from the Control category.
- Which sensor will you use from the PicoBoard? Note: For a review of the different sensors, refer back to the Science Buddies help page Connecting & Using a PicoBoard with Scratch.
- What kind of motion do you want the pinwheel sprite to make once it receives input? How long should the pinwheel sprite move once it has received input from the user/PicoBoard? In which direction will it move?
- Create and analyze designs. Keeping your design criteria in mind, make a rough sketch, flow chart, or plan of what your pinwheel animation will look like and what the sprites do and/or say. A flow chart is a diagram of boxes where each box represents a step in the program you wrote.
- Build and test a sample program. Once you have created a set of design criteria, it is time to open up Scratch and start working on a sample program. Build your pinwheel sprite and have it do something interesting. Remember to review your design criteria as you work so that you keep yourself focused on the task.
Program your pinwheel animation. Keep testing the animation as you work. When you feel that you have accomplished a certain design criteria or task, run the animation and test it out.
- Break the task up into smaller tasks. For example, the first task to accomplish is to get a pinwheel to appear on the screen. The second task is to decide which blocks to use to start the pinwheel spinning.
- It is a good idea to test along the way so that you can iron out small issues as they crop up. You don't want to have a long program at the end that doesn't work and you don't know why.
- If you don't like what you see, then rearrange the instruction blocks into a configuration that you believe will work better.
- Once you have finished your animation, check to see that all of the requirements that you set at the beginning of the project have been met.
- Test and redesign. Test your animation on your friends and family and sit back and watch the fun! How did they like it? Can you use their feedback to improve your animation? Read the Science Buddies Troubleshooting a Program in Scratch if you need help with your program.
The Final Product: Presenting Your Animation
- Once you have finished the final version of your animation and you are happy with it, it is time to show it to your friends and family again.
- When presenting your animation work at your science fair, try to bring in a computer. If you are not able to do so, take many screenshots of your work, print them out, and mount them on a poster board.
Your science fair presentation should also include:
- The requirements list and the design criteria that guided your animation.
- A flow chart of how your animation program works.
- An explanation of what you learned from your research and from doing the animation.
Keep the fun going! Find local opportunities related to this project.Register on ActivityHero
If you like this project, you might enjoy exploring these related careers:
- Try to use as many sensors from the PicoBoard as possible in your animation.
- Try creating a story around the pinwheel, using different backgrounds, other sprites, and text. Can the audience use the pinwheel input to affect the outcome of the story?
- Tired of pinwheels? Apply the same principles to making an interactive animation of another object that interests you. Hint: When creating your design criteria, think carefully about what the object does and how people normally interact with it.
Ask an ExpertThe Ask an Expert Forum is intended to be a place where students can go to find answers to science questions that they have been unable to find using other resources. If you have specific questions about your science fair project or science fair, our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.
Ask an Expert
News Feed on This Topic
Looking for more science fun?
Try one of our science activities for quick, anytime science explorations. The perfect thing to liven up a rainy day, school vacation, or moment of boredom.Find an Activity