# Unit Rates and Scratch

I’m back to teaching pre-algebra after a long time off – and the more things change, the more they stay the same! A key staple of middle school math is learning about rates – how they work, how to calculate unit rates, how to predict with rates, and different representations of rates – including tables, graphs, equations, and story problems. I love to make the connection between the story problem and the equation by doing a coding activity. For our final project on unit rates, I assigned the students a pair programming project in Scratch. The structure of the activity is really similar to what I’ve done in my 6th grade computer science classes.

- The background knowledge. We have a discussion about a specific situation involving rates – I chose “toilet paper math”, because what is a more confounding consumer decision than buying toilet paper? I picked a couple of examples of toilet paper packages from the weekly grocery ad and put them into a Google Doc for the kids here. https://docs.google.com/document/d/1zM4wwf2GDSEEaB31IWDeJPTqibtPsG1zLN_XA_k35uM/edit We had a class discussion about what clues on the package might help me figure out what toilet paper to buy. One class mentioned that I could figure out the number of squares / sheets of toilet paper in each package, and another class wanted to go by the number of square feet in the package. Together, we wrote a Scratch program that would help me figure out what toilet paper to buy. For the class example, I showed them how to use the “ask” block to get input, the “set” block to set variables to values, and operators to do math. We created variables for the price of the toilet paper, the number of square feet in the package, and the number of square feet you can get for a dollar. The main character would then report out the square feet per dollar unit rate to help us figure out our purchasing decision. Our class program is here: https://scratch.mit.edu/projects/291422012/editor
- The norms before the worktime launch. I explained to the students that when I was an engineer, we often used a protocol called “Pair Programming” to solve problems. As an adult, this meant I prairie-dogged my head up above the cubicle walls and shouted to my friend Jerry: “Jerry! Can you help me solve a coding problem? I can’t figure it out.” Then I would type at the computer while Jerry stood behind me and read over my shoulder, and we talked together about what the code did – line by line. It was really helpful to have a partner talk it over with me. I explained that in middle school, we can also use Pair Programming and some of the norms are pretty much the same. Then I showed the Code.org pair programming video on YouTube.

https://www.youtube.com/watch?v=vgkahOzFH2Q After the video, we went over the do’s and don’t’s. - I gave the students a choice of word problems having to do with Unit Rates, and their task was to solve one of them with a partner using the Pair Programming protocol. The choices are in this document: https://docs.google.com/document/d/1h8r2z0o2FtOr8N4IjqGaiNrhn_DGAJLIyNREeg9iR0g/edit I change up the celebrities in the document every so often. Students love Marshmello and also Ariana Grande this year and I got some cute programs with these characters.I swear the Pair Programming video is magic. Students for the most part peacefully navigate partner work after watching and processing the video. I only had a couple of groups that had any trouble at all. This activity took a whole class period for most classes, and a little longer for one group. All of the students were engaged and trying hard, and most groups enjoyed the creative storytelling part of the project. I wish I had introduced Scratch sooner in this year’s math cohort, but we had a lot of manual math to do and so we’re just now starting to automate things. Now that the kids are on board with it, I can’t wait for the next project.Here are a few example programs the students made for the word problems.

Marshmello’s road trip: https://scratch.mit.edu/projects/293136380/editor/

Hagrid’s Animals (these students modified the prompt a little bit, but I really enjoyed how theirs turned out and they had fun with the creative storytelling): https://scratch.mit.edu/projects/292456078/editor/

Ariana’s Carpet (this group of kids decided to include their favorite K-Pop star and I’m embarrassed to say I don’t know who this guy is): https://scratch.mit.edu/projects/293139904/editor/I really believe in computer programming as a modeling tool for math expressions. Students love the instant feedback and the creative storytelling, and I love that they can test many inputs and it is a check on their number sense. Often I see students modify their model when they try plugging in a few numbers and then they say “Wait a minute! That gas mileage doesn’t make sense!”

Other programming languages work just as well. I’ve had older middle schoolers do a similar task in Processing and it really stretches their brains!

# Pre-calc, Trig, Physics, and Planetary Motion – a coding project

I mentioned earlier that I get the privilege of teaching pre-calc for the first time this year. As a capstone project for our unit on trig, I created a project on planetary motion. It had been on my radar since we studied conic sections and learned about how planetary motion is a real-world example of an ellipse. I browsed around for some examples of planetary motion simulators, and found this one written in Python.

https://fiftyexamples.readthedocs.io/en/latest/gravity.html

The link above uses real-world values for masses of planets and the value of big G, but I thought the students would enjoy “playing God” and creating their own planets and velocities and creating the big G constant for their little universe. In the process we would learn about the physics of planetary motion and about how trigonometric functions can be used to model periodic motion in a coordinate plane. Yay math!

My pre-calc students have not yet had high school physics, so I had the opportunity to set the groundwork for some basic mechanics. I know I gained a lot by watching these little videos from Crash Course and PBS. I had the students watch them both, and we processed them afterward.

After this first video, the main mind-blowing concepts were: a) centrifugal force is kind of a “fake force”, it’s just the balancing force to centripetal force that pulls you inward, b) in a circular path, your velocity is tangent to the circle, and c) students knew that force could be described by the equation: F=ma, but after the video we talked about a special version of the formula that describes circular motion, F=mv²/r.

Together we wrote, earlier in the unit, a basic computer program on Khan Academy that made a little planet orbit around a bigger sun using trig functions to find the x and y coordinates. Fun but not an accurate planetary model. I’m not sure if the computer program playback will work here, but here’s the basic model.

## animate

Made using: Khan Academy Computer Science

Since we had briefly learned about Kepler’s laws during our unit on ellipses, I told the kids I wanted the model to change so it actually modeled planetary motion – faster when close to the planet, slower when farther away, making an ellipse with the “sun” at one focus. And to do that, we’d have to learn a little about how planets exert force on each other and how that impacts their motion. So we watched the next video.

So from this video, we learned many more mind-blowing things. Among them, there is ANOTHER formula for force: F=GMm/r². These formulas are all related to each other. We would now modify our computer simulation to show how they all work.

Ok so here are the basics of programming an animation. This structure is common to pretty much all game programming as well. You have setup code and then an animation loop, that runs over and over again. Most of the time, the animation loop runs around 60x per second.

In the setup code, we initialize all of our variables. In the animation loop, we’ll calculate all of the forces and accelerations and velocities and positions, and once everything is updated, we’ll re-draw the scene. You always re-draw the whole scene from the objects in the “back” (such as the background) to the objects in the “front” (such as the moving planets). For simplicity, my model doesn’t take into account the planet’s effect on the sun… just the sun’s effect on the planet.

Step 1: In the animation loop, draw the background and the sun. In the Khan Academy programming environment, (200,200) is the center of the canvas since the canvas is a 400×400 grid. This code places a circle, 40 pixels in diameter, right at the center. The fill() and background() commands are used for colors.

var draw = function() {

background(0,0,0); fill(164, 244, 245); ellipse(200,200,40,40); };

Step 2: In the setup code, create variables for the sun’s mass and the planet’s mass. I just told the kids to make up numbers, one a LOT bigger than the other, like 100 times bigger or more. I just made these up on the fly. The units are totally fake. Just have fun making up weird numbers.

var smass = 34782; var pmass = 7.2;

Step 3: We need to place a planet. We’ll create variables for the planet’s x and y positions and draw a smaller circle at that position. I recommended to the students that they place the planet so that it is directly above, below, or to the left or right of the sun. In other words, the x or y coordinate is the same as the sun’s, but the other coordinate is different. My planet starts out 170 pixels ABOVE the sun (because the y axis is upside down).

Setup code:

var px = 200; var py = 30;

Animation loop (at the end of the var draw function, before the last curly brace)

fill(153, 242, 126); ellipse(px, py, 10, 10);

Step 4: You’ll need to calculate how far away you are from the sun at any time in order to correctly calculate the force. So make a variable to store this distance, and then re-calculate the distance every frame. Normally you would use the distance formula, sqrt((x2 – x1)² + (y2 – y1)²) however Khan’s math library has a function called “dist” that simply takes the parameters x1, y1, x2, y2 and returns the distance between them.

Setup code:

`var pdist;`

Animation loop (before you draw the planet. I added a comment above this to show where we are doing all of the math)

```
//MATH
pdist = dist(px, py, 200, 200);
```

Step 5: Now we have *almost* all of the information needed to calculate the force on our planet. We know the masses of the two planets and we know how far away they are at any time. We do NOT know big G, our gravitational constant. For now we’re going to make up a number. It’ll be wildly wrong. We will fix it in a bit. We’ll calculate force using our wrong constant for now. The students enjoyed thinking about how when you create your own universe you get to decide things like how big the universal gravitational constant is.

Setup code:

```
var G = 10; // just make something up
var pforce;
```

Animation loop (after you calculate distance but before you draw the planet)

```
pforce = G * smass * pmass / (pdist * pdist);
```

Step 6: Now we need to explore the relationship between position, velocity, acceleration, and time. We already have variables for the planet’s x and y position. We will need to break velocity and acceleration down the same way. Velocity is how much the planet’s position changes with each time interval. Acceleration is how much the *velocity* changes with each time interval. If our object starts at the top of the circular path, it begins with a fairly large x-velocity and a zero y-velocity. As it moves around the circle clockwise, the x-velocity and y-velocity change so that by the time it gets around 90 degrees, the x-velocity has slowed to zero and the y-velocity is at a maximum. And the cycle repeats around the circle. A periodic function!

So after position is established we will give our planet a starting velocity. Since my planet started at the “top” of its circular path, I will give it an x-velocity but no y-velocity. A student that put their planet to the side would give their planet a y-velocity but no x-velocity. When you run this code now, you will see the planet move in a straight line tangent to its circular path. It follows Newton’s first law – no force, no change in velocity. Bye!

Setup code:

var vx = 4; var vy = 0;

Animation loop (put this code right before you draw the planet):

px = px + vx; py = py + vy;

Step 7: We need to calculate the acceleration in the x- and y- direction every frame. This is where the trig comes in. This step really consists of three substeps. First, we need to find the angle of rotation between the planet and sun. Second, we find the x- and y- components of the acceleration. Third, we add the acceleration to the velocity (remember acceleration is the change in velocity every frame). For the first substep, we can calculate the angle of rotation easily – the planet’s position is a certain y-distance and a certain x-distance away from the planet, so if we use inverse-tangent, we can find the angle. Khan’s math library has a function “atan2” that calculates an angle given the y-distance and x-distance. Note the sun is at (200,200) so that’s why those numbers are hard-coded. Substep 1:

Startup code:

`var ptheta;`

In animation loop:

`ptheta = atan2(200-py, 200-px);`

Substep 2. Calculate acceleration components. Here we use our original force formula: F = ma. We calculated force, we know mass, so acceleration is easy – just Force / mass. Then we have to multiply that acceleration times sin(theta) for the y-component and times cos(theta) for the x-component. These use the definitions of sin and cos as you relate them to a unit circle. The code!

Setup code:

var ax; var ay;

Animation Loop (after you calculate ptheta):

ax = (pforce / pmass) * cos(ptheta); ay = (pforce / pmass) * sin(ptheta);

Substep 3. This part is easy. Add the acceleration to the velocity every frame. Do this before you re-calculate position in the animation loop.

vx = vx + ax; vy = vy + ay;

You’ll run your code. The planet will either fly off into the unknown or crash into the sun. I encouraged the kids to play with the value of G, but sometimes the animation runs so quickly that it’s hard to even tell if you should dial up G or dial it down. So we had to come up with a better way to find a universal gravitational constant that would make our little solar system dance instead of fall apart.

Here’s where our other formulas for Force come in. For uniform circular motion, the centripetal force that keeps a body in a stable circular path is: F=mv²/r. For planetary motion, the force affecting the planet and sun can be modeled as: F=GMm/r². We know all of the variables in both equations EXCEPT a value for G that makes the orbit stable. So set one equal to the other and solve for G. I used some contrived numbers in my model and all of my students had different contrived numbers. Mine were:

M = 34782

m = 7.2

r = 170 (since my planet started at y = 30 and my sun was at y=200 and the x-coordinates were the same)

v = 4 (I just made up a velocity of 4 pixels per frame)

When I solved for G, I got a value of 0.078. So I modified my program and plugged in this value for G and guess what happened? Uniform circular motion and the feeling that I AM GOD of my own little universe.

You can make tiny changes to the planet’s initial velocity, for example change it to 2 instead of 4, and see the planet travel in an elliptical comet-like path instead of a circular path.

Here is the entire working program.

## PLANETS

Made using: Khan Academy Computer Science

When I taught this lesson, we went through the steps as a class just as I went through them in this blog, discussing them along the way. For a final product, the students will write an essay (!) describing their understanding of the physics of planetary motion. I will also give them a brief quiz. I have not yet written a rubric but will share it when I do.

I really enjoyed working on this little coding project and was so pleased that I could connect periodic functions and the physics of motion. If you make any modifications or try this with your students, please let me know.

# Somewhat in support of old-fashioned math

While my pre-calc class has been digging hard into the world of technology and inquiry for their learning, I am feeling kind of guilty and kind of not-guilty for doing direct instruction and manual calculation in pre-algebra.

We’re working on a unit on decimal operations. Decimal operations are included in the 5th grade Common Core standards, but my assessments in our previous unit on positive/negative numbers told me most students aren’t 100% masterful with them yet.

I have only been a *tiny* bit constructivist with this unit. We did a brief activity using base-10 blocks to understand place value. I gave the students a pre-assessment on adding and subtracting with decimals, and based on the pre-assessment I could identify maybe 15 students over all three sections that needed some help with those operations. I gave most of the class some time on Khan Academy while I did small-group instruction with those kids. We just worked problems and focused on proper carrying/borrowing/place value. Every single kid was familiar with the basic idea, they just had some gaps when it came to the algorithm. The small-group work was just what they needed.

For decimal multiplication, I gave the students a worksheet I made up with some problems that had patterns in them.

I did not teach the students how to multiply numbers with decimals first… I just wanted to see if they could use the patterns in the worksheet to infer how big the numbers would be. We went over the answers together and then I asked the class if there’s a rule they started to pick up that told them where to put the decimal in the answer. Every class had multiple students that said something to the effect of: “however many decimals are in the problem, that’s how many are in the answer”. All we had to do was formalize that into a rule and then practice it.

As a unit project, I taught the students about how to write an invoice if they own a small business and need to charge their customers for items they buy. Without doing anything constructivist yet, I just taught the kids how to convert a percent into a decimal and then multiply to calculate discounts and tax. Creating an invoice involves decimal addition, subtraction, and multiplication, so it’s a great assessment to the unit.

For the students’ unit assessment, they will create their own virtual store that has multiple items I could buy, some made-up coupons involving percent discounts, and a made-up tax rate somewhere between 1% and 12%. I’ll shop at each student’s store and pick out some items and coupons, and they will have to make me an invoice by hand.

Now for the reflection on this unit so far: I have really mixed feelings about the unit’s topic, manual calculation of decimal operations. I am totally on board with the understanding that in a computer-driven world like ours, they can get by without knowing it. They can actually thrive without knowing how to do these calculations manually.

Why, then, does this feel so satisfying? Kids thanked me for teaching it to them. An intern volunteering in my classroom commented “this is really cool. I never actually learned how to do this. It’s great.” I’m reminded that I *can* plug a sudoku puzzle into a computer program and have it solved for me, but it’s satisfying to work through the sudoku puzzle myself and know I’m just as smart as a computer. Plugging numbers into a calculator is just as much of a rote task as large-number multiplication, but doing the math by hand, in the right mindset, gives you ownership of the puzzle.

Is that why manual math has value? Does it have value? I do not plan on emphasizing this kind of manual calculation once this unit ends – when we get into rates, ratios, equations, and expressions, we’ll use computerized tools as problem-solving aids most of the time to free up our working memory.

The other part of these lessons I’ve wrestled with is the direct instruction vs. constructivist. The lessons started out with a little pattern-finding and then I just taught the kids how to do the math. Over time, I have toned down the inquiry in some situations and I now believe it’s possible to overdo inquiry. Sometimes you are done trying to ferret out the method for yourself and you just want someone to show you how to do it. Some struggle is healthy but not unlimited struggle.

I would not have taught like this six years ago. If there’s a scale where 0 is pure direct instruction and 10 is pure constructivism, I would say this set of lessons is like a 2 or 3. What should be your criteria for determining when you do inquiry and when you do direct instruction? Lots of questions I don’t have easy answers to.

But this set of lessons, this unit, felt satisfying to teach and I expect good results from our little shopping assessments. I don’t have any regrets.

# Trig and MLK Week Continued

Just blogging to report on my two big initiatives for the week: finishing up a mini-project on trigonometry using the micro:bit accelerometers, and a week on anti-racism in my sixth-grade advisory.

The mini-project finished up SO well. We started last week by assembling micro:bit inclinometers and programming them to report out the angle measured by using trig ratios. This week, we took measurements with them and did the math. The students measured the height of a neighboring building by standing exactly 800 centimeters away and sighting the roofline with their micro:bit devices. It’s been a cold week so we rushed inside to do the math, and the kids calculated a building height of around 39 feet. We probably got in the ballpark.

One commenter on my blog suggested we try another method, sighting an object from a distance, then backing up a known distance and taking another reading. This ended up being a cool application of a system of equations. Great suggestion!

Even though learning to solve systems of equations feels like drudgery at first, it’s one of the more useful algebra concepts I have learned. In my decade as an engineer, I modeled many situations involving systems.

The kids did a great job and seemed to enjoy the challenge of the activity.

The other day, I blogged about the very strange situation involving the Catholic school teens in DC mocking other protesters near the Lincoln Memorial. With the MLK holiday coinciding with that weekend, I really felt the need to do a lesson series on racism in my advisory class. They are sixth-graders, and I decided to survey them first – I’m glad I did. Only one of the kids had even heard of the incident with the protestors, which I found fascinating. What we perceive as going viral doesn’t reach all age groups equally. I decided to leave the incident off the lesson plan and focus on basic, age-appropriate lessons on racism.

We started with a few circle prompts about times they have ever seen someone treated unfairly because of their race, skin color, or religion. I asked them about their perceptions of bullying at our small school. Almost all the students feel that at our school, bullying is not really so much the issue. Some students can be rude or insensitive, but they understood the difference between rudeness and bullying.

I talked about how it’s healthy that in our lifetime, it’s not socially acceptable to be outwardly racist. People in our community tend to call each other out on it. Racism tends to take the shape of the many small ways in which your life is made a little easier or a little harder because of your race. We read through the list created by Peggy McIntosh in the Invisible Knapsack. Some of the students were able to chime in with ways in which privilege tends to show up at school – for example, if a girl hears “you’re pretty smart! Girls can be smart can’t they?” or if you get in trouble with the principal and a little voice makes you wonder if it’s because of the way you look.

Today, we started watching “A Class Divided“, the story of Jane Elliott’s brown eyes / blue eyes discrimination experiment in her third-grade classroom. The kids find it fascinating. It’s a very good and comprehensive introduction to what discrimination is and what it does to people. As a sixth-grade lesson, I think it’s a solid foundation to build on. I’m interested to debrief with the kids tomorrow to get their thoughts on it. By the end of class today, they were begging me to try the experiment at my school – to bring collars and let them try it. I think they’re intrigued at the idea of lording it over their classmates, but also wondering if the collars would make them the same nasty people that the third-graders became when they were empowered over their lower-class friends.

Jane Elliott is a nationally-known advocate for racism education now, and I told the students I have seen her do this experiment on adults and it’s still just as powerful. She can make adults cry. (I won’t show that video to the kids because there is swearing… but man!)

At some point, one of my students raised his hand and said “Donald Trump is racist.” I sat in it for a moment and then said “Yes. He is.” Other kids wanted to chime in. I allowed a few comments. I ended with “He says racist things. It’s not OK.” And I moved on. I have heard arguments that Trump says the things he says to provoke crowds, or build his “message”. If you say racist things to provoke or build your message… you are a racist. I would never allow one of my students to say the things the president says. That behavior needs to be named.

It’s not a ton of lessons, but the students have been engaged and receptive, and I think it got us off to a good start when it comes to understanding these themes.

# Trig and Physics and micro:bits

This year I am teaching pre-calculus for the first time, and I am committed to doing projects with my students as much as possible. Last semester we created a parabolic trough solar oven and made holiday cookies for students. This semester I decided to start with a unit on trigonometry, and I happened upon an interesting project via Twitter that showed someone sighting a distant object and using a micro:bit’s accelerometer to calculate tilt and thus how tall the object was. What a cool application of computing and trig. I decided to try and create the project for my class.

I decided to spend some time actually creating the thing. I started by attaching the micro:bit to a cardstock tube. The tube could be used to sight the top of a tree or building. We would try to keep the micro:bit on the same side and simply adjust the tilt until an object was sighted through the tube.

I played with different programming languages and decided to use Python, because it had a robust library of math functions. I started with a simple program to just fetch the accelerometer readings when you push a button.

I found that if the tube is held level, the “x” reading was close to 0, the “y” reading was close to a maximum of 1024, and the “z” was close to 0. If I held the tube pointing straight up (90 degrees), “x” was -1024 and “y” was close to 0. “z” remained close to 0. So as you tilt the micro:bit, the “x” accelerometer goes from 0 to -1024 while the “y” accelerometer mirrors it and goes from 1024 to 0.

I did a little searching to figure out how to convert accelerometer readings into an angle of inclination. There are a lot of different formulas out there – probably all correct. One source I found had a very simple equation:

So basically the angle of inclination is the inverse sine of the ratio of the “x” accelerometer to 1g. I had a hard time visualizing why the ratio x/1g would be equivalent to an opposite / hypotenuse, but it started to make sense when I realized the forces at work are really similar to the kinds of forces on an object that slides down an inclined plane.

In the diagram, the parallel force is analogous to the reading on the “x” accelerometer. The perpendicular force or “normal” force is analogous to the reading on the “y” accelerometer. Fgrav is basically 1024, the reading you get when there is a full 1g on an accelerometer.

This triangle is similar to the triangle made by the inclined plane. I made a little sketch that maybe shows this more clearly?

So basically the formula above, the simple inverse-sine operation, works because your angle of inclination is congruent to the angle opposite the “x” acceleration vector. You can find that angle by finding inverse-sine of “x” to “force of gravity”, 1024.

I wrote another Python program that did this math and reported out the angle, and it seems to be reasonably accurate.

Once you know the angle, if you know how far away you are from your object, its height can be found this way.

tan(theta) = height / distance

distance * tan(theta) = height

Easy peasy! This assumes you’re sighting from the ground. We may find we have to adjust for eye height. We can do that. Time to create the student-facing activity.

I put together this packet for the students. My class is super tiny so the kids can go through it as one group. For a larger class I would make groups and do lots of catch and release.

Here’s how it went.

______________________________

We watched the video on the biltmore stick. Students gave me hypotheses around why it worked, and we talked about potential sources of error.

I told the students that with modern technology, we should be able to make a decent height-finding tool. I introduced the micro:bits to them and told them about some of the features. They’re the first kids in my school to use the micro:bits, and they were ENCHANTED by them. You turn them on and they show messages and images, they play a game, and then they tell you to get coding. How fun! The students had a zillion questions about what else the micro:bits can do and how they worked. After the excitement faded just a little, we talked about accelerometers and how they worked, and the students started working through the packet.

I hoped they would be able to struggle through most of it up until they had to write their procedure in Python, but of course that isn’t how it went. We ran up against several big conceptual roadblocks.

- The idea of the x, y, and z-axis accelerometers BLEW THEIR MINDS. It was really tough to visualize which axis was which, and the students twisted and turned the micro:bits every which way. They had a very tough time being systematic about turning the micro:bit on just one axis to narrow down which accelerometers were changing. I hoped they would be able to sort out which axis was which on their own. They could not, and they got frustrated really quickly. I broke down. I just told them which axis was which and what the max and min values were. I have to admit this has been a struggle for me as well. Visualizing the three accelerometers is a challenge and I probably would have felt the same way in this activity.
- The accelerometers are really sensitive. One moment you set the micro:bit level and get a reading of 0. Another moment the micro:bit seems to be in the same position but your reading is -92. Another moment it’s 16. The text scrolls slowly so you don’t really appreciate what those readings look like in the moment. It was hard, then, to ferret out what the max and min values were. They floated around.
- I really thought with their geometry background the students would visualize the similar triangles really quickly. They did not. Looking back, I remember feeling frustrated and like my mind was a little blown when I learned about forces on an inclined plane. So I should have been ready for this. But the whole idea that a force of 1g directed toward the ground could be broken up into the x and y components on the accelerometers, and that they didn’t add up but rather made legs of a right triangle… WHOA. There was yelling. There was almost crying. Emotions were high. Eventually they did seem to understand but I am going to have to do some good formative assessment next class to see what they actually got.

I have a TINY class, only 5 students, and so the yelling and the emotion was totally manageable, but I am SO glad I did not go through this with a bigger class. I would have done a lot more pre-work on gravity, inclined plane forces, and similar triangles.

Today, after all of our drama, the students wrote programs to calculate the angle of inclination and strapped the micro:bits to paper tubes. Next class, we’ll go outside and take measurements. One of my students found an alternate method of measuring the angle that was something similar to this.

It seems to use a distance-formula calculation instead of the force of gravity and it’s interesting how it uses all three axes. I’ll let her try it and see if her results are similar.

I’ll take some pictures of the results of the experiment and hope I get to do this again with a future group! I feel like with better pedagogy this would be a really great activity!

# Micro:Bit Curriculum

This spring, I tried something I’ve never done before – I tried my hand at curriculum writing! I had a great opportunity to work with Launch CS to create a 10-lesson curriculum for the BBC micro:bit. It’s not perfect, no product ever is, but I did end up happy with what came out of the effort. The package is aligned to CSTA standards and covers a variety of them in ways that are not typical of most coding curricula. There are a ton of lesson packages out there that introduce algorithms and programming, and I did include these but also worked to introduce networking, data, and the design cycle. The curriculum is intended for students in grades 5-8.

The highlights are:

- Events, Variables, Conditionals, and Looping (via mini-projects and pair programming using the micro:bit)
- Data modeling and analysis using micro:bit, electronics, and spreadsheets
- Networking using videos, a computer and the micro:bit radio feature
- Design Cycle via a micro:bit “Shark Tank” style project

The curriculum can be downloaded for free here, or on the micro:bit teaching resources page. I’m excited to see people using it and hope you find it useful and fun for your students!

I would have loved to see teachers at the CSTA conference, but alas, duties for my new job interfered this year. It’s on my bucket list to attend – hopefully next year.

Until then let me know if the micro:bit resources are helpful!

Edited later because I neglected to give credit where credit is due. Grant Smith and Cheri Bortleson are amazing to work with – they gave thoughtful feedback and edits, and they formatted the curriculum beautifully with lovely graphics and a consistent theme. I can share this proudly because they did such a nice job with the vision and final project! Thank you Grant, Cheri and LaunchCS!

# The Computer Take-Apart (revisited).

A few years ago, I wrote this post about my struggles to have middle-schoolers do a computer take-apart and meet the high expectations I had in mind for them. I am happy to report I didn’t quit doing computer take-aparts. I did try to learn from those hard lessons and continue improving on it. Hardware Week now runs pretty smoothly and kids report it’s their favorite unit. I do this set of lessons in my 7th/8th grade Computer Science Explorations class. It’s a great one for the week right before spring break, or whenever you need a little something different to mix things up.

Prior to the lesson, I ask parents if they have any old computers they have been wanting to get rid of but didn’t want to hassle with recycling them. I have a small budget I can use for hardware recycling, so I have workplace services come and take the computers away for recycling when the take-apart is done. I accept laptops as well as desktops, and it’s fun when I have a mix of both. I stock up on tools, especially small phillips screwdrivers, flathead screwdrivers, a few small Torx screwdrivers, some pliers and a few wire cutters.

First, we learn about the basic structure of computers (I also relate this structure to micro:bits, since my CS students learn to program them in Python). We do several card sorts in which I give students a sheet with pictures and descriptions of computer hardware, and they have to sort them into categories: input, output, processing, storage. Sometimes I include Power in one of the categories. Although pieces of hardware like the battery and fan don’t have anything to do with the flow of information, they are visible inside a computer and really important to its operation. You can find the card sort at the link below!

Lesson1Activity1wIllustrations

Next, I have the students watch a movie and fill out an organizer with it. The movie is wonderful – it’s called Lifting the Lid and although it’s from the early 2000’s, the information is still relevant and it’s very entertaining and informative. The movie is expensive to buy, but I was able to reserve it from our public library. I had to get it from Prospector as it was at a local university.

Here’s the link for the movie. The instructor’s guide, linked on the same page, is the organizer I used. I circled the most important questions for the students to fill out, and paused the movie at certain points to work with the kids on filling out the organizer.

We then have a quick safety and procedure talk about the computer take-apart. I have learned to keep the rules really short and simple.

- If you have a laptop, take the battery out first and bring it directly to me. Don’t take anything else apart until the battery is out.
- Wash your hands well afterward to avoid getting lead in your eyes, nose, and mouth.
- Do not break any screens.
- Many computers are meant to be taken apart. Look for the places where the computer has seams, screws, levers or tabs.
- As you remove pieces, label them. Each group will get a sheet of labels and some tape. Sometimes you may find more than one piece in a category.

I give each group a sheet with labels of computer parts, plus a couple of blank labels in case they find things that aren’t on the originals.

I circulate around as the groups are taking their computers apart and help them identify parts as they remove them. Sometimes they’re tricky even for me! When opening laptops, sometimes the easiest way to access the motherboard is to take the keyboard apart and come in through the top – which of course kids love and requires a little extra time cleaning up at the end because keys get all over the floor.

When the computers are dissected, we begin a group show -and- tell for their computers. I put prompts up on the board and ask groups to hold up a part that matches the prompt. We go around the room and every group explains what they’re holding. They rotate group members for each part. Example prompts:

- Hold up something that stores data.
- Hold up your CPU.
- Hold up something that is for input.
- Hold up something that is for output.
- Hold up something that’s used for cooling your computer.
- Hold up something used to power the computer.
- Hold up something used to connect to a network.
- Hold up the motherboard.

At the end, I do allow kids to take home a souvenir as long as it’s not a hard drive, solid-state drive, or a battery. I keep those and make sure they get recycled properly. We spend quite a bit of time placing parts in big moving boxes, which I tape up and label for recycling.

I could do a formal assessment. I choose not to. The show-and-tell is a helpful wrap-up and taking a computer part home is something the kids really enjoy as a reward for cleaning up well. I had a student tell me the other day that he took his motherboard home, set it in a frame, filled it with resin and hung it on a wall!

It has ended up being a fun set of lessons that are also great for learning. I’m glad I didn’t give up on it.

# Media Literacy and Fake News

Part of my charter as the tech teacher is to facilitate learning about digital citizenship and online research. In the past I’ve used lessons from Common Sense Media and really enjoyed them. I especially love their lessons on copyright / fair use and maintaining your digital footprint.

I’ve had a few conversations with kids lately, including my own daughters, that have given me a sense of urgency when it comes to media literacy. Students love to show me funny things they encounter online and exciting or outrageous stories. Sometimes they’re real but exaggerated. Sometimes they’re total hoaxes.

One event that really made me feel a sense of urgency was when President Trump re-tweeted some clickbait videos with inflammatory titles against Muslims. The cues from the source and the video titles told me right away they were probably misleading, out of context, or possibly even fake. I’ve learned what questions to ask and so I was able to quickly realize I don’t need to be afraid of my Muslim friends or students based on the tweets. But the President is a world leader, and information coming from him carries weight. My students wouldn’t necessarily know what I do about clickbait and fake news stories. I wouldn’t want them to have bad opinions about their classmates or community members, or live in irrational fear, based on misleading information from social media. What questions should I help my students ask to really evaluate information critically? Middle-schoolers, in my experience, know about the prevalence of clickbait, fake news and bias, but they make decisions based on their gut reactions. They should start learning to look for patterns that help you make decisions about what to trust.

I started looking for lessons on fake news / clickbait / biased media, and was pretty pleased with what’s out there. Here is how we did the lesson:

Warmup: Ask students if they follow world events by reading or watching news. Most of my sixth-graders said no. Some even said their parents don’t let them watch news – it’s too upsetting (one even used the word “divisive”). Write “fake news” “clickbait” and “biased news” on the board and ask kids to share what they know about these terms. Most students are familiar with them or have at least heard of them. Some key points to bring out: fake news is completely false / made up. It might be a joke, or it might be trying to convince you it’e real. Clickbait uses an exciting title or thumbnail image to make you click, but the link usually isn’t as exciting as the title and thumbnail were. Biased news tends to be one-sided and it mixes opinions with news.

Bring out that the information economy is driven by clicks and views. The more clicks and views a site has, the more money it makes. Understanding this can make you smarter as a consumer – companies will do whatever it takes to make their link look interesting to you, so you click on it.

Activity 1: The purpose of this activity is to test their savvy at identifying real vs. fake news, and look for patterns that would help you evaluate articles in the future. Play the game FACTITIOUS at: http://factitious.augamestudio.com/#/ The game gives you a snippet of a news story and will tell you the source if you click a button. Your job is to swipe right for real news and left for fake news. Students should try to get the highest score they can the first time around. Look for tips and ideas that will help you identify fake vs. real stories the first time.

Students LOVED the game and found it really interesting and exciting. It is appropriate for middle-school. There are a couple of drug references but they’re informative and not promoting drugs.

Discuss Activity 1: Ask students what patterns they noticed that would help them be smarter about identifying fake news vs. real news. Here are some things my students mentioned. I was surprised at some of the interesting things they noticed:

- Look at the source and see if it’s reputable (like the BBC) or not reputable (like ilovepancakes.com)
- See if the article quotes professionals with real titles. Look for details like real locations.
- Look at the images – are they real images of the event or are they photoshopped or stock images?
- How is the grammar and spelling in the article?
- Does the article use ALL CAPS or emotional language?
- If it’s a science article, does it mention who did the study or what magazine the study was published in?
- Use the common sense test. Read the article past the headline and think about if it’s realistic.

Activity 2: Identify biased news and look for ways to be a smart consumer of news. I found the website allsides.com when I was doing a search on ways to teach about media bias. I really like this site and recommend it! I selected two stories that I thought would be accessible to middle-schoolers, one from the “right” and one from the “left”, that dealt with the same topic. In this case, I chose the topic of taxes but you could choose whatever topic is relevant to current events.

Left-leaning article on tax reform bill

Right-leaning article on tax reform bill

I assigned students to read the headline and first few paragraphs of either Article A or Article B. Their question prompts were:

- What is the main idea of the Senate tax bill?
- Will this bill impact people positively or negatively?

Discussion of Activity 2: The student responses were interesting. At a first glance, only about half of the students used evidence from the text to answer the question. Should I have been more specific in the question prompt? I was surprised at how many students had an opinion on the tax bill, considering they told me they don’t follow world events. Did they learn their opinions from family dinner-table conversations or do they read news more than they thought?

We’ll have the follow-up conversation next class and this is what I want to pursue.

First, list some adjectives that convey an emotion or feeling. I’ll have the kids brainstorm adjectives like “dark”, “deadly”, “bright”, “winning”, etc.

We’ll go through the articles one more time and just look for emotion-filled words or phrases. These hint at opinions in the articles.

- If we weren’t told ahead of time, we might not know these two articles are even about the same thing. Why are the articles so different if they are both news articles about a tax bill? [they’re about different parts of a tax bill and neither is about the whole thing]
- The articles are a mix of fact and opinion. What tells you that you are reading someone’s opinion vs. fact?
- What are some emotionally-charged words and phrases used in the article? Why should you be aware of these?
- Are opinion articles useful? Explain.
- If you don’t know your opinion about a topic and you’re using news articles to learn, what suggestions do you have that would help you be a smart consumer of news?

As a side note, I did have a hard time finding left-leaning and right-leaning articles that were written at a middle school reading level. Even with a tough read, though, I felt students could look for the general mood of the article and identify some phrases that would tip them off about the author’s opinion.

I will look for opportunities to bring these ideas into discussions as we move into break. Another interesting game I found is this one: Fake It to Make It. Some of the ideas might be above a middle-schooler’s head, but I think they’d enjoy this view into how social media gives us a really strange news ecosystem. I’ve read about college professors creating courses on how to write fake news. Maybe as a tie-in to web design or HTML, we could do a lesson on how to write a fake news story. For fun and education!

# Making Joule Thief lanterns for a better world

My dear colleague Tracey Winey (you can find her on Twitter at @winey02 ) introduced me to the idea of philanthropic engineering – that students can make projects in class that can be useful in real-life for a good cause. Years ago, she and some other educator colleagues came up with the idea that kids could genuinely tackle light poverty – the lack of artificial light sources after darkness falls. In areas where electricity isn’t available or isn’t reliable, a nice light source can make a huge difference when it comes to studying, cooking, doing chores or staying safe. Our school and others around the world have already sent dozens of little lanterns to people in Guatemala, Honduras, Nicaragua, Uganda and other locations. You can find out more about the effort at http://e-b.io

This is normally an after-school program and my after-school hours are really limited with a busy family. This year I am getting my whole electronics class involved by having them create lanterns for Engineering Brightness. After some tweaking of the process this is where I am with it now.

- I provide the electrical design and all of the parts, and the students pay a small class fee to cover costs.
- Students solder the circuit together by following instructions I provide.
- Students design some kind of case or enclosure for the lantern, by prototyping with cardboard and other household materials.
- We will present and share the lanterns with their enclosures, and 3-D print a handful of the best designs.
- As a class we’ll assemble the final projects and then put them in a box with some cards and photos. We will send them to either Liberia or Guatemala where Tracey has some contacts through her church.

I will share plans on how to make these if you’d like to have your class try it out as well. After we have a couple of enclosure designs, I can also share the 3-D models of those so you can print them and assemble the whole thing.

Before I get to the how-to’s, of course the big question here is what are we trying to teach the students? What do I hope they learn and how will I know they have learned it?

We’re working a little outside Colorado’s state science standards, but I don’t think every worthwhile learning experience has to be linked to standards. I also believe it’s OK if every kid’s learning is different. Here are some of the areas in which I want to see growth from the kids.

- Understand that electrical circuits require a closed path, a load, and a voltage source, and identifying those in a real-life circuit.
- Identify some basic electrical components, what they do and how they work.
- After working with a design, identify ways it can be improved such as cost, size, durability and quality. Know what a tradeoff is and make smart tradeoffs when improving a design.
- Consider a purpose of a product and improve it for that purpose.
- Identify common electrical problems or mistakes and describe how to fix them.
- Solder safely. Produce work that improves in quality over time.
- Make something that will be meaningful to another person.

I based my little lantern design on a “Joule Thief”. Normally, a white LED takes around 3 volts to light up brightly – so you need two or three AA batteries for the purpose. Three are better than two, because once the batteries drain even a little bit, two won’t work well anymore. Rechargeable batteries are important because it is difficult to replace batteries in light-poor areas. The Joule Thief conserves cost and battery life by using a transistor and a ferrite toroid to make a single 1.2 volt rechargeable battery create a pulsing voltage that is enough to light an LED. It does this by making a magnetic field oscillate and it adds to the battery voltage. I go through some basic circuitry lessons with the kids, and we learn about LED’s and resistors, series and parallel circuits and what they do, and then we watch the joule thief video and compare/contrast it to a plain DC parallel circuit.

The students learn how to solder first by watching videos, and we take a soldering safety quiz before they are allowed to solder. Then students make their project bags and start assembling lanterns. I have had parent volunteers come in to help supervise the soldering and that has been a huge help.

I made this YouTube tutorial that shows you how to assemble the Joule Thief project. The students watch this video and pause it in spots to assemble their lanterns.

http://tinyurl.com/joulethiefvideo

In the video description, I’ve included a parts list and the instructions for making the circuit boards. I’ll also include it here. You just have to order some cheap electronics online, like wire, transistors, solar panels and ferrite toroids. The lanterns take one of everything, execpt LED’s. I used ten LED’s for each lantern. It’s all in this spreadsheet. You can make them for around $5 each if you shop around a little. I use eBay, Jameco and Amazon for my purchasing.

Parts List

The circuit boards are really fun to make. A couple of years ago, one of my former students came to visit me and showed me some custom circuit boards he created. He taught me how to design and upload my own… sometimes you’re the student, sometimes the teacher. The basic process is:

- You lay out all of your components and the wiring using a program called Fritzing.
- You export your Fritzing circuit to Gerber format. This gives you a bunch of files in a folder. If you want to use mine, you can download them here. GERBER FILES
- You zip the folder using something like WinZip.
- Go to Seeed studio at http://seeedstudio.com/
- Select their Fusion PCB service.
- Upload your zipped Gerber folder. You can use their Gerber Viewer to see the circuit board and make sure it looks OK.

- Choose your options. I prefer a 2-layer board because the students get a solder pad on the top and bottom of the circuit board. My board’s measurements are 42.8mm*67.2mm and sometimes it doesn’t update correctly.
- Decide how many you want. Place the order and it will be shipped to you!

Some of the first students finished soldering their circuits after about 3 classes, and they’re making little enclosures as well. I’m asking them to prototype enclosures using household items – and we’ll 3-D print the best ones. Here are some of the ideas so far.

I really love literal “light bulb moments” when the students finish soldering, flip the switch and the lights come on. It makes me proud every time I finish one, and I’ve done this a few times by now. It’s exciting for a first-timer.

We’ve watched some videos about Liberia and will be learning about Guatemala as well. I want the kids to start to get to know the people who will be receiving their little solar lights. Fingers crossed for a successful finish to the lanterns, and I really think if nothing else, they feel more competent and confident when it comes to working with circuits.

# Learning Python with the micro:bit

This is such a big year for middle school computer science. I think that finally, for grades 6-8, there is a whole menu of really high quality teaching resources – from hardware tools to lessons and tutorials to standards to whole curricula. I’m pretty much changing how I do EVERYTHING, which is exhausting but exhilarating at the same time.

In the standards area, there is a new set of standards released by the Computer Science Teachers’ Association, or CSTA, located here. They are very good overall, building from grade level to grade level, organized by concept and very clear. I think it gives a nice progression for students. Many states, my own included, are involved in efforts to develop statewide standards, curricula and resources. It’s been great to see CS education move forward and the middle-years progression is really coming together.

As far as curricular resources, there are a few great new options. Code.org has a middle school course called CS Discoveries. I didn’t get to attend the training this summer, but one of my co-workers went and although she’s not a programmer by background, she came out feeling excited and confident that she could teach the curriculum and do a good job. It’s very well done so that pretty much anyone can take it and run with it.

The middle years are a great time to introduce kids to physical computing, the idea that you use algorithms and code to program devices in the world around us. It’s such an important tech literacy concept! The CS Discoveries course uses a platform called the Circuit Playground from Adafruit. For a long time, I’ve enjoyed the Sparkfun Inventor’s Kit and its little curriculum. I’ve also noticed a lot of buzz around the UK’s platform for introducing kids to physical computing – the BBC micro:bit. They are cheap and very engaging. I ordered a class pack of them, and from Sparkfun the price is really reasonable.

I teach block-based programming to the sixth-graders and then work with the older middle schoolers on transitioning to text-based programming. For the younger kids, I was thrilled to find an entire CS curriculum for the micro:bit published by Microsoft. It is so good! I love its emphasis on “making” and creativity, and I enjoy the little unplugged activities. I was skeptical of them at first, but every time I try one of the unplugged activities I find the kids really enjoy it and it does help the concepts stick better. The curriculum is easy to follow, and I find the kids love finishing the lesson and then just playing with what they can do on the micro:bit.

I’m finding I can’t do some of the “invention” activities, because I only have one class set of micro:bits and they’re shared throughout the day. I can’t have kids mount the micro:bit in a pet or wearable, for example, because the next class needs them. That’s really a bummer – being a maker involves more than just code. I might try to do an invention project with the kids with the caveat that the enclosure has to let you insert and remove the micro:bit easily. We will see how things go this semester.

As you can see from the title of this post, one of the things I’m playing with is teaching text-based programming via Python to the seventh- and eighth- graders. I was not lucky enough to locate an entire curriculum for this, but there are some good resources out there. I am using the micro:bit python editor. You have to save your files locally instead of in the cloud, and actually this really beneficial. The students I have this year have had laptops in their classrooms since 2012, so they’re “digital natives”. But they’re so used to Google Docs and such that they sometimes don’t have a concept of what a file is or where it is actually stored. So we’re learning about local storage, networked storage, removable storage and cloud storage and figuring out how to access a file from different locations.

There are a lot of tutorials and a good reference at this site: micro:bit Python documentation. It gives a nice introduction to the different features of the micro:bit, but it doesn’t really teach Python. So I’m stitching together my own curriculum and put together these exercises.

In Lesson 1, we just wrote the normal Hello World program and the students were tasked with writing a program that displayed text and images, using some of what they found in the documentation. This task also involved uploading a program to the micro:bit and saving the file in local and networked storage.

# Add your Python code here. E.g. from microbit import * display.scroll('Hi!') while True: display.show(Image.HAPPY) sleep(1000) display.show(Image.HEART) sleep(1000)

In Lesson 2, we reviewed Python syntax and common mistakes and troubleshooting. We introduced the terms “function” and “parameter” and saved some notes on these. We talked about the “while True:” loop and why the indentation is important. It’s not just picky – the indentation communicates important things to the computer! How will it know which steps to repeat without some way of blocking them off? Then we introduced variables by making a little program that displays text that changes. Students guessed at what it might do, and then we ran it and tested the hypotheses.

from microbit import * name = 'Dawn' while True: display.scroll(name) name = 'Tyrone'

Next in Lesson 3 we made a little counter program and demonstrated the difference between the string and text data types. Students could modify it by adjusting the starting value, displaying only evens, only odds, etc.

from microbit import * # declare a variable and assign it to a value. counter = 0 while True: display.scroll(str(counter), 50) counter = counter + 1

By the end of this lesson, some students were feeling frustrated at how hard it was to load files, save files, upload to the micro:bit, figure out where the errors were and so on. But these are short programs and the debugging isn’t hard once you’re used to it. Students have to read the error on the micro:bit and it tells them which line the problem is on. They need to pay attention to little details and that can be exhausting, but it’s so important to give clear instructions to a machine. The machine can’t guess what you mean! We talked about how hard it was for them to write their names when they were children. If you think about it, it’s a long process! There can be dozens of little steps involved in writing your name and they were pretty bad at it when they first learned. But over time the steps became automatic and they got better, and now writing their name is a very simple task. Same with coding and debugging.

I could tell students were jonesing to make something that looked like a game. I decided to introduce random numbers as our next concept. So in Lesson 4 I had student volunteers pretend to be human variables, and we modeled what it would look like to write a program that multiplied random numbers together. First a random number is assigned to variable a. Then a random number is assigned to variable b. Then a and b report out what they are, and they are multiplied together and the result is stored in variable c. We report the result from variable c. Kids acted this part out.

Then we wrote the program together.

from microbit import * import random bob = random.randint(1,10) jeffrey = random.randint(1,10) display.scroll(str(bob)) display.scroll("*") display.scroll(str(jeffrey)) display.scroll("=") wilma = bob * jeffrey display.scroll(str(wilma))

Many kids wanted to adapt their program to include a “forever” loop and keep producing random math problems as long as the power was switched on. By now they understood why the indentation worked, so when I suggested a “while True:” loop with everything indented after it, they were able to add it on their own.

Lastly, I wanted to introduce them to the coordinate plane on the pixel grid. For Lesson 5 I set out 25 pieces of paper in a 5×5 grid shape. I asked for one student to be a “pixel” and another to give directions. The student giving directions had to pick a random piece of paper, and in as few instructions as possible, tell the pixel where to go. We did this a few times and then I suggested that we make the paper in the top-left corner be (0,0). Then we realized we needed a sensible order for the row/column coordinates, so we defined “x” and “y”. We found out quickly that the pixels could only go from 0 to 4 and that 5 was off the grid. Lastly we introduced a “brightness” parameter, so when the instructor student commanded a pixel, they could tell the pixel student to go to an x coordinate, y coordinate, and to squat or stand according to a brightness level. So then we wrote this simple program and I reinforced the terms “function” and “parameter”.

from microbit import * import random while True: display.set_pixel(2, 3, 9) sleep(200) display.set_pixel(2, 3, 0) sleep(200)

And then we modified it to use variables instead of fixed numbers and the kids really liked the pixel dancing around on the grid.

from microbit import * import random while True: x = random.randint(0,4) y = random.randint(0,4) display.set_pixel(x,y,9) sleep(100) display.set_pixel(x,y,0)

Note I haven’t done much in the way of assessment other than conversations and verbal questions.. so we’ll have our first quiz task sometime next week to see how this is coming along. I don’t regret the direct instruction, though. The kids are finding it valuable, and they’re enjoying the micro:bits and learning what they can do with them. They want to make games such as pong and snake, and I think once we understand how to use the buttons, radio and accelerometer, they’re going to have a really good time making things they haven’t yet envisioned. I’m learning right along with them. They ask me a ton of questions and my stock response is “I just haven’t learned that yet. I guess we will learn it together.”

It’s fun though. It keeps you young.

## Recent Comments