beanz Magazine June 2021

Page 1

Kids, Code, and Computer Science 2020 Tillywig Award Winner

2020 Academics' Choice Award Winner

Out of This World! Geocaching on Mars

June 2021

$6.00 USD $6.00

Create a Fairy Tale From Scratch Talking about TEG The Wonderful World of...Ham?


beanz magazine June 2021: Volume 8 Issue 6 Issue 54 (online) & 37 (print) ISSN: 2573-3966 (online) ISSN: 2573-3958 (print) beanz Magazine© is published bi-monthly, six times a year, online at http://beanzmag.com and in print. A print + online magazine subscription includes online access to all articles, with links to let you explore topics in more detail. SUBSCRIBE: visit http://beanzmag. com/subscribe or email us for checks/ invoices. We’re also available through EBSCO, Discount Magazine, WT Cox, Magazine PTP, and many other subscription services. ONLINE MAGAZINE ACCESS: send your email address to hello@beanzmag.com and we’ll set you up. Published by Owl Hill Media, LLC 378 Eastwood Rd, Woodmere, NY 11598 Email: hello@beanzmag.com Phone: (646) 553-3390 POSTMASTER: Send address changes to Owl Hill Media, LLC, 378 Eastwood Rd, Woodmere, NY 11598. Periodicals postage paid at Woodmere, NY and other mailing offices Copyright Owl Hill Media, LLC with all rights reserved except as noted. Images are copyrighted by their creators, as noted with each story both online and in print. Publisher/Editor: Tim Slavin Staff Writers: Erin Winnick, Amy S. Hansen, Bonnie Roskes, Simon Batt, Patricia Foster, Clarissa Littler, Jennifer Newell, Tim McGuigan, Bianca Rivera, Jo Hinchcliffe, Tim Slavin Contributors: David Dodge, Jay Silver, Jeremy Kubica, Colleen Graves, Daniel Fenjves, Ali Hagen, Emeline Swanson, Jean-Francois Nguyen, Paul Seal, Madeleine Slavin Back Office Magic: Wendy Garrison Copy Editor: Eileen Seiler Art Director: Kelley Lanuto Webmistress: Patricia Foster COVER IMAGES: KEVIN GILL, FLICKR; TOM GAINOR, UNSPLASH; VIRGINIA STATE PARKS, FLICKR; AND SC AIR NATIONAL GUARD, FLICKR

Publisher’s Note Welcome to this issue! Watching the Mars rover, Perseverance, in the news over the past few months has been a great opportunity to learn how people use technology, a key topic for this magazine. We saw how the rover could help NASA scientists fix a problem using another piece of technology­—all the way on Mars. The little four-pound helicopter called Ingenuity turned out to have a software bug that prevented it from flying on Mars. NASA developers had to identify the problem, update and test their code, then send the fixed code to the rover. The rover was able to send it to the helicopter, which then flew! Want to track the rover? Check out the story on page 2. There is a lot more to this issue, which we hope you’ll find interesting and fun. We have an article about creating pixel art for use with Scratch, as well as an LED electronics project, bats and the Internet of Things, a beginner coding project with CodeGuppy, and a story about the guy who invented the first analog computers...and also cow catchers! We get to meet some interesting people who use technology in their careers. Musician James McKinney and his business partner Scott Jacoby, as well as Allie Grey who is helping to create indoor farming technology. All three are great role models. And thank you to middle school teacher, Jason Palmira, for telling us about how he uses beanz magazine in his coding and robotics classroom (See Me and My beanz on page 1). Here's hoping that this issue finds you staying safe, enjoying the remainder of your school year, and looking forward to a great summer.

Tim Slavin, Publisher beanz Magazine

Our Mission beanz magazine is a bi-monthly online and print magazine about learning to code, computer science, and how we use technology in our daily lives. The magazine includes hard-to-find information, for example, a list of 40+ programming languages for education, coding schools, summer tech camps, and more. While the magazine is written to help kids ages 8 and older learn about programming and computer science, many readers and subscribers are parents, teachers, and librarians who use the articles to learn alongside their young kids, students, or library patrons. The magazine strives to provide easy to understand how-to information, with a bit of quirky fun. Subscribers support the magazine. There is no advertising to distract readers. The magazine explores these topics: Basics of programming and where to learn more, Problem solving and collaboration, Mathematical foundations of computing and computer science, Computational thinking, Recognizing and selecting computer devices, and the Community, global, and ethical impacts of technology.


contents

advanced

intermediate

beginner

2

cribe 1 s b u s / ag.com m z n a e /b https:/

June 2021

5

Projects Geocaching on Mars

Cover Story

6 8 10 12 14 16 18

History Let's Go For An OldFashioned Drive

Programming Cover Story

Once Upon a Time, In the Land of Scratch

People McKinney's STEAM-Powered Music

Programming Python Pillow Pics Play

Notebook Cover Story Ham It Up!

Projects

An Easier Way to Get a Nice Lawn

Electronics

Linkin' and Blinkin'

Notebook Cover Story A TEG Talk

tidbitz

24 Your Brain on Code 24 Shining Armor 24 Untying the Knots You Writing 25 Are This Down? a 25 Outsmarting Smart Virus 25 Talk About DIY!

19 20 22 26 27 28

Tech In Real Life The I-o-b-a-T-s

People

Plenty to Talk About!

Programming Code a Smile

Concepts

Gateways to Computation

History

Mooooving Cows, and Computers, Into the Future

Parents and Teachers Solving Tiny Problems

Me and My beanz! beanz magazine is an important resource in my middle school coding and robotics classroom. We use it for inspiration on Python programs, ideas for hands-on projects to experiment with and try out, and interesting computer science information. We love it! —Jason Palmira, Canarelli MS How much do you love beanz? We'd love to see! Send us a photo of you and your beanz to us at hello@beanzmag.com. We may print it right here and make you famous. Bragging rights!


2 Projects

BY TIM SLAVIN

Geocaching on Mars

Mars, as we all know, is pretty far away. But, with the recent arrival on Mars of the rover, Perseverance, we can follow along on this amazing scientific adventure by using a game that is played right here on earth. It’s called geocaching, and it's like a treasure hunt. Geocaching is played mostly outside and involves finding objects often hidden in plain sight. Geocachers use tools like a smart phone app, GPS, an online search engine, and a geocaching site to record their finds. A geocache is an item or container that can include other items, for example, a notepad on which finders can add their name and date. Geocaches are hidden with GPS coordinates recorded on a geocaching site for others to find. A trackable is usually a game piece found in a geocache whose movements from one geocache to another can be recorded on a geocaching site. As it happens, the rover Perseverance has a trackable that has an ID code you can download and follow. How Did a Trackable Get to Mars? On board the rover is a scientific instrument call SHERLOC

that includes a camera called, of course, WATSON. (Watson is a character in the Sherlock Holmes detective stories.) NASA scientists Dr. Francis McCubbin and Dr. Marc Freis and his son Wyatt, both avid geocachers, were given permission to add a trackable code as part of the panel on the exterior of the rover that's used to calibrate the SHERLOC-WATSON assembly. Although a trackable on Mars can’t be moved from one place to another, WATSON sent a special photo back to Earth that included the code that geocachers, or anyone, can follow. While not the first off-Earth geocache or trackable—there’s a geocache on the International Space Station— the Perseverance trackable is the first on Mars. Interestingly, the trackable code is also part of a polycarbonate disc used by the WATSON camera. The astronauts’ helmet visors are made from the same disc material, which is being tested to see how it survives on Mars. How Do You Get the Trackable Code? There are two ways, one easy and one a little more challenging. The simple way is to search online for the Perseverance rover

trackable ID code, with a search engine or the geocaching.com website. (Yawn) The harder, but infinitely more fun way, is to go through the SHERLOC-WATSON photos on the NASA Mars Perseverance website to find the photo sent back to Earth. Then visit the geocaching. com website page for trackables, type in the ID code, and then follow the trackable. Photos can be found at https:// mars.nasa.gov/mars2020/ multimedia/raw-images/ and be sure to select the SHERLOCWATSON filter check box on the right side of the page. You’re looking for this photo of the calibration panel from Sol 26 or March 26, 2021 here on Earth. (See page 4.) What Does the Trackable Look Like? The trackable itself, right, is a round image with lots of interesting artwork. In addition

Background image: An animation of the surface of Mars, with the Rover, above.


3 The term geocache comes from the word cache, pronounced "cash". It's a French word dating back to the late 1700s. It refers to a temporary hiding place to store items. ALL IMAGES FROM NASA

The Trackable and the Geocache Coin are here.

The Mars rover and its scientific instruments to the trackable ID number you can use on the geocaching. com website to add to your geocaching collection, you can see the dancing stick figures at the bottom of the trackable and the profile drawing of Sherlock Holmes near the top. Apparently, the stick figures are from a code Holmes cracked in one of his detective stories. The code on the Mars rover spells out, “Cache me if you can,” a fun shout-out to geocachers looking for this trackable. The 221BBAKER ID code also is a reference to Baker Street, where Holmes lived. Add the Mars Trackable to Your Collection Having found the Perseverance trackable with the 221BBAKER ID code, the next


4 step is to go to the geocaching. com website, log in or create an account, then find the Perseverance trackable page at https://www.geocaching.com/ track/ and type in the code on the geocoin: 221BBAKER. Be sure to click the Found It? Log It! link, and then click the Add to Watchlist link too. And if you’re interested in all the markings on the rover, definitely look at the NASA https://mars.nasa.gov/ mars2020/spacecraft/rover/ markings/ page that describes them all.

A

B

C

B

These are images of the panel that is on the outside of the rover. Notice how clean the top image is? A That's because this image was taken before the panel got to Mars! See the trackable in each image? B The five bottom row cutouts are made of spacesuit materials. The trackable is made of black spacesuit helmet material. Over time, the SHERLOC-WATSON camera will photograph the panel to see how well the materials hold up in the harsh Mars environment. The bottom image C shows how much magnetic dust the panel has already collected.

Check Out Some More Cool Perseverance Technology MOXIE The Perserverance rover includes Moxie, a toaster-sized box that converts carbon dioxide—which is the main component of thin Martian air—into oxygen which humans can breathe. Oxygen is also a critical part of rocket propellant which would lift heavy rockets off Mars to return astronauts to Earth. Otherwise, oxygen would have to be carried from Earth. MOXIE brings us one step closer to humans being able to live on planets like Mars. NASA also has an interesting DIY project you can do to understand how MOXIE works. https://www.jpl.nasa.gov/edu/teach/activity/the-air-up-there-making-space-breathable/ https://mars.nasa.gov/mars2020/spacecraft/instruments/moxie/ https://www.jpl.nasa.gov/news/nasas-perseverance-mars-rover-extracts-first-oxygenfrom-red-planet

INGENUITY Perseverance also includes a 4-pound helicopter called Ingenuity that has two sets of blades. Tucked into the rover belly, then dropped on to the Martian soil, Ingenuity performed the first powered flight on another planet. It is a demonstration project designed to fly in the extremely thin air on Mars. Pre-flight checks showed a problem which delayed its first flight and required NASA software programmers to update the helicopter’s code. The updated code was sent from Earth through space, to the rover, and on to Ingenuity! https://mars.nasa.gov/technology/helicopter/

b


5 BY SIMON BATT

PHIL AARONSON, FLICKR

A lot of computers, as you may know, come equipped with what’s called an internal hard disk drive (HDD). However, don’t you find that name a bit weird? Sure, the drive has a spinning disk in it that stores your data...but why is it considered a “hard” disk? Are there “soft" disks out there, too? And while we’re on the subject of weird names...why is it called a “drive” when there’s no car in sight? First, let’s figure out why it’s called a drive. This word comes from a time when storage didn’t come in one package, like a HDD. Instead, the part where the data was stored and the part that would

read and write the data were two different things. Back in the early days of computing, there was something called the tape drive. This was back when we stored information on tape, which could then be read by a machine. Instead of just feeding the machine loose tape, the tape was stored in a cassette with two spindles in it. To start, the tape would be wrapped around only one of these spindles and attached to the other. When you spun both spindles the same way, the tape would leave one spindle and slowly begin to wrap around the other. As the tape travelled between spindles, the tape drive could read the content to see what’s on it. It was sort of like someone reading a really long scroll, but for machines. The thing is, you needed a machine that could both read the data and automatically spin the spindles for it to work. An old-fashioned tape drive

Old-fashioned floppy disks To better protect the flimsy disk, manufacturers began putting them in hard plastic cases so people couldn’t bend them. The manufacturers added little windows in the case so the PC could still look at and spin the disk, but it was otherwise totally protected. In a weird way, the ‘floppy disk’ ended up being very solid; it’s just the inside that was flimsy. So, the next time you hear the term “hard disk drive,” you know why we call it ‘hard’ and why it’s a ‘drive’. A lot of history behind a commonly-used name. b

History FREDY JACOB, UNSPLASH

This photograph shows one kind of old-fashioned drive

This special device was called a “drive,” because it “drove” the cassette tapes in order to read the data. This term stuck with us, even when we have nothing to “drive” anymore. When was the last time you had to rewind a USB drive? So that’s why we call it a ‘drive’, but why do we have to say that it’s a ‘hard disk’? Well, there is a ‘soft disk’ out there; however, it doesn’t go by that name. Instead, it uses the much sillier name, ‘floppy disk’. Floppy disks were, well, floppy. Unlike the hard CDs we have now, you could bend them. However, it wasn’t a great idea to do so, because it could damage the data on the disk.

LUCAS MYERS, UNSPLASH

SIMPLE INSOMNIA, FLICKR

Let's Go For an Old-Fashioned Drive


Programming

6

BY BIANCA RIVERA

Once Upon a Time, in the A fun way to use Scratch is to tell a story using characters and dialogue. For our story, we will develop a "fractured" fairy tale, which is an amusing way to reimagine traditional fairy tales. In this, the first of a series of lessons, we’ll discuss how to create backdrops, add sound, change costumes, manage timing, and utilize the Glide and Broadcast blocks. To view the sample project, go to Scratch and do a search for “Fracturing Fairy Tales” by creator Fairy Scratcher (or visit the Project Page at https://scratch.mit.edu/ projects/504911562). Click on “See inside” to view the code. If you want to create your own version (called a “Remix”), you will need an adult to help you create a Scratch account.

To start, let’s look at backdrops. In this project, there are five backdrops. Castle Garden and Castle Doors are Scratch-created backdrops. The other three were created using the paint editor (using fill colors and text tools). Notice the screens that signify opening or changing scenes have their own code. It’s important to add any backdrop sound effects to the code for the backdrops—do not include them on any sprite’s code. It is recommended (and fun) to manipulate the sound effects. When you click on the sound editor, you can adjust the volume and fade-in/fade-out settings, as was done in the different scenes of this project. Next let’s look at sprites and costumes. In Scratch, Costumes are different animation “looks”

for sprites. For example, the Fairy Sprite has a total of five different costumes, meaning she has five different animations. Be careful—if you are going to use different premade Costumes, don’t move the sprite’s position within the image editor. Move the sprite’s position using its x, y coordinates, so it doesn’t look like it’s jumping around on the screen. Notice, too, that the Centaur Sprite was originally facing right. To get him to face the Fairy, go to his Costumes and click “Flip Horizontal”. Also notice that both Sprite’s code blocks are separated out by scene. It’s important to chunk code by scene to stay organized and avoid errors.

Backdrops

Centaur

Timing is a huge issue when it comes to dialogue in Scratch. Scratch measures time in seconds (even half seconds), so make sure to count the time a Sprite uses for dialogue and action and then plan the other sprite’s time accordingly by using the Wait-Seconds block. Notice the Fairy’s wand glides down to the ground. That action


7

Land of Scratch...

Broadcast

was completed using the Glide and Broadcast blocks. The wand sprite has its own code, separate from the Fairy. Click on the wand sprite to see its code. Using a Broadcast block will keep things organized. First, go to the wand’s code blocks and add a When I Receive block and type the new message, “wand falling”. Then add a Glide block and adjust the time and x, y coordinates to have

it fall to the ground. Last, place a Broadcast “wand falling” block on the Fairy Sprite to start the wand falling event. b

.edu tch.mit a r c s t u Check o


8 People

BY AMY S. HANSEN

McKinney's STEAMPowered Music The screen shows uninspired squiggles. But you don’t look away because the music pulls you in. The squiggles fall into the shape of a computer control key, the logo of the company appears and their message that they are in control flashes off screen. The graphics for the short are fine, but the music is memorable. It gives weight to the abstract and makes the strange lines on the screen feel alive. Composer, musician and Grammy-nominated producer James McKinney is in charge of that music. He lays down a melody line, then harmony, then another, adjusts the volumes and reverb until the music is as perfect as it can get. “When I am manipulating the music, I am doing the Arts part of STEAM,” he said. “Building the software is the science, technology,

engineering and math.” McKinney makes adjustments on the computer screen using a software package called Waves. Someone else coded the package, and he is grateful. “Coding,” he said, “is the glue between the physical and digital realms of music.” McKinney did a bit of coding when he was in high school, but the programs now are beyond anything he ever worked on. He also started his journey in engineering while he was still in high school. He first went into studios as a musician, recording onto tape as he chased the dream of being a rock superstar. Then he became a sound engineer himself. “I transitioned really quickly from analogue to digital,” he said. He learned the physics of recording sound and how the waves are represented on the

screens he uses. He learned the ease of duplicating sections of rhythms throughout a song. He learned to add or subtract tones from voices or instruments. Now, as a composer as well as a sound engineer, he knows that the real instruments sound much better than the digital ones. But he can use the fake strings and fake brass as a sketch within his scores. Once he gets other musicians to play, he can hear his sketch played. “You don’t know until you hear it if it’s going to work and if it’s going to be what you thought,” he said. When it works it is a moment of bliss. “I’m touching God or God is touching me. It’s amazing.” Caribbean Recordings Which brings him to another project, building studios so others can learn to do what he


9 PHOTO: JAMES MCKINNEY

does. McKinney and his business partner, Scott Jacoby, own Eusonia Records with recording studios in New York City. Six years ago, Eusonia was invited to be a consultant on a non-profit project, Anguilla Musical Academy. Anguilla is an island nation east of Puerto Rico. The goal of AMA is to build world-class studios and open an engineering school. The whole project is ready to launch once COVID is over, he said. “We want to be able to give the youth of the Caribbean the option to stay in their court and learn.” Coding an Encore Among other activities, the students there are going to learn coding. And while the graduates of these classes don’t need to focus only on sound, he is hopeful that they may be working toward the

next set of more sophisticated musical software: computers that will aid in songwriting. Right now, machines are getting to where they can play simple songs, or play regular beats on a par with humans. But more complicated songs are all human. For example, McKinney points at piano jazz great Joey Alexander. Alexander breathes into the sound, holding notes just a little longer than is written, giving the song character and depth. Those interpretations defy easy coding. Five-time Grammy-award winner Jacob Collier is another example. While he uses computers in his presentations and composition, Collier also adds amazing chord progressions and harmonies that inspire other musical humans. Computer composition programs are left in

James McKinney holds his guitar and poses with his business partner Scott Jacoby in their New York studio.

the dust. But that won’t always be true, McKinney says. He expects artificial intelligence to learn how to interpret and create songs by “breaking the measures into millions or even billions of pieces.” Each of those pieces will have decisions made about the length of the notes, the volume of the notes, and all of the other choices musicians make. Then the computer will put the measure back together, just as our brain does. And when that happens, the computer will be as much an art form as the composer’s job is now, essentially putting the A firmly back in the STEAM project. b


10

n o h t Py s c i P w o l Pil y a Pl

Programming

BY CLARISSA LITTLER

C

E

F ALL IMAGES BY TOR LOWELL


A

Let's say you've taken some photos and you want to do something interesting with them, something weird perhaps? Or maybe you just have a ton of photos and you need to crop them all to the same size, convert them to black and white, and apply a sharpness filter. Can you imagine doing that by hand a hundred times? Sounds awful. In either case, the photo editing tool you might want to reach for is Python. Yes, Python the programming language. Python, in addition to being one of the most popular programming languages out there is also an amazing image editor thanks to the Pillow library which comes standard with most installs of Python. Working with Pillow is pretty simple: you can from PIL import Image in a Python script and then simply open your photos with Image.open and then you're ready to go. From here, let's show how to crop and save an image so that you grab just the center rectangle that's half the size of the total image. A In words, what we do is: • Import the Pillow library and assign it the variable name Image • Open the file using the variable im to hold the photo and use the Image variable (holding all the Pillow library functionality) to perform actions like sizing, cropping, and saving. • Find the size of the image you've opened, using the im variable and size function in the Pillow library • Crop it by using a 4-tuple to describe the rectangle you want to crop: naming the points of the upper-left corner and lower right

D

corner of the image, using the im variable and crop function in the Pillow library • Then, finally, we save the image again using the save function in the Pillow library. From here, it would be pretty easy to loop through all the files in a directory and crop all of them in just a few seconds. That's hard to do without writing some code. With just a few more concepts, though, we can do something truly weird. We're going to use Python's built in randomness and the ability to paste images into each other to "automagically" collage a group of photos together. To explain the program in words first, we'll start by opening all the images we want and putting them in a list. Then we're going to create a blank image of a certain size with a randomly chosen solid color. Then we're going to randomly choose the number of slices from photos we'll take and, then, that many times we'll choose a random photo out of the list, choose a random rectangle to crop out of the photo, and paste that cropped image into the final image Finally, we save the whole thing. Here's the code, with me writing a little helper function called randRect to make random rectangles. B And here's an example of an image that was created from this collaging process: C We've barely scratched the surface of the kinds of things you

B can do in Python. Because we can also do things like transformations on the individual pixels in an image, this opens up an entire world of photo processing to us. For a fun, but perhaps silly, example of using the point function, here's a code snippet that takes an image and "compresses" the color so that the bright parts of an image are all slightly brighter and the dark parts of the image are darker. D This turns an image from E to F. You can see how it creates a fun, yet gaudy, kind of smear effect on the image. Learning more about the Pillow library is also a good opportunity to dig into code reading. The code base, available at https://github. com/python-pillow/Pillow, is relatively easy to follow. For example, looking at the various image filters in the ImageFilter.py file you can see that most of them are only a few lines of code long. You can easily play around and make your own filters and use them in order to learn more about photography. So I hope this short introduction helps convince you that Python might be a fun tool for art and photography. b

11


12

Ham It Up!

Notebook

BY CLARISSA LITTLER

If there's any current trend in tech that I love right now it's that people are constantly finding new ways to repurpose old technologies. Along those lines, we're going to talk about the world of people who have built an alternative internet over amateur radio, often called ham radio. Before we dive in, we need to talk a bit about what radio and

forms a webpage you access on your phone; or it can be individual frames that make up a television signal.

What isn’t a radio? Even though, when we say radio, we usually mean "a thing that broadcasts music or talk", from the perspective of science, radio is actually a huge range of things including: your wi-fi, the cell WIKIMEDIA COMMONS network a phone connects to, and the free tv stations that exist in a lot of places that only show fifty year old tv shows and the news. These are all types of radio. We're just constantly swimming in all these signals; this light that has waves so big not only can we A typical amateur radio set-up. The term "ham" was first used in professional wired telegraphy during the not see them 19th century to mock operators with poor Morse codebut the waves sending skills ("ham-fisted"). (Wikipedia) pass through us like visible light amateur radio are. On a physical through clear glass. From the radio level, radio is electromagnetic signal's perspective, humans don't waves—the same as light— even exist. It's pretty cool, but broadcast out in all directions and maybe a little weird if you think picked up by antennas. Antennas about it too hard. are material, often pieces of metal, So if wifi is a kind of radio, have that get "shaken" by these waves in we reached the end of this article? a way that creates electricity. Admittedly, it'd be pretty funny The electricity in the antenna if I said "to use the internet over can then be used for all sorts radio, turn on your phone" but of things: for a radio station it instead we’re going to talk about becomes the signal that drives something much cooler by far: a speaker so you can listen to amateur radio. music; it can become the data that Amateur radio is a very old

standard of communication that takes place on specific radio frequencies that have been reserved all across the world to be freely used by everyone. In most countries you do need a license to legally broadcast, but licenses generally are free, available with a very low or no minimum age limit, and easy to get When you're licensed, you also get a call sign, which is almost like an internet IP address. For amateur radio, a call sign identifies the broadcaster. It's assigned to a person, not the radio. Ham radio is often used for people to talk to each other hundreds, even thousands, of miles apart. But that's not all the ways amateur radio is useful. Since ham radio is, on a physical level, the same kind of thing as wifi, it should be possible to convert the sound-oriented radio signals into digital signals computers use with wi-fi. Then you have a reach of miles and without needing to pay an ISP for internet access. What’s your call sign? There are a few different ways to use the internet over the radio. One of the most popular is the automatic packet reporting system (APRS), a system people have set up where everyone tunes into the same frequency and uses software or hardware to convert their radio signals into packets, just like the bits of data that get sent over the normal internet. The same way an IP address on the normal internet is used to find the computer that's supposed to get a message, the call sign of the radio operator is used to let someone's computer know if a packet sent out across the radio is meant for them. APRS technology predates wi-fi entirely. People commonly set up raspberry pis to manage encoding and decoding the APRS signals and to help provide infrastructure to


boost signals. People use APRS to send emails and messages, as well as sending texts cell phones can receive. In addition to APRS, people also use mesh networks, which are a little different. You create your own private network with a group of people and even use modded wi-fi routers to signal-boost your radio-based network. These mesh networks can be huge as your signal hops from radio enthusiast to radio enthusiast all who have routers and antennas set up to pass along signals, covering tens to hundreds of miles per person. Are we there yet? Probably the single biggest disadvantage of doing something like this is that it's slow. Like capital S slow, Snail's-Pace slow. Like waiting-for-a-pot-of-water-to-boil slow. Like don't-even-think-about -streaming-video slow. And if it's so slow, why use it? There are both practical and philosophical reasons to broadcast internet traffic with radio technologies. The most basic reason is that it's kinda fun to try making something like the internet with a group of friends. But, also, a lot of people care about this because it's useful for disaster relief. These radio networks are slow but they are low-power, can be maintained by a handful of people with some batteries, and still be used to keep communication going when cell phone towers go down and big areas lose power. The last reason to broadcast the internet is that some people don’t want to feel locked into infrastructure they didn't make. They want to have control over it, and that makes a lot of sense to me: it's the maker movement distilled down to include the internet we use daily. b

13 My name is Guglielmo Marconi, and I'm thrilled that the wireless technology I invented is still relevant in 2021!

WIKIMEDIA COMMONS

Right: U.S. Navy Chief Petty Officer Adrey Garret uses a ham radio at Williams Air Operating Facility during the 1956 winter. Ham radio was the only means of voice communication with friends and family back in the U.S. for navy personnel living and working in Antarctica in the days before satellite telephone technology became common. (Wikipedia) WIKIMEDIA COMMONS

WIKIMEDIA COMMONS

Above: A ham radio convention in Germany, 2010


Projects

14

BY JENNIFER NEWELL

An Easier Way to Get a Nice Lawn In February’s issue of beanz we introduced the basics of pixel art using Piskel. For June, we will build off of February’s article and create a pixelated scene that can be used in a Scratch project. Our goal is to make a tiled ground such as the one shown below: A To start, we will go to Piskel (https://www.piskelapp.com/) and log in. If you do not have an

account, go ahead and make one before starting a project. To start a new project, click the yellow Create Sprite button. On the right side of the screen find the gear image that represents the Preference section of the site. B When Preferences opens, find the Grid tab. Be sure to check the Enabled grid box. C Next, choose the smallest grid size and the smallest grid spacing.D

Finally, find the Resize option and set the grid to 16 x 16. Click the yellow Resize button to save this grid size. Now it is time to choose a color for the ground. In this example we will make grass on dirt, so we start with brown. E Once we find a hue of brown that we’re happy with, we can fill in the entire grid with one click by using the paint bucket tool. F

A

D

D

B E

F C


15

BART EVERSON, FLICKR

At this point the grid will look similar to the image below: G The next step is to add in some green toward the top. It is a good idea to select three hues of green from the color palette to create shading in the grass. H Now that we have one dirt/grass tile, we can download it (as a PNG file), and then upload it into Scratch (as a sprite) to create a scene. Once the image is in Scratch,

G

click on the costume tab of the dirt/grass sprite and copy and paste it until it covers the width of the screen. Be sure to switch to vector mode to do so (the blue button at the bottom of the costume tab will read Convert to Bitmap). I If you’d like a “hilly” scene, paste some of the blocks kitty-corner (on a diagonal), above (or below) and to the right with the corners touching. J

I

Finally, we can use the color chooser to select a matching brown color to fill in the white space below our dirt scene. K Create a couple of pixelated trees (using Piskel or similar drawing app), add in a sprite from Scratch’s sprite collection, a blue sky background, and there we have it - a pixelated scene that can be used in your next coding project! L b

K

L

I

H

J

L K


16 Electronics

BY JO HINCHCLIFFE

Linkin' and Blinkin' The transistor is an amazing piece of technology that has resulted in many other inventions: from radios to personal computers and mobile phones that now contain many millions of them. The first transistor was made in 1947 by William Shockley, John Bardeen, and Walter Brattain at a place called Bell Laboratories. A transistor can do a couple of different tasks with electricity. It can be used as an electrically controlled switch, where adding or taking away voltage at one of its three connections can cause the other two connectors to connect or disconnect. It can also be used to amplify or increase power in a circuit. The circuit we are going to make uses 2 transistors as switches that are controlled by each other. They cause two Light Emitting Diodes (LEDs) to flash on and off; sort of like a never ending game of tennis. We are going to need the following supplies for our circuit: • 2 x LEDs of any color, but best if they match • 2 x Resistors that are 680 ohms; 680 ohms might be written 680r or use the symbol for ohm like this, 680Ω • 2 x resistors that are 5.6k (Kilo Ohms), which is a thousand ohms • 2 x 2n3904 transistors. • 2 x 100 uF electrolytic capacitors • A breadboard prototyping board • Some jumper wires • A 9V PP3 battery • A 9V PP3 battery clip

Let's look at our breadboard. A A breadboard has lots of tiny holes into which we can insert jumper wires or the wires/leads coming out of our components. The holes are

arranged into connected groups and, on most breadboards, the long lines at the sides of the board are connected and can be used to connect the positive and negative wires of your power supply (PP3 battery). If you connect the wires to these long lines, then every hole on that line will be connected to that wire. In the other sections of the board, each group of five holes in a line is connected and there is a gap down the middle of the board. Until we make a connection, nothing connects across that gap. B Let’s grab our battery connector and slip the red wire into the outside outer line and the black wire into the inner line as shown in the picture. C Next, grab an LED and have a close look at it. LEDs are a type of diode, and they only pass power through one way. So it’s important to know which way to connect it. One of the wires coming out is the negative wire and one is the positive. The negative wire is the shorter of the two wires and also, if you look at the LED part, you’ll notice that the negative side is flattened rather than rounded at the base of the LED. If you do further reading about LEDs, the proper name for the positive lead is the “anode” and the negative lead is the “cathode”. D You can bend the wires a little, but make sure they never touch each other or the circuit won’t work. We are connecting the circuit as shown in the breadboard diagram where we have used lots of connecting blue wires; but in real life you might be able to use the component wires to

directly connect between points. We pushed the positive longer leads into the positive power row and pushed the negative lead into a row of holes. Next, grab your 680r resistors and put one end into a hole connected to the LED negative row you just made, and put the other end of the resistor over the gap in the middle of the breadboard and into another hole row. E Next insert your transistors into three separate rows with the flat side facing you and with the 1st pin (furthest on the left when the flat side of the transistor is facing you) connected to the same row as the end of the resistor we just inserted. Next use one of your jumper wires to connect pin 3 (the right hand pin) back up to the Ground power rail (black wire on your battery clip). Take your 5.6k resistors and connect pin 2 (middle pin) on each resistor back to the positive power rail (red wire on the battery clip). Remember that all the holes in a group of five are connected so you can use the hole closest to the breadboard gap on the row connected to transistor pin 2 as the connection for the 5.6k resistors to make it a shorter distance. Finally take your capacitors. This type of capacitor is similar to LEDs in that it needs to be the right way around to work properly. If you look at the body of the capacitor, you should see on the “can” that one side has a white strip with negative signs on it indicating that the lead nearest that mark is the negative lead. Place the capacitors so that the positive side connects to the row where the 680r resistor connects to pin 1 of the transistor and connect the negative side to pin 2 of the opposite transistor. Double check all your connections and then connect your battery. If everything has gone well you should see your LEDs flashing in turn. F


Using the breadboard diagram is a very useful way to show how to lay out a circuit; but a more common way is a schematic, which uses symbols and annotation to show the connections in a circuit. If you compare the connections on the breadboard diagram to the schematic, you should be able to identify the component symbols. Learning to read a schematic and how to breadboard circuits opens up a world of experiments. Finally, let’s look at what is actually happening in our LED flashing circuit. The capacitor is like a bucket that can fill with charge, but only when transistor Q1 is off and that side of the circuit isn’t connected to ground. When it is connected to ground, the bucket empties and the negative side of the capacitor drops to less than 0.7v (in fact it drops to -8.3). As it drops voltage, the LED on that side lights up but the negative voltage causes the other transistor to turn off. This means that, on the Q2 side, the LED and capacitor aren’t connected to ground, so capacitor C2 starts to fill up with charge. What causes this to change, however, is that the negative side of capacitor C1 is connected to the positive supply through the other resistor. This causes the voltage to rise again at the negative side of the capacitor Once it reaches 0.7V, it will cause the circuit to swap sides and begin the process again as the Q2 transistor turns on, connecting LED 2 to ground and making it light up. It’s like an endless game of ping pong or table tennis where the circuit bounces from one side to the other indefinitely. If you are interested in learning more about about how this type of circuit works, its official name is an “astable oscillator” and you can find a great explanation and animation here: https://www.falstad.com/ circuit/e-multivib-a.html. b

17

A

B

C

D

E

F


18 Notebook

BY TIM SLAVIN

A TEG Talk

TOBIAS FAUCHER, DAVID GRIFFITHS, UNSPLASH

Technology, its history, and its frequently surprising applications are an endless source of fascination for me. Recently, I read an article about powering phones by body temperature. How does that work? I did some online digging. I learned electricity can be generated from a difference in temperature between two parts of the same piece of metal. It’s called TEG. Typing the phrase, define TEG, into a search engine yielded my first result: a teg is a two-year-old sheep. Hmm. Clearly, I needed to refine my search terms. "Define TEG electronics" turned up the correct result from Wikipedia. “A thermoelectric generator (TEG), also called a Seebeck generator, is a solid state device that converts heat flux (temperature differences) directly into electrical energy through a phenomenon called the Seebeck Effect (a form of thermoelectric effect).” Solid state device? What’s that? Britannica.com tells me: “...electronic device in which electricity flows through solid semiconductor crystals (silicon, gallium arsenide, germanium) rather than through vacuum tubes.” So, a TEG creates electricity from the temperature difference between two parts of a metal piece treated with solid semiconductor crystals like silicon or gallium arsenide. One side measures body heat. The other side measures something cooler, like air temperature. Yet I found no mention of this capability in a Science Advances journal on TEG technology. The closest I came was: “A record-high open-circuit voltage among flexible TEGs is achieved, reaching 1 V/cm2 at a temperature difference of 95 K.” Do you know what that means? Neither did I. Although I guessed 1 V/cm2 means 1 volt of electricity per square cm of the material. However, I found the mention of 95K interesting. K could stand for kelvin. (kelvin is a scale for measuring temperature.) Could it be 95 degrees kelvin? When I searched define 95K, the search engine treated 95K as 95 thousand IOPS or input/output operations per second. I tried again, with define 95K temperature solid state device. That got me lots of articles about solid state drives, (another topic entirely) and the effects of too-high temperatures. Then, In an aha! moment, I noticed my search term used 95K, not the 95 K (with space in between). I wanted to learn more about the Kelvin temperature scale, so I searched: define Kelvin temperature. I learned that kelvin is the base unit of temperature in the International System of Units (SI). It uses the symbol K (uppercase) as in 95 K. Kelvin measures temperature from absolute zero, where molecules stop moving. There are no negative numbers in kelvin and there are no degrees. However, a kelvin unit does correspond to a degree in Celsius. Then, it made sense. Reading the Science Advances journal article about this amazing super-duper discovery of stretchy material that can sustain an electrical connection using body heat, it appears the researchers did use the kelvin scale in their research. Next question. Can I buy a TEG at a store along with the usual electronic cables and plugs? My research said: “not yet.” Powering a phone requires a steady source of electricity: a problem for us fidgety humans who can’t stay still enough to maintain a constant electrical connection...UNLESS you use a material that stretches and re-forms as people move. For now, a TEG can power a cell phone in theory, but not in reality. But keep an eye out for it in the next 5-10 years. Won’t that be fun to wear a bracelet that wirelessly charges your phone? I found out more than I bargained for in my research on body temperature and phone charging. I also learned that the words you use in your searches matter and can take you places you never expected. b


-o-b-a-T-s

In the past issues of beanz, we’ve covered how the Internet of Things (IoT) can help humans in all kinds of areas. We can use gadgets to help us farm, generate power from the sea, or just connect with other gadgets. However, did you know that animals can also make use of IoT devices like we do? Of course, you won’t find a penguin or a lion in your local Apple store asking around for the latest “tech toys”. However, scientists are now using the power of IoT to keep track of how animals are doing and to ensure they’re okay. For instance; how do you know if an elephant is getting enough exercise? Unless, of course, you watch it all day and night to ensure it’s going out for its daily jog. We already have gadgets that can get this information for us like the watches or bands that can track how many steps you’ve taken, or your current heart rate. One of these would be amazing for keeping track of an elephant’s exercise, but there’s a problem; elephants are way too big! Human health trackers are designed to go around our dainty little wrists, while an elephant’s foot is over 40cm in diameter! So, researchers had to invent a new exercise tracker that will fit on an elephant, and it’s affectionately known as the “FitBit for elephants”. It helped the researchers keep track of what the huge beasts were up to, giving them the 24/7 surveillance they would not otherwise have. This knowledge will help animal scientists learn more about how to keep elephants healthy. Here’s another question. How do you track a bat? Bats can be very flighty and can dart around quickly, so it’s hard to follow the same bat with just your eyes. However, IoT devices aren’t so easily tricked, making them a perfect method for tracking these creatures of the night. For example, a research team wanted to see how bats responded when they’re ill. They put little tracking backpacks on 31 bats, then injected half the bats with a harmless chemical that tricked their bodies into thinking they were ill. The other half was injected with a water-based salt solution which did nothing. This was just to ensure that the bats were responding to what was injected rather than the act of injection itself. Sure enough, the researchers discovered that the bats that felt ill distanced themselves from other bats and limited the time they spent with others, much like how we went into lockdown during the COVID outbreak. This research would not have been possible without the bats and their little tracking backpacks. This is important, because bats are in danger in some areas. We need our bat population to stay healthy and stable because they are such an important part of our ecosystem. The more we know about their behavior, the more we can understand how to help them. It goes to show how technology and nature can go hand-in-hand. What kind of IoT gadgets would you make? Would you like a device that lets you know what your dog is saying, or put a camera on a mole to see it tunneling around underground? Your imagination is the only limit! b

CLÉMENT FALIZE, UNSPLASH

19 Tech In Real Life

The

BY SIMON BATT

I don't feel so good. I'm going home to socially distance.


20

y t n ! t u Ple o b A k l a T to

People Languages

BY TIM SLAVIN

Allison Grey is a mechanical engineer who works at Plenty, a company in San Francisco, California that builds technology for vertical farming. Their technology grows food indoors instead of out in open fields.

We recently had an opportunity to chat with her about what she does, and what inspires her work. beanz: In what ways do you find technology to be magical for you? Allie: I find technology to be magical because it allows us to change the way humans have always done things and create things that have never existed before. The thing that interests me most about technology is the ways it can be used to help people,

improve their lives, and solve problems. Before college and during my first year or two I thought I would go into the medical robotics field, with the goal of helping people. I still find that field to be fascinating, but over time I realized there are countless ways technology helps people outside the medical space. Tasers save lives when used instead of guns, so working at Axon is what changed my perspective. Then I found Plenty. I feel our work does help people and the planet and will continue to do so at an increasing scale as we grow. The challenging part of technology is that it is constantly changing and improving, which could feel overwhelming, but that is what makes it fun and exciting! beanz: What kinds of problems do you try to solve at Plenty? Allie: Plenty is on a mission to change the way people eat, making extraordinary flavor and nutrition more available in a way that's better for people and the planet.

Agriculture has been the same for thousands of years, but we are revolutionizing it. We're bringing the farm indoors, making it vertical, and using technology for all stages from seeding to growing to harvesting to packaging. Additionally, the produce is always pesticide-free and grown using less than 1% of the land and 5% of the water of outdoor farming. One of the problems I work on specifically is designing machinery that is robust, capable of handling large quantities of produce, and is food safe and easily cleanable to reduce the risk of bacteria growing indoors. I use paper and pencil to do initial ideation, and then I design the robot on the computer using SolidWorks for Computer-Aided Design (CAD). I work with a crossfunctional team of mechanical design engineers, control engineers, project managers, and machinists to solve problems and create solutions. beanz: How much did school help you with what you’re doing? Allie: I learned the mechanical engineering and robotics skills necessary to have a strong foundation. I learned hands-on skills like prototyping and CAD and precision machining. I learned how to work hard, think creatively, and take on large projects and execute


21

them independently from start to finish. I also had professors and mentors who guided me and advised me that helped get me to where I am today. I have learned a lot on the job, particularly about working cross-functionally with other teams. I've learned how to go to different teams within Plenty and determine what their requirements for the technology are and then solve problems while working inside those externally defined bounds. I've also learned how to design sheet metal components.

I've learned a lot more about food-safe materials and designing machines that are easily cleanable. beanz: How did you get the internship in Tel Aviv, the Axon gig, and Boeing gig? Allie: I got the internship in Tel Aviv by applying to an internship program called Onward Israel. I got my internships at both Axon and Boeing through recruiting events at Penn's engineering career fair. At Boeing I was working as a Project Management Engineering Intern and I investigated the use of Model-Based Engineering which

is a method of design, analysis, validation and verification for Boeing's next aircraft. When it came to full time jobs I had offers from Boeing, NASA Jet Propulsion Laboratory, Boston Dynamics and Plenty. I chose Plenty because it was the statement of work and team culture I was looking for, and the mission aligns perfectly with my own personal values. I love working in the San Francisco startup world and working on a project I am so passionate about on a team full of incredible engineers. b


22 Programming Languages

BY TIM SLAVIN

a e d o C

CodeGuppy makes the coding discovery process both easy and fun to experience. This is the first in a series of coding projects using the CodeGuppy website (CodeGuppy. com) that will appear in future issues. Their projects use JavaScript and it’s not hard to change the code to see your results. Maybe you’ll get hooked on the process of writing and tweaking code. We’ll start with a Draw with Code project. Go to the CodeGuppy. com website, log in or create an account, then go here, to their code workspace URL: https://codeguppy. com/code.html You should see a blank code workspace. A The code panel is on the left column and code output displays on the right side of the workspace. Notice the PLAY button at the top right of the PLAY left side code panel. Clicking the PLAY and STOP buttons toggles code to display (PLAY) or not display (STOP) in the STOP right side code output panel. Now type or copy/paste this JavaScript code into the Code panel on the left side of the workspace. noStroke(); background("#548235"); fill("#ffc000"); circle(400,300,200); fill("black");

e l i Sm

circle(314,206,25); circle(504,206,25); fill("#c00000"); arc(400,340,238,196,0,180); Then click the PLAY button. Your code workspace should look like this: B Who said coding is hard? Let’s play with the colors of the smiley face. Do you see the #548235 bit of code? What’s up with that? It’s called a hexadecimal number. Colors are converted to six character hexadecimal numbers between #000000 (black) and #ffffff (white). (More about hexadecimals at the end of this article.) You might think, do I have to learn hexadecimal numbers? No wonder programming is so hard to learn!. Actually, plain old English words for different colors that everyone uses also work. In your code editor, change #548235 to green. Yes, it’s that easy. Press the button to display the changed code. Your code workspace should look like this: C Also try LightCoral and Peru and Tomato (really!) instead of #548235. All possible color names to try out can be found online at https://www. w3schools.com/colors/colors_ names.asp. If you want to experiment a bit, here are some guidelines for the other parts of the code. This gets a little more advanced from here. See the circle(400,300,200) code? In JavaScript that’s the circle()

function and the 400,300,200 are the x,y,d coordinates. The x and y coordinates are measured from the center of the circle. The d coordinate sets the diameter of the circle, in this case, 200. What happens if you change the d coordinate to 400? 150? Don’t forget to press the PLAY button to display your changes. The arc(400,340,238,196,0,180) looks linteresting, doesn’t it? In JavaScript, the arc() function is used to draw an arc. It has 7 parameters. The 400,340,238,196 bits are the x,y,w,h parameters. The x and y parameters are the x and y coordinates for an ellipse, an oval basically. The w parameter is the width of the arc of the ellipse. Can you guess what the h parameter represents? Yes, the height of the arc of the ellipse. The 0,180 bits are the angles to start (0) and stop (180) the arc, specified in radians. Want some fun? Change the 0 in the arc function to 10: arc(400,340,238,196,10,200). You’ll see the start angle for the arc begins 10 radians below the 0 parameter. Now you might notice I said there are 7 arc() parameters but I’ve only defined six. The seventh parameter is optional and not used in this project. It’s the mode parameter which determines the way to draw the arc: Chord, Pie, or Open. Let's go back to hexadecimal numbers. We know they are used to define colors. The six characters can be a mix of 0-9 or a-f, as in ffc000 in the code. And each pair of


23

A

B

C

characters represents some quantity of the colors red, green, and blue. So with ffc000, ff represents a shade of red, c0 represents a shade of green, and 00 represents a shade of blue. Which leads to the last thing to share for people who want to explore the code more deeply. Every programming language has a specification online that describes

all the features of a language, including functions like circle() and arc() for JavaScript. Search online for the phrase, JavaScript language specification, to find the developer. mozilla.org site which describes JavaScript, including functions. Or search with the phrase, JavaScript arc function, to find details about how to use the arc function.

Congratulations! You’ve now experienced some of the fun that can inspire people to enjoy software programming for a lifetime. Coding is definitely hard at times. But the basics are simple and fun: type code to see what happens then play around by experimenting and tweaking code. b


24

tidbitz Your Brain on Code

Computer programming is a new skill for our human brains to learn. It’s an activity our brains may not be optimized to do well. And while there are similarities between programming languages and natural languages, it turns out coding doesn't engage the language system part of our brains. Instead, coding engages the multiple demand system, the part of our brain that triggers when we do math problems or try to think logically. More interesting, coding uses the multiple demand system in both right and left sides of our brains. Solving math problems only uses one side. b

Shining Armor

https://spectrum.ieee.org/tech-talk/computing/software/what-does-your-brain-do-whenyou-read-code

Run away! Run away!

THISISENGINEERING, UNSPLASH

Is anybody here really good at getting out knots?

Untying the Knots

In 15th and 16th century Peru, the Incas had the largest and most complex society in the Americas but they left behind no written records. The Inca people used khipas, knotted cords attached together with other knotted cords, to keep records of important activities. As a freshman WIKIMEDIA COMMONS economics major at Harvard, Manny Medrano used his knowledge of Spanish and economics to discover that khipas not only recorded census information, but also recorded the social status of people in a community. This finding will help decipher other khipas and provide insights into how the Inca people lived. b

https://www.atlasobscura.com/articles/khipus-inca-empire-harvard-universitycolonialism

WIKIMEDIA COMMONS

Researchers used Unreal Engine, Blendr, and other software to model the Vimose chain mail armor. It's the best example in existence of Iron Age chain mail, used from AD 150-220. The armor is made of 20,000 small iron rings with room underneath for padding and held with a belt. The Unreal Engine software was used to test a variety of theories about how the armor fit a human body, as well as how it performed when its wearer was on foot and on horseback. b https://www.sciencedirect.com/science/ article/pii/S1296207421000546


25

Are You Writing This Down?

Maybe some old ways of doing things are better after all. A University of Tokyo study has shown that the act of writing with a pen on paper increases memory retention in the brain more than using a stylus and an electronic tablet or a smartphone with a touchscreen. The physical, material properties of paper provide more fixed cues for memory encoding that the hippocampus portion of the brain processes. When it comes to the encoding of new information in the brain, nothing beats good old-fashioned handwriting on paper. Maybe taking notes by hand in class will give you an edge on your next exam! b https://newatlas.com/science/writing-paper-better-memory-stylus-tablet-brain-activity/

Outsmarting a Smart Virus When the Covid-19 pandemic hit in early 2020, scientists immediately turned to software to communicate with other scientists and to solve problems. The Cleveland Clinic created a predictive model using patient records and artificial intelligence to identify patients most likely to test positive based on age, race, gender, socioeconomic status, vaccination history, and current medications. They used the limited amount of tests available of to confirm if members of this group had the virus. Other scientists and groups also used software to manage hospital beds, identify threats to patient recovery, and other important clinical information. b CDC.ORG

https://www.smithsonianmag.com/science-nature/how-doctors-are-using-artificialintelligence-battle-covid-19-180977124/

Talk About DIY! https://www.archdaily.com/958331/building-houseswith-giant-blocks-u-build-and-the-future-of-selfconstruction

Got Legos? The U-Build system is also a set of reusable modular blocks that allows people and communities to create buildings and houses with minimal fuss. The system uses CNC (Computer Numerical Control), an automated 3D printing technology, to create these reusable blocks on demand. A concrete foundation and plasterboard walls are not required either, making construction simpler with less impact on the environment. b

OMAR FLORES, UNSPLASH


26 Concepts

BY CLARISSA LITTLER

Gateways to Computation In the last issue, we talked about the physics of quantum mechanics and the ways quantum computers calculate things. This time we're going to talk about how the hardware of a computer works and how this relates to building quantum computers. Logical thinking Let's start with the concept of "logic gates". These are the fundamental building blocks of how a processor is built. How fundamental? Well a typical modern CPU has millions—even billions—of logic gates. Each logic gate performs a specific operation on a few bits at a time. One of the first we'll introduce is the and-gate. The and-gate takes two bits and returns 1, if both of the bits it's given are 1, and 0 otherwise. In Python, you'd write it like: def andGate(b1,b2): if (b1 == 1) and (b2 == 1): return 1 else: return 0 So if you think of bits as "1" means true and "0" means false, then an and-gate is basically the same thing as the and you use in if-statements in Python. There's also an or-gate that gives back a 1

FREE-IMAGES.COM

if either—or both—of the bits you give it are 1. And the last important gates are the not-gate that sends 0 to 1 & 1 to 0, and the xor-gate [read this as "ex or" for "exclusive or"] that returns 1 if only one of the inputs is 1. From here, we can demonstrate something kind of cool: let's add two bits together using logic gates. As a reminder of how binary numbers work, a binary number is a series of 1 or 0 and you read them as powers of two. So 101 is 4 + 1 which is 5 or 0110 is 2 + 1 which is 3. With that we can add two bits together like this: 0 + 0 = 00 1 + 0 = 01 0 + 1 = 01 1 + 1 = 10 If we look at the two output bits, we can notice a pattern. The right output bit is 1 when only one of the input bits is 1. The left output bit is 1 only when both of the input bits are 1. Huh. Those sound kind of like logic gates. To write this as Python code, it's: def halfAdder(b1,b2): return (andGate(b1,b2),xorGate(b1,b2)) So you've got the start of a general addition function just from using two gates. We call this a "half adder", though, because it only operates on one pair of bits at a time and doesn't easily chain together to add multi-bit numbers together. If you can understand how the half-adder works, though, then you're well on the way to understanding how to do all arithmetic with logic gates. Something to try: implement the xorGate function yourself and

then test out this addition function on ones and zeros. Gateways that go both ways So now we come to quantum computers and qbits. Quantum bits, as we discussed in the last issue, aren't just on or off, 1 or 0, but instead they store a wave that describes the probability the bit is a 1 or 0. These waves can interfere with each other, like noise-cancelling headphones interfere with sound waves, and this allows for very different kinds of math than just adding bits together. These operations will be carried about by quantum gates. Quantum gates are inherently more complex than the simple gates we’ve seen so far: for example, all quantum gates must be reversible. What does that mean? Well, a reversible operation is one you can undo: opening a backpack is reversible because you can close it. Turning left is reversible because you can then turn right. Adding two is reversible because you can subtract two. Crushing a soda can isn't reversible because you can never get it completely back to its old shape. Multiplying by zero isn't reversible, because you can't recover the original number just by looking at zero. And here's the punchline: logic gates, like the and-gate and xor-gate, are not reversible, similarly to why multiplying by zero isn't reversible. If an and-gate returned a 0 can you tell me what the inputs were? If things like and and xor gates aren't reversible, how can we do math with a quantum computer? We'll cover that next time. b


I wasn't so great with money, but I was a smartypants with computers. Oh well, no one's perfect!

Many people contributed to the invention of the modern computer, but none so interesting as British inventor Charles Babbage, who lived from 1791 to 1871. He was very smart, indeed, inventing practical things that are still used today, such as cow catchers on the front of trains. However, two of his biggest “inventions” were the Difference Engine and the Analytical Engine. We say “inventions” because, unfortunately, Babbage never actually managed to build them. However, the theory behind each was very good, and helped inspire scientists to get computers to where they are today. The Difference Engine was Babbage’s first idea. Just maybe, he thought, we could stop counting on our fingers and instead let a machine do the work. He argued that humans doing math had the potential for errors to creep in. By making a machine do the work, there would be no errors, Babbage said. He was kind of right. After all, when was the last time your calculator got a sum wrong? The Difference Engine was amazing for its time. It could “remember” numbers for future equations, similar to your calculator's memory feature. Unfortunately, unlike your calculator, the Difference Engine didn’t fit in your pocket. It took up an entire room! Babbage wasn’t able to get the Difference Engine fully built because the project needed a lot of money. The UK government tried to help with funding, but Babbage eventually used up all the money they gave him. Babbage didn’t mind. He already had an idea for an even better machine. After construction work stopped on the Difference Engine in 1833, Babbage got to work on making the improved version, which he called the Analytical Engine. The Analytical Engine was an amazing idea because it used components that were very similar to our modern-day computers. It had a mill that would process equations (like our processors), a store to save information to (like hard drives and RAM), a reader for entering data via punch cards (like a keyboard), and a printer for spitting data out (like, well...our printers). The machine was extremely ambitious for its time and Babbage wanted the entire thing to run on steam power. Yes, this was a computer even before electricity was used to power it. The machine needed a lot of components and, again, Babbage needed money. However, the UK government was already upset that Babbage had used a lot of money to make the Difference Engine which was never completed, so they didn’t offer him money to make the Analytical Engine. As such, Babbage’s designs for the Analytical Engine were forgotten... until 1937, 66 years after Babbage’s death, when people had the means to make Babbage’s ideas a reality. And the rest, as they say, is history. b ALL IMAGES ON THIS PAGE FROM WIKIMEDIA COMMONS

27 History

Mooooving Cows, and Computers, Into the Future

BY SIMON BATT

Left: A cow catcher on a locomotive engines moves cows off the train tracks. Below: The mill and printing portions of the Analytical Engine Bottom: Some gears from Difference Engine No. 2


Parents and Teachers

28

BY TIM MCGUIGAN

Solving Tiny Problems During a recent lesson on design thinking with my 8th grade students, we were talking about solving some very large problems like Coronavirus, plastics recycling, and remote learning when the topic of problemsolving itself came up. I posed the question,”Nevermind big problems, how do you go about solving small problems?”, and I got very few detailed answers. Some mentioned asking an adult for help, while others said they just tend to ignore problems until the last minute. A few were able to solve problems, but were unable to explain their method. In the end, what I found out is that my students didn’t have a clear and consistent process for solving problems, large or small. Problem-solving is a critical thinking skill that few have been taught, but it can be invaluable in the real world. Children start off by outsourcing problems to their parents at a young age, but slowly learn how to work out mysteries like shoelace tying or finding lost items. By middle school students are expected to be independent problem solvers. Moreover, the students who have the ability to approach and solve problems tend to thrive academically. The only issue is that, like many critical thinking skills, problem-solving isn’t a part of most K-12 curricula. For my own students, I wanted them to have a stronger sense of agency and independence, so I began to teach how to solve tiny problems. In my research, I looked for models that would apply to even

the smallest of problems. I’ve always liked the quote by Albert Einstein that an hour of problemsolving should require 55 minutes to understand the problem, and 5 minutes to find the solution. One of the best models that I found was published by OECD’s Centre for Educational Research and Innovation (CERI). It included concise methods for breaking down problems of any size. This problem-solving model asks the solver to follow an eight-step process that focuses primarily on defining the problem. To illustrate the process to my students, I used the tiny example of trying to cross a stream by hopping from rock to rock - a problem I had recently tried (and failed) to solve. To begin, the solver must understand the problem and explore its boundaries. As I looked at the stream, I noticed that there were some small rocks close to my side of the shore, but there was a larger gap between rocks on the other side. Secondly, the solver must question their assumptions. Looking at the rocks, my assumption was that they were stable and would support my weight. I stepped on a few to test this out, and found that they were anything but stable. Next are three important parts of the problem-solving process: imagine new perspectives, identify any weaknesses, and then justify a solution. To imagine a new perspective, I imagined what it would be like on the other side of the stream bank going in the opposite direction. I also had to

admit I had a few weaknesses in this situation like the fact that my running shoes weren’t waterproof, and there were no other spots to cross the stream close by. In the end, my justified solution was to step on the few rocks on my side of the stream and then attempt a leap across to the other side. It seemed like the best solution at the time, but I have to admit my jump didn’t go nearly as well as I had hoped. My foot missed the far bank by a solid 6 inches and my shoe got soaked. Finally, the last part of the process asks problem solvers to identify any weaknesses they may have had, and to reflect on alternatives for the next time this problem arises. I realized that without waterproof shoes, I was at a disadvantage, and boots would have increased my chances of surviving the ordeal with dry feet. My students then used this model to approach tiny problems in their own lives like finding a missing remote control or constantly forgetting gym clothes. While tiny problems are a small step, they encourage good problem-solving habits, like having a clear process and dealing with problems rather than avoiding them. As my eighth grade problem solvers continue to mature, my hope is that they continue to practice these skills and make problem-solving a critical thinking trait. It certainly is a powerful tool that they will hopefully find indispensable as intrepid, worldly adventurers. b


29

KARLA HERNANDEZ, UNSPLASH


“Treat your password like your toothbrush. Don't let anybody else use it, and get a new one every six months.."

—Clifford Stoll

Thank you for reading this issue of beanz ! Check out the links below to read stories from this issue online with links to learn more. Geocaching on Mars https://beanzmag.com/ mars-perseverance-trackable Let's Go For An OldFashioned Drive https://beanzmag.com/ hard-drives Once Upon a Time, In the Land of Scratch https://beanzmag.com/ scratch-fracturing-fairy-tales McKinney's STEAM-Powered Music https://beanzmag.com/ music-computing-steam Python Pillow Pics Play https://beanzmag.com/ python-photo-editing-pillow Ham It Up! https://beanzmag.com/ radio-broadcast-internet

An Easier Way to Get a Nice Lawn https://beanzmag.com/ piskel-create-scratchbackgrounds Linkin' and Blinkin' https://beanzmag.com/flashtransistors-project A TEG Talk https://beanzmag.com/ human-powered-phones-tech The I-o-b-a-T-s https://beanzmag.com/ iot-bat-backpacks Plenty to Talk About! https://beanzmag.com/ people-allie-gray Code a Smile https://beanzmag.com/ projects-codeguppy-smiley

tidbitz https://beanzmag.com/ june-2021-news-wire Gateways to Computation https://beanzmag.com/ quantum-computinggateways Mooooving Cows, and Computers, Into the Future https://beanzmag.com/ babbage-analytic-differenceengine Solving Tiny Problems https://beanzmag.com/ solving-tiny-problems ribe! subsc s s s s s S

https://beanzmag.com/subscribe


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.