25+ Coding Projects for Beginners and Beyond
Planning an hour of code with students for Computer Science Education Week? Try these projects and activities to help students explore computer coding now and after!
It's easy for students to get started learning about computer programming and video game and app design. Basic coding involves writing an algorithmic set of steps that tell a computer exactly what to do. No matter what language or programming environment will be used, learning to write effective instructions for a computer involves breaking things down into logical and orderly steps and understanding an if/then mentality that a computer uses to perform specific tasks based on certain criteria.
We've got suggestions below for more than 15 experiments kids can do to explore computer coding at all levels, including introductory options that don't even require a computer! Many of these activities are short and can work well for an hour of code. Many of these can also be easily adapted for remote and asynchronous learning.
- Coding Projects and Activities for Beginners
- Projects and Activities for Intermediate Coders
- Programming Projects — Intermediate to Advanced
- Programming with Arduino — Physical Computing
- Artificial Intelligence Projects
- Learn about the Broadcom Coding with Commitment® program
Think Like a Computer — Coding Projects and Activities for Beginners
With the Robot, Make Me a Sandwich! activity, even the youngest of students are encouraged to start thinking like coders. As they create a set of directions to guide a volunteer "robot" in making a sandwich, they quickly see how important it is to think through all of the steps, be very specific, and not leave anything out.
2. Pixel Puzzle
With the The Pixel Puzzle: Why Video Game Characters Look Better Today project, students use graph paper to make their own images and see what difference the resolution (or number of pixels) makes in how an image looks. This project is more about graphics and less about code, but students interested in program development or game design will be interested in the science behind how things look on the screen. Despite advancements in imaging technologies, many popular computer games (like Minecraft) use simplified images that call attention to pixels.
With the Mars Rover Obstacle Course activity, students create a set of instructions to guide a pretend rover through an obstacle course. Paper-based mazes are easy to create, easy to scale in difficulty, easy to gamify, and can be great for this kind of logic-based activity, too. These activities help reinforce the kinds of thinking involved in writing programs. (For a similar activity, see Program a Maze with Paper. For additional inspiration, see Paper Maze Programming: Start to Finish Computer Logic. We have a fun Gingerbread-themed version for December, too, in our Gingerbread STEM collection!)
The Butterfly Algorithms lesson plan for K-3 guides beginning coders in practicing computational thinking using the life cycle of a butterfly as the subject. After developing an algorithm to model the life cycle of a butterfly, students can program it using Scratch.
The How do Self-Driving Cars Know What to Do? activity guides students in thinking about how self-driving cars can be programmed to autonomously respond to whatever situation arises. Students think through some of the common scenarios and events the car will encounter and write an algorithm that a driverless car could follow when navigating various road scenarios like stop signs, traffic lights, and roundabouts (traffic circles). This activity encourages discussion and brainstorming as students think about the science behind self-driving cars. The activity is part of our Autonomous Cars collection of STEM materials.
The Quick Draw McPaws: Teach A Computer Kitty How to Draw Shapes project is great for beginning coders. Students learn the basics of Scratch, a free drag-and-drop coding environment, and create a program with a character (a sprite) that can draw different shapes.
Projects and Activities for Intermediate Coders
With the Make a Greeting Card Come to Life! project, students build on their skills using the free Scratch coding environment to design their own custom greeting card with animated characters.
With the Want to Make a Video Game? Here's How! project, students use Scratch to design their first video game. As an introduction to game design and programming, this is a great starter project that introduces skills kids will continue to build upon as they continue to refine their skills and the game's playability.
With the Program Your Own COVID-19 or Flu Simulator with Scratch activity, students use Scratch to make their own COVID-19 simulation tool. Once programmed, they can explore the impact of social distancing and branch out to add additional factors to their program.
With the Design a Game to Help Alzheimer's Patients project, students use Scratch (or another programming environment or language) to design and build a game to help improve or practice memory skills for people with Alzheimer's or dementia. (Be inspired! See A Video Game Science Project to Help People with Alzheimer's.)
With the Save a Life! Teach Hands-Only™ CPR project, students use Scratch to design and program an interactive educational campaign. The example is to teach people about how to do Hands-Only™ CPR, but students could use this project to design an informational project to raise awareness about any topic of interest.
With the Do Antibiotics Change Your Gut Microbiome? project, students use Scratch to make and use a model to see how environmental and genetic changes are related to the development of cancer.
Educators! For lesson plans to explore artificial intelligence, machine learning, and neural networks, see:
- Butterfly Algorithms
- Happy or Sad? Exploring Bias in Machine Learning
- Computer Simulation of an Artificial Neural Network
Programming Projects — Intermediate to Advanced
The following projects help students continue to develop their programming skills and explore new elements of coding.
- 13. Hit Boxes: How Size Affects Score: the size and placement of hit boxes is important in game design and can be related to how easy or hard the game is to play.
- 14. Making It Real: Incorporating Physics in Video Games: students who are serious about the realism in their game play will want to pay special attention to the role of physics in their game design.
- 15. Crack the Code: Breaking a Caesar Cipher: learn what a Caesar cipher is and experiment using one by hand and then use code to see how quickly a computer can detect and crack this simple encoding strategy.
- 16. Building Personal Medicine Apps to Help Patients: use MIT's App Inventor coding environment to design and create a useful app with real-world value. The sample program is for a medicine reminder app, but students can take the general premise and develop their own meaningful app.
- 17. Password Security: How Easily Can Your Password Be Hacked?: use Python to write a program and see if you can use it to crack passwords of varying lengths and formats. Writing a program that can successfully guess our sample 6-character code is a challenge!
- 18. Preventing SQL Injection Attacks: learn how SQL injection is used to insert malicious code into text fields on a website and then use that information to find a way to fix SQL injection vulnerabilities in a sample website.
Programming with Arduino — Physical Computing
With Arduino, students can explore programming and connect their programming with an unlimited range of robotics, electronics, and other circuit-building projects. The Introduction to Arduino lesson is designed to introduce students to physical computing (programming a microcontroller to interact with circuits).
The lesson is broken into seven activities (with videos!) that walk students through the basics of setting up the Arduino and interacting with circuit parts like LEDs, buttons, and resistors. The lesson can be used as an introduction to Arduino programming in preparation for more advanced Arduino projects or as a refresher.
- For additional lesson plans that use Arduino see: Build an Arduino Self-Driving Car and Build an Arduino Mini-Drone
- Students can access more than 20 tutorial videos in the How to Use an Arduino guide.
- Get inspired! To get a sense of the kinds of projects students can do with Arduino, see the Arduino Science Projects resource collection.
- The BlueBot robotics engineering project series and the DIY Mini Drone series both have projects that involve Arduino. The collection highlights six projects that use Arduino to program BlueBot robots with specific behaviors.
Note: The Electronics Kit for Arduino contains the specialty parts to enable students to get started adding Arduino to their projects.
Artificial Intelligence and Machine Learning
Projects involving artificial intelligence (AI) and machine learning support students in exploring cutting-edge STEM that relates to many fields of science and engineering. With projects like the ones listed below, students can begin learning about various applications and algorithms for supervised and unsupervised machine learning, reinforcement learning, neural networks, and more.
- 20. Imagine Ways that Artificial Intelligence Could Change the World: In this activity, students imagine and explore the potential benefits and dangers of an artificial intelligence solution.
- 21. Think Like a Computer: Try Machine Learning: An introductory project to explore how a neural network can learn to make decisions. (No coding required.)
- 22. Explore Perceptrons: A Simple Type of Neural Network: Explore a perceptron and how it works to make yes/no decisions. Then train the perceptron to improve its decision-making abilities.
- 23. Identify Road Signs with Machine Learning: Train a machine learning model to identify various road signs in a variety of environments. (No programming is required).
- 24. Happy or Sad? Use Artificial Intelligence to Classify Faces: Explore AI by using a web-based machine learning tool to classify faces as happy or sad. How accurate is the AI? How does the performance change when the learning data is increased?
- 25. Can Machine Learning Solve a Maze?: Experiment with reinforcement learning and Q-learning to build an efficient AI maze-solving agent.
- 26. Can AI Predict Who Survived the Titanic's Sinking?: Experiment with a K-Nearest Neighbors (KNN) learning model to see if it can be trained to correctly predict whether a given passenger from the Titanic survived.
- 27. Build Personal Playlists with Machine Learning: Create an unsupervised K-Means learning model to build a personal playlist recommender.
- 28. Can AI Diagnose Breast Cancer?: Create a K-Nearest Neighbors (KNN) learning model that can predict whether a patient has a malignant or benign breast tumor.
Recognition for Student Coding Projects
Students entering coding projects in select science fairs may be recognized by Broadcom Coding with Commitment®, a program sponsored by Broadcom Foundation. To find out more about fairs at which Coding with Commitment awards are given, see the Science Fair Directory.
An Hour of Code
Computer Science Education Week is December 4-10, 2023. During #CSEdWeek, educators and families around the world encourage students to try coding, often with short, introductory "hour of code" activities that help students better understand what programming is all about. A simple activity or an hour of code might spark lasting interest!
- The Girl Factor: Creative Code and Computer Programming
- Best Practices Document Guides Out-of-School Programs Using Raspberry Pi Projects Kit
- Playful Programming and Cool Code: From Tech User to Tech Creator
- Spark Interest in Computer Science
- Computer Programming for Better Health
Collections like this help educators find themed activities in a specific subject area or discover activities and lessons that meet a curriculum need. We hope these collections make it convenient for teachers to browse related lessons and activities. For other collections, see the Teaching Science Units and Thematic Collections lists. We encourage you to browse the complete STEM Activities for Kids and Lesson Plans areas, too. Filters are available to help you narrow your search.
You Might Also Enjoy These Related Posts:
- Explore Artificial Intelligence and Machine Learning with Student AI Projects
- 12 Valentine's Day STEM Activities
- 12 STEM Activities for Lunar New Year - Year of the Dragon Science
- Winter Science Projects, Lessons, and STEM Activities
- Make Some New Year's Noise with Science Projects!
- Holiday STEM Projects to Make and Give
- 18 Next-Level Makerspace STEM Projects - Take your makerspace to the next level!
- Gingerbread STEM!