Skip to main content

Candy Dispenser | Lesson Plan

Page 1


Candy Dispenser Design Challenge

Lesson Plan

Title: Candy Dispenser Design Challenge

Date: Fall 2025

Author's Name: Dan Thomas and Dr. David Burghardt

Grade Level: 7/8

Content or Subject Area's: Informed engineering design with computer science and computer control

Duration: 8 days (40-minute periods)

General Objectives:

Students will design, construct, and program a hands-free candy dispenser that uses a distance sensor to trigger a servo motor mechanism to dispense a controlled serving of candy (8-12 pieces), applying the informed engineering design process while integrating computer science concepts including sensor programming, conditional logic, and iterative code refinement.

Learning Outcomes:

After completion of the lessons, students will be able to:

1. Use the informed engineering design process

2. Program servo motors and distance sensors using Birdbrain Snap to create an automated dispensing system

3. Design and construct a prototype that integrates hardware (servo motor, distance sensor) with software control

4. Apply iterative testing and refinement to optimize their design based on performance data

(NY Computer Science & Digital Fluency Standards) End of Grade 8:

• 7-8.CT.4: Write a program using functions or procedures whose names or other documentation convey their purpose within the larger task.

• 7-8.CT.8: Develop or remix a program that effectively combines one or more control structures for creative expression or to solve a problem.

• 7-8.CT.10: Document the iterative design process of developing a computational artifact that incorporates user feedback and preferences.

• 7-8.NSD.2: Design a project that combines hardware and software components.

(ITEEA STEL Standards) End of the 8th Grade:

• STEL Standard 1 (Nature and Characteristics of Technology and Engineering): Develop innovative products and systems that solve problems and extend capabilities based on individual or collective needs and wants.

• STEL Standard 2 (Core Concepts of Technology and Engineering): Differentiate between inputs, processes, outputs, and feedback in technological systems.

• STEL Standard 7 (Design in Technology and Engineering Education): Apply a design process to solve problems in and beyond the laboratory-classroom.

• STEL Standard 8 (Applying, Maintaining, and Assessing Technological Products and Systems): Use technology and engineering tools, techniques, and materials safely and appropriately.

Materials and Resources:

Provide a list of materials and resources needed to teach the lesson:

Physical Materials:

• Hummingbird Robotics Kit (includes microcontroller, servo motors, distance sensors)

• Cardboard sheets

• Shoe boxes or cereal boxes (optional)

• Hot glue guns and glue sticks

• Tape (masking and packing)

• Scissors and box cutters

• Rulers and pencils

• Brass fasteners

• Miscellaneous office supplies (paper clips, rubber bands)

• Small candy pieces (M&Ms, Skittles, or similar) for testing

Resources:

• Computers with Birdbrain Snap software installed

• Position Servo Tutorial:

https://learn.birdbraintechnologies.com/hummingbirdbit/snap/program/9-1

• Distance Sensor Tutorial: https://learn.birdbraintechnologies.com/hummingbirdbit/snap/program/15-1

• Rotation Servo Tutorial: https://learn.birdbraintechnologies.com/hummingbirdbit/snap/program/10-1

• Student engineering journals/notebooks

• Assessment rubric handout

Focusing Event:

Students observe a traditional gumball machine or candy vending machine (or video/images of one). Discussion: "How do you think the machine knows when to release candy? What mechanisms inside might control how much candy comes out? What problems might a dispenser encounter, such as jamming or releasing too much candy?" Students examine an exploded view diagram of a coin mechanism for a candy machine. This introduces the real-world engineering problem of designing an automated dispensing system that is reliable, controls portion size, and operates hands-free using sensor technology.

Day-by-Day Plan:

Day 1: Specifications and Constraints (40 minutes)

Informed Design Phase: Specifications and Constraints

• Teacher presents the Candy Dispenser Design Challenge: Design and build a hands-free candy dispenser that dispenses 8-12 pieces of candy when triggered by a distance sensor

• Conduct focusing event discussion about how candy machines work

• Review specifications: Dispense a serving of candy (8-12 pieces); Trigger by a distance sensor (hands-free operation)

• Review constraints: Use only provided materials; Limited class time; Must be safe and sturdy

• Introduce the assessment rubric and informed engineering design process

• Students document initial understanding of the challenge in their engineering journals

Day 2: Knowledge Building - Understanding Dispensing Mechanisms (40 minutes)

Informed Design Phase: Developing Knowledge

• Students complete KSB 1: What makes a Candy Machine Work?

• Teams analyze how candy machines release candy, examining mechanisms like trap doors, flaps, and wheels

• Students write engineering explanations of how they think a candy dispenser works, including: description of the release mechanism, explanation of portion control, discussion of potential problems (jams, too much/too little candy)

• Create labeled sketches of possible internal dispensing mechanisms

• Document findings in engineering journals

Day 3: Knowledge Building - Servo Motor Programming (40 minutes)

Informed Design Phase: Developing Knowledge

• Students complete KSB 2: How Does the Positional Servo Work?

• Watch tutorial video on position servo motors

• Connect servo motor to Hummingbird Kit and use Birdbrain Snap to program movement to different angles

• Experiment with rotation servo timing and percentages to control how the servo turns

• Students document their code with screenshots in their engineering journals

• Keep servo setup intact for use in KSB 3

Day 4: Knowledge Building - Distance Sensor Integration (40 minutes)

Informed Design Phase: Developing Knowledge

• Students complete KSB 3: Programming the Distance Sensor

• Watch tutorial video on distance sensors

• Write code using Birdbrain Snap so that when the sensor detects an object within a set range (like a hand), it triggers the servo motor

• Experiment with different distance values until sensor responds only when desired

• Test the integrated sensor-servo system multiple times to verify reliable operation

• Document code and findings in engineering journals

Day 5: Ideate Solutions and Choose Optimal Design (40 minutes)

Informed Design Phase: Ideate Solutions

• Students complete the Alternative Candy Dispenser Designs activity

• Each team member sketches 3 or more different design concepts, labeling: approximate size, candy storage area, release mechanism, trigger mechanism, servo mounts, candy delivery area

• Teams review designs together and create pros/cons analysis using decision criteria: Function, Hands-Free Operation, Stability & Safety, Creativity, Use of Materials

• As a group, select the optimal design and write justification (3-4 sentences) for the choice

• Document design decision process in engineering journals

Day 6: Build Prototype (40 minutes)

Informed Design Phase: Build Prototype

• Students begin building their optimal candy dispenser design

• Start with the structure: Build the storage area for the candy, ensuring it is strong enough to hold the weight

• Add the release mechanism: Build the flap, wheel, or trapdoor that will control candy release

• Mount the servo and sensor: Secure servo motor to move the release mechanism; Place sensor where it can detect a hand

• Reinforce and refine: Use tape, glue, and fasteners to keep everything stable

• Connect electronics and begin preliminary testing

• Photograph progress and document in engineering journals

Day 7: Test, Evaluate, and Refine Design (40 minutes)

Informed Design Phase: Test and Evaluate Design + Refine Design

• Students complete testing protocol: Run dispenser at least 5 times

• Record data: Number of candies dispensed each trial; Note any problems (jams, delays, too much or too little candy)

• Look for patterns: Is dispensing consistent or random?

• Evaluate against specifications: Does dispenser meet the 8-12 candy requirement?

• Based on test results, identify improvements needed and implement refinements to structure, servo angles, sensor placement, or code

• Retest the improved version at least twice to verify improvements

• Document test data, analysis, and refinements in engineering journals

Day 8: Reflection and Self-Evaluation (40 minutes)

Informed Design Phase: Reflection

• Students complete the assessment rubric self-evaluation from Day 1 and justify their self-assessment with specific evidence from their project work

• Students reflect on the informed engineering design process and lessons learned by answering reflection questions in their engineering journals: What part of this

project was most successful? What was the biggest challenge your team faced? How did your team solve problems together? What new skills did you learn (design, coding, building, teamwork)? If you had more time, what would you improve or add?

Hofstra University - Center for STEM Research

Computer Science Through Engineering Design

NSF Grant Number: 2341962

Turn static files into dynamic content formats.

Create a flipbook