Monday 7 August 2017

How to Build a Cheap, Portable "Learn to Code" Computer with Raspberry Pi

I believe that all children should have access to “learn to code” resources available today. This is not a reality however, as many do not regularly have access to the internet, or to a computer. Tablets are excellent tools, but access to the most popular tool for Elementary students learning to code - Scratch (https://scratch.mit.edu/) is not an option.

I have been thinking about a way to give better access to more children, and originally thought a Raspberry Pi loaded with video tutorials on how to start coding with Scratch would be a great option. The cost is reasonable and video would be easy to watch on the device and they would work on Scratch right on the Raspberry Pi.

The snags were - different versions of Scratch, 1.4 on the Pi and 2.0 on the web and in the video tutorials I originally created for internet access were all for Scratch 2.0. This might not seem like a big deal to children used to using computers and apps on a regular basis, but might prove a bigger roadblock to children with little, or no experience with technology. The second issue was that they might not have access to a screen, keyboard and mouse which would give them no access to the Raspberry Pi.

When I saw the touchscreen options available for the Raspberry Pi, and that Scratch 2.0 recently became available offline on Pixel OS (Raspbian Operating System on Raspberry Pi) I decided to build a reasonably cheap, touchscreen computer that would need nothing extra to function. It can still be hooked up to a monitor, keyboard and mouse if those are available, but it is useable with nothing more than an outlet.

For my build, I picked up a 4000 mAh Portable Battery Charger from Walmart for $5.00 to make it useable anywhere. There are several touchscreens available for the Raspberry Pi, I chose the official 7in. Screen from the Raspberry Pi foundation (It was super easy to connect to the Raspberry Pi, it all comes together in a few easy steps.


You will need:
(All my links are from a Canadian website, but these products are widely available)

2. Official Raspberry Pi 7in. Touchscreen:

3. Case for the Screen and Raspberry Pi:
I plan to 3D print the next case, there are plans freely available on the internet, so this will bring the cost of the build down a bit.

4. Any 5v microUSB cable should work, and a portable Battery Charger is a bonus:


How To:

1. Connect the white ribbon to the connector on the display adaptor board for the screen and the Raspberry Pi. To insert it, you will need to pull out on the tabs that holds the ribbon into the connectors. Pull upwards with gentle pressure and then insert the ribbon. The ribbon doesn’t go in deep enough to completely cover the metal strips on the end, don’t try to force it all the way in.



2. Next we need to connect power from the Raspberry Pi to the Display Adaptor Board. You will need two wires to do this, 4 are included in the display box. I used red for power, and black for the ground, but it makes no difference which colour wires you use.

The pins are clearly marked on the Adaptor Board, 5v for power, and GRD for ground to complete the circuit. They attach to to GPIO (General Purpose Input Output) pins on the Raspberry Pi as seen in the picture below. The power attaches to the first pin on the top row, and the ground attaches on the fourth pin. There should be two pins in between. Connecting the screen to the Raspberry Pi in this way allows you to power both through the microUSB connector on the Raspberry Pi. Make sure you have a 5v adaptor when you connect to power everything.


3. Now you’re ready to plug in and check to make sure all connections are secure and that the screen works. Plug in the Raspberry Pi and check the screen, you should see the Pixel OS screen (if you installed Pixel on your SD Card).



4. If you installed in many of the cases available for this screen, you will notice that the image is upside down. There is an easy fix for this, but to begin connect a usb keyboard to update/add a few things.

Open up Terminal and type:
“sudo apt-get update” without the quotation marks.

This will ensure you have the latest update of your current distro of Raspbian (Pixel OS).

Once that is completed type:
“sudo apt-get dist-upgrade”
This will ensure you get the latest updated build of Pixel to which you can add Scratch 2.0

To add the Scratch 2.0 coding environment:
“sudo apt-get install scratch2”

5. Now we need to add a line to the startup boot file that will flip the screen the right way for the case.

In Terminal type:
“Sudo nano /boot/confix.txt”

You will see the screen below. Add this to the bottom of the file:
“lcd_rotate=2”
Then press the ‘control key + x’ to exit and save.

The screen will flip once you reboot the Raspberry Pi.
To properly reboot type this into Terminal:
“Sudo shutdown -r now”
It will take a minute, but the Raspberry Pi will reboot and your screen will have flipped.



6. Now we need to install a keyboard, the most popular choice is Matchbox Keyboard.
To install type into Terminal:
“Sudo apt-get install matchbox-keyboard”

After another reboot it should be accessible in “Accessories” under a new section “Keyboard”. You do need to manually select it this way when you restart the Pi.

That’s about it! You should be up and running! I also installed Kodi to play the video tutorials I loaded onto the computer, and there are several coding options built right into the Raspberry Pi to explore.

Thanks for reading, and Happy Coding!

Tuesday 25 July 2017

Computational Thinking in the Mathematics Classroom

I have been integrating coding into my Elementary classroom for the last few years, and I have started to see more and more benefits as students began to think computationally through various challenges. It does take time to teach students how to code, but the benefits are quickly apparent. They learn the iteration process through testing code they have written as it runs on the computer. Failure is simply part of the learning experience and we apply this mentality to other subjects as well. We don’t code everyday in class, we use it when it fits into the curriculum. It becomes a tool that some students use more often than others, for some it is the best way for them to think and design their solution to a problem.


One of the questions I asked myself as an educator was:


“How does integrating coding into a student’s work flow change the way they approach various challenges?”



This is what I noticed in class:


  1. Sustained focus on a challenge, with little to no frustration when it doesn’t “just work”.


  1. See failure as a natural extension of the iteration process.


  1. Natural integration of various strands, and topics in overarching projects.


  1. Step-by-step iteration process, with methodical selection of one thing to change and why clearly explained.


As students learned to code various problems in the classroom, they were able to reflect on those skills and begin to make use of them when trying to solve a challenging problem.


Here is an example from our Grade 3 math class:


Students worked through this problem, learning the importance of the numerator and denominator during the task.




But a question came up as they were working:




They worked through this problem in small groups that were forwarding different strategies, but one group began to think through the process as though they were coding it in Scratch.




They took their circle fractions and what the numbers meant in the numerator and denominator and applied it to a coding algorithm:


This:


Became this:




We used calculators to figure out each section of the circle. I helped them to do 360 ÷ 5 and 7, they did the rest. They explained the steps in their program and why 2/7 was more than 1/5.


Once students think computationally, it becomes a natural extension of their thinking process.

The following example shows how 90° angles became a part of their thinking when they saw rotations.



They naturally thought in “code” blocks when they explained the rotations the shape made:


To extend the thinking, I asked how many ways a shape could translate (slide) on the screen.



“A thousand”

“A million”

“No, wait… 360!”

One student decided to show what it would look like…






I have enjoyed watching my students benefit from the addition of coding to our learning process. It isn’t hard to find ways to make coding fit into the curriculum.


Introducing a Concept

Purposeful Practice

Final Application


When introducing a new concept, don’t add on a coding challenge as well. Let students immerse themselves in the new learning with a challenge that helps them to better understand the new concept. Once they become comfortable with it, coding can be one of the purposeful practice opportunities that help students to deepen their understanding of the concept. As a final application, or project I like to give my students options in how they can share their work. In this way, some students will chose coding as the platform to show their new understanding, while others will use what best suits their learning style. In this way, everyone is confident in their final product, and will share their best work.