ALEX Lesson Plan

Obey The Law: Using Computer Coding to Create an Interactive Energy Pyramid

You may save this lesson plan to your hard drive as an html file by selecting "File", then "Save As" from your browser's pull down menu. The file name extension must be .html.

  This lesson provided by:  
Author:Katrina McGrady
System: Talladega County
School: Talladega County Board Of Education
The event this resource created for:ASTA
  General Lesson Information  
Lesson Plan ID: 34570


Obey The Law: Using Computer Coding to Create an Interactive Energy Pyramid


During this activity, the students will use drag and drop computer code to create an interactive ecological energy pyramid model that shows how the 10% law applies to the energy available at each trophic level.  As part of the hour of code, students can use this activity to participate in the Hour of Code week during their biology class.  

This lesson plan results from a collaboration between the Alabama State Department of Education and ASTA.

 Associated Standards and Objectives 
Content Standard(s):
SC2015 (2015)
Grade: 9-12
8 ) Develop and use models to describe the cycling of matter (e.g., carbon, nitrogen, water) and flow of energy (e.g., food chains, food webs, biomass pyramids, ten percent law) between abiotic and biotic factors in ecosystems.

Alabama Alternate Achievement Standards
AAS Standard:
SCI.AAS.B.HS.8- Identify living and nonliving components in an ecosystem; identify the flow of energy within a common food chain.

Digital Literacy and Computer Science
DLIT (2018)
Grade: 9-12
5) Design and iteratively develop computational artifacts for practical intent, personal expression, or to address a societal issue by using current events.

Digital Literacy and Computer Science
DLIT (2018)
Grade: 9-12
10) Resolve or debug errors encountered during testing using iterative design process.

Examples: Test for infinite loops, check for bad input, check edge-cases.

Digital Literacy and Computer Science
DLIT (2018)
Grade: 9-12
25) Utilize a variety of digital tools to create digital artifacts across content areas.

Local/National Standards:


Primary Learning Objective(s):

The students will describe how the ten percent law governs how energy flows from one trophic level to another in an ecosystem.  

Additional Learning Objective(s):

Learning Targets: 

Content:  I can describe how the 10 percent law governs how energy flows from one trophic level to another in an ecosystem.

Behavior:  I can construct an interactive ecological pyramid using a drag and drop computer coding program.  

 Preparation Information 

Total Duration:

61 to 90 Minutes

Materials and Resources:

Video or presentation that describes ecological energy pyramids and the ten percent law--BrainPop has an excellent video and Bozeman Science has a more advanced video here

Ecological Pyramid Rubric

Technology Resources Needed:

Each student or pair of students will need:

a computer with updated web browsing software

Each teacher will need:  

  • a computer with a projector,
  • Smart Board, or
  • other presentation materials.

Tynker Hour of Code Program--Choose the build an ecological pyramid option.  


The teacher will need to review the coding activity before it is assigned to help troubleshoot any incompatibilities and become familiar with the Tynker program.

Prior to this lesson, the students will need to know the following.

1.  Definitions and examples of autotrophs/producers, primary consumers, secondary consumers, top predators/tertiary consumers.

2.  The direction of energy flow in an ecosystem using food chains and food webs.

During this lesson, students should follow these safety procedures.  

1.  Do not use any websites other than those approved by your instructor. 

2.  Do not get food, drink, or water near your computer or electrical devices.  



As a starter question to activate prior knowledge, have students place their hand in a plastic grocery bag.  The students should pull the bag so that it is fitting tightly on their hand.  

After 3 to 5 minutes, have the students unwrap their hand.  What has happened?  After taking some student answers, the teacher should ask WHY the hand was sweating.   Use questioning to lead students to the conclusion that the loss of heat from the body led the hand to "sweat" when placed in the bag.  The teacher should ask, "Where does this "heat" come from?"  

Explain that energy flow in an ecosystem isn't as efficient as we might think.  

Show the students a video (i.e. Energy Flow in Ecosystems by Bozeman Science) or formal presentation on energy flow in an ecosystem and the ten percent law. Have the students take jot notes. Pause the video to discuss key points.  

After the video, use the ELMO/projector combo or an application like Doceri for iPad to give students explicit instruction on how to determine the energy available to each trophic level in an energy pyramid.  Show them how to move their decimal point.  Also, show them how they can multiply to get the same answer.  After working one or two in groups, give students a couple of problems to work on their own.  (30 minutes)


Explain to the students that they will be using drag and drop computer coding to create an ecological pyramid that explains the flow of energy in an ecosystem (producer to primary consumer to secondary consumer, etc.) and demonstrates the amount of energy available to each trophic level by describing the 10 percent law on their ecological pyramid.  

Go over the Ecological Pyramid Rubric with the class.  Ask for questions. Then, have the students complete the introductory activity on Tynker.  It will use "outer space" to show students the basics of drag and drop coding using the Tynker program.  Check for understanding by visually monitoring students and asking each student a question about the introduction.  Then, have each student create their interactive ecological pyramid using drag and drop coding.  


Have each student let another student work their interactive ecological pyramid to "test" it. (You may want to take this opportunity to discuss the career option of software testing.) Discuss how the student can improve their pyramid to make it better and easier to complete.  Then, have the student make any necessary changes to their pyramid and submit it for approval.  

Upon completion of the pyramids, ask the students to explain how the ten percent law governs how energy flows from one trophic level to another in an ecosystem. 


Assessment Strategies


Student answers during the video and 10 percent law calculation.

Student Peer Review during software testing.

Students can describe how the ten percent law governs how energy flows from one trophic level to another in an ecosystem. 


Interactive Ecological Pyramid graded with rubric 


Students who finish their pyramid correctly and early can take the opportunity to complete another Hour of Code activity.  


During the creation of the interactive energy pyramid, if students appear to be struggling with the content that goes in the pyramid, the teacher can pull the students in groups of 2 or 3 for small group instruction.  Use flash cards, matching games, drawing activities, and other methods to teach the material in small groups.  

View the Special Education resources for instructional guidance in providing modifications and adaptations for students with significant cognitive disabilities who qualify for the Alabama Alternate Assessment.