Grade 3 · Coding & Electronics · Lesson 58

Scratch Pet: Press a Key

Use an event to make an original pet change costume.

Time2 × 45 minutesTeamsPairs; switch maker and tester rolesEquipmentScratch on a keyboard-equipped computer

Project inspiration · 3 images

See, build, and test

Use these images to understand the kind of making, details, and testing involved. They are inspiration—not designs students must copy.

Generated project illustrations are shared by the two grade versions of this project. Follow your grade’s directions and starter recipe—not the pictured screen or hidden wiring.

Student directions · Grade 3

What will you make and do?

You will make a digital pet that changes face and greets a visitor when space is pressed. It returns to its resting face after the greeting.

Teacher overview: Students will plan the specific object described below, make and test a first version, then use their results to improve it. Read one step together, demonstrate the unfamiliar action, and let students complete that step before moving on.

  1. 1Plan your project

    Sketch a simple blue pet with a rest face and a happy face. Decide on one short greeting that a visitor can read.

  2. 2Make the first parts

    In Scratch, draw one sprite and duplicate its costume. Name the costumes Rest and Happy and change the second face.

  3. 3Put it together

    Use the exact starter recipe and coding guide to build separate green-flag reset and space-key greeting scripts on that sprite.

  4. 4Test it fairly

    Reset, then try three single space presses at least three seconds apart. Record whether the greeting appears and the pet returns to Rest; try a different key too.

  5. 5Improve one part

    Change one wrong block or unclear visual detail. Repeat the same tests, then save and reopen the project to check it again.

  6. 6Show and turn in

    Show the working pet and save the .sb3 file in the approved folder. Submit the two-face sketch and test sheet, and point to the event that starts the greeting.

How will you know it works?

  • The green flag reliably resets the pet to Rest.
  • A single space press produces Happy, a greeting, and a return to Rest.
  • The pair records three tests and can identify the event block.

Before you move on

Tell a partner what you are making. Point to the part you will work on next. Draw or dictate your test notes if writing slows you down.

Machine cutting, printer setup and electrical power-on require adult approval. A basic-materials model is a valid way to demonstrate the design when equipment is unavailable.

Keep your plan, test notes and before-and-after evidence with the printable design brief below. Use the detailed teacher plan and any coding guide for tool instructions. These steps continue across the lesson’s meetings, not all in one sitting.

Jump to step-by-step coding guide ↓

Beginner sequence · Step 2 of 3

Start here

Readiness check: Can the pair select a sprite, drag a block, and find the space key? Model these actions separately first.

Exact starter recipe

Create two costumes on ONE sprite. Name them Rest and Happy.
Script A:
when green flag clicked
switch costume to [Rest]
say []

Script B:
when [space] key pressed
switch costume to [Happy]
say [Hello!] for (2) seconds
switch costume to [Rest]
Test with single presses spaced at least three seconds apart.

Make the simplest version work first. Then use the test and extension in this lesson.

Teacher learning resources

Preview external resources before class. The circuit reference explains the science; use this page’s specified AA kit and connection list for the build.

Scratch · Grade 3 · Guided practice

How to code this project

What you will make: Build the two starter scripts below the lesson’s Start Here heading, one block at a time.

Core coding lesson. Use the exact Rest and Happy costume names from the starter recipe above.

Before you start

  • Open a blank teacher-approved Scratch project; select the pet sprite, not the Stage.
  • Make Rest and Happy as two costumes of ONE sprite.

Opening and saving: Open the teacher-approved Scratch editor and select your sprite. The recipe is a block-by-block guide, not text to paste into Scratch. Build blocks with matching names and keep indented lines inside their enclosing blocks. Save through File → Save to your computer as an .sb3 file; no public sharing is required.

Build it one step at a time

  1. Open Events (yellow). Drag when green flag clicked into the coding area.
  2. Open Looks (purple). Snap switch costume to Rest underneath, then say with its text left empty. This is the reset script.
  3. Drag a separate when space key pressed Events hat into an empty area. Do not attach it to the first script.
  4. Under this hat add switch costume to Happy, say Hello! for 2 seconds, and switch costume to Rest, in that order.
  5. Click the green flag, click the stage, and press space once. Wait at least three seconds before pressing again.
  6. Save a project file to the approved school folder. Reopen it and test one more greeting.

Your block recipe

Use the two complete scripts in “Exact starter recipe” above.
Yellow Events = what starts it.
Purple Looks = what the pet shows.
Read the blocks from top to bottom.

Predict, test and record

Write your name and date on the printed page. Run every test, note the actual result, and retest after one change.

Try this inputExpected resultActual result / retest
Green flagRest, no speech bubble________________
One space pressHappy + Hello! for 2 seconds, then Rest________________
A different keyNo greeting________________

If it does not work

  • Space types into a block? Click the stage first to leave the text field.
  • Wrong costume? Check both costumes belong to the same selected sprite.

Make one change

Change Hello! to your own short greeting; test and save again.

We changed __________. We predicted __________. Our test showed __________.

Teacher pacing: Use a 45-minute coding session: 5 minutes to predict, 10 to model a first working response, 20 for paired building, 7 for tests and 3 to save and explain. Continue in another meeting if setup or debugging takes longer; do not rush hardware checks.

Grade 3 support: Model one block at a time; partners alternate choosing blocks and explaining the result. Accept spoken or drawn test evidence.

Teacher learning resources

Preview resources before class. Follow this page’s specified reference build; another tutorial may use different hardware.

Print support: The lesson’s Print button includes this guide, recipe and test table.

For teachers

Engineering standards

This shows how the lesson connects to the national NGSS engineering standards and what student work you can collect.

Practiced

3-5-ETS1-1

Define the user's need for scratch pet: press a key and agree on the listed success criteria and limits.

What students show: A stated user need and checked criteria; this is engineering-design practice, not a separate coding standard.
Practiced

3-5-ETS1-2

Compare two possible routes, pet behaviors, or switch arrangements before selecting one for the user.

What students show: Two small plans and a reason for the selected design.
Assessed

3-5-ETS1-3

Repeat the stated test under the same conditions, identify a failure, change one feature, and retest.

What students show: Before-and-after test entries and an explanation connecting the change to the result.

Materials

  • Teacher-managed computer with physical keyboard and Scratch editor
  • Paper for two pet-costume sketches
  • Approved folder for saving .sb3 project files
  • Printable design brief

Teacher preparation

  1. Check readiness: Can the pair select a sprite, drag a block, and find the space key? Model these actions separately first.
  2. Open a blank Scratch project in the approved editor and demonstrate saving to the school folder.
  3. Prepare two simple original costumes; do not require detailed art. Preview only selected educator resources.
  4. Prepare the printable design brief at the end of this page. Use the project picture as inspiration, not a technical diagram or a required artistic finish.

Step by step

How to teach it

Class 1 · 0–5

Meet the beginner challenge

  1. Make a simple blue digital pet that greets a visitor when the space key is pressed and returns to its resting costume.
  2. Read the criteria together. Ask students to predict what the system should do.
Class 1 · 5–12

Model one working action

  1. Draw one simple blue pet sprite. Duplicate its costume; make one rest face and one happy face. Name the costumes Rest and Happy.
  2. Build Script A from the recipe so the green flag resets the pet.
  3. Use the exact starter recipe below. Ask a student to explain the action before demonstrating a second step.
Class 1 · 12–20

Compare two small plans

  1. Sketch or arrange two possible solutions using the same materials.
  2. Compare each plan against the criteria; choose one and state a reason.
Class 1 · 20–38

Build the smallest working version

  1. Build Script B under a when-space-key-pressed event. Keep both scripts on the pet sprite.
  2. Click the green flag, then press space once. Watch the costume and speech bubble.
  3. Wait at least three seconds before trying again. Check that the pet returns to Rest.
Class 1 · 38–45

Check and save

  1. Show one working action. Record where you stopped and what you need next.
  2. Save the project to the teacher-approved location using File → Save to your computer.
  3. Return materials and reset the workspace.
Class 2 · 0–8

Rebuild understanding

  1. Read the saved plan and predict the first test.
  2. Reset the starting state and test the simplest action.
Class 2 · 8–22

Test fairly

  1. Reset with the green flag. Predict the response to space before touching the keyboard.
  2. Run three single space presses, waiting for each greeting to finish. Record greeting and return-to-rest results.
  3. Try a different unassigned key once; it should not start the greeting.
Class 2 · 22–35

Improve one thing

  1. Identify the first point where the result differed from the prediction.
  2. Change one instruction, code block, or mechanical feature. Repeat exactly the same test.
  3. If the core skill is secure, offer the extension; otherwise use the support option.
Class 2 · 35–45

Share evidence and clean

  1. Let another pair try the project with your directions.
  2. Use the worksheet to show an original result, a change, and the new result.
  3. Save or label the work, then return materials.

Assessment

  • The green flag reliably resets the pet to Rest.
  • A single space press produces Happy, a greeting, and a return to Rest.
  • The pair records three tests and can identify the event block.
  • Student predicts an outcome before testing.
  • Test record distinguishes expected and actual results.
  • Student explains why the revision helps; neat decoration and speed are not assessment criteria.

Supports & extensions

  • Provide two named costumes and the green-flag reset. Students connect the three response blocks.
  • Offer larger cards or tools, a stabilized work surface, picture cues, partner assistance, and spoken or dictated evidence.
  • Extension after success: Add a second key with a different greeting; test keys one at a time after each script finishes.

Safety & responsible use

  • Use a teacher-managed Scratch session or approved offline editor; no account or public upload is required.
  • Use invented names and original pet artwork. Do not enter personal information, record classmates, or browse community content independently.
  • Keep sound quiet or omit it. Use short screen breaks and share keyboard control.

No-machine alternative

Make two paper costume cards. A partner acts as the computer, following the written event and response in order; record that this models code rather than runs it.

Printable student design brief

The challenge

Make a simple blue digital pet that greets a visitor when the space key is pressed and returns to its resting costume.

Success criteria

  • The green flag reliably resets the pet to Rest.
  • A single space press produces Happy, a greeting, and a return to Rest.
  • The pair records three tests and can identify the event block.

Constraints

  • One sprite, two costumes, and the listed beginner blocks first.
  • Use two 45-minute meetings; start with the working system before decoration.
  • Keep test conditions consistent and change only one feature at a time.

Engineer’s notes

Who will meet our pet? What should the greeting do?
Sketch two possible greetings or faces; circle your choice.
Our event is… The blocks run in this order…
Test 1 / 2 / 3: greeting appeared?… returned to rest?…
A different key did… because…
One block we changed… predicted result… actual result…

Printable beginner test record

Predict. Try. Improve.

Name ____________________ Partner ____________________

Our success rule: __________________________________________________

TrialInput / actionExpected resultFirst resultResult after one change
1
2
3
4
5
6
7
8
9
10

Use three rows for the introductory tests or all ten for switch reliability. Write the held, released, or other-key state for each sensing test.

One thing we changed: ______________________________________________

Things we kept the same: ____________________________________________

Our evidence shows: _________________________________________________