Common Core State Standards Tie-ins

It being apparent that there aren’t Common Core Standards for Coding (although more than a few ways to tie it into other standards) I noticed that the Vermont Agency of Education Common Core site has wisely included in its English Language Arts/Literacy Area a curation of Literacy and Learning Across the Curriculum resources which contains the article ‘63 Things Every Student Should Know In A Digital World,’ by Terry Heick.

 If I may, I would like to take some from this list that I think are closely aligned to coding and my project:

17. How to remix, mash, reimagine, tweak, hack, and repurpose media in credible, compelling, and legal ways:

• The best for first. I have done my best to model where I have found my resources and to what extent I have remixed them. I have learned a lot about Creative Commons and will promise to be better about licensing my own material.

27. How to effectively use technology in ways that might contradict their original purpose or design:
• This is another form of remixing, but is different. Especially in my way of thinking about developing projects that use parts from other tech – toys, broken computers, etc.

50. The consequences of using a single operating system (e.g., iOS, Android, Windows, etc.):
• I am extending this to the consequences of using a single source of community, prototyping sites (123D & Fritzing), Search Engines, and Open Education Resources.

63. Log-in info, passwords, old email address, and other trappings of digital life are a pain. Use password keepers and plan accordingly:
• Keeping secure, keeping code safe, no trespassing.

Under the ISTE Standards for Students, four over-arching categories are given – here I choose one under each category:

Creativity and innovation
Students demonstrate creative thinking, construct knowledge, and develop innovative products and processes using technology.

c. Use models and simulations to explore complex systems and issues
• Designing on a breadboard (model) and replicating it on Autodesk 123D (simulation) for a portfolio of Arduino circuits.

Communication and collaboration
Students use digital media and environments to communicate and work collaboratively, including at a distance, to support individual learning and contribute to the learning of others.

d. Contribute to project teams to produce original works or solve problems
• This will be incumbent upon each student under my demand. I highly respect this ethos.

Research and information fluency
Students apply digital tools to gather, evaluate, and use information.

c. Evaluate and select information sources and digital tools based on the appropriateness to specific tasks
• Students in my class will have a wide variety of resources to choose from and will not have the instructor at their call for cookbook instructions.

Critical thinking, problem solving, and decision making
Students use critical thinking skills to plan and conduct research, manage projects, solve problems, and make informed decisions using appropriate digital tools and resources.

d. Use multiple processes and diverse perspectives to explore alternative solutions
• Through respect and openness and the careful listening of students’ contributions.

Learning to Teach Arduino Coding – Autodesk 123D

For me to learn something and to be able to teach it I have to go far ahead of myself and then back off – go a little further – and back off again.

Now I have to think about what it would be like to teach this to an unknown group of students. How would I present the Arduino? What tools and components would I need? What would my budget look like? How do I set up a consistent teaching scenario?

Having discovered Autodesk’s 123D has helped me to concretize some of my thinking on this. What I did today was to go back (yet again!) to an early circuit and replicate it using the excellent book Introduction to Arduino, A piece of cake! by Alan G. Smith. I attached my breadboard to a piece of cardboard and attached the Arduino to this as well. This will help keep things oriented well and prevent the Arduino from flipping around when it’s plugged in. It would be my classroom’s culture to keep this orientation when using the bb setup with 123D.

IMG_4618 (1)

The next step was to create the circuit on the breadboard and 123D:

bb

And then to run them both:

I feel good about this setup because now I can teach circuits using alligator clips and Serial Bus, on a breadboard, and using 123D. Using 123D will help to flip my classroom so that experiments can be made away and brought into the lab for replication. I also find that this reiteration helps to retain the concepts learned.

123D 3D Modeling

My #42 Tech Ed endorsement is helping me to learning how to use a breadboard with Arduino to make circuits. At first I learned how to make them very simply with Makey Makey and connecting 3 LEDs with a Serial Bus, but I really liked the breadboard because my mind could follow the circuit’s path more intuitively. So I advanced my work into breadboards with Pulse Width Modulation, coding a switch, and sensor.

As I head into choosing what I want to do for my final project, I’ve used this week to explore using Autodesk’s 123D 3D modeling application to recreate and create new circuits. My hope is to integrate this excellent tool with whatever I decide my Final Project to be.

Dumping Diigo

At the beginning of the course I’m taking, “Create w/Code,” I was encouraged to curate my resources – to save and note all of the places that I’ve been online that are interesting to me and may prove useful in the future. Beyond typical bookmarking, it should be a place that should and can be shared with others. All good ideas. I chose to use Diigo and it was fine except that I didn’t always remember to use it, don’t have it installed on Safari, and realized that I had bookmarks in three different places. Enough.

I’m now just bookmarking as I used to always do in the past, on both browsers, and taking the time to export the ones of most value and posting them to my website. It takes a little time, but I can organize them the way I want, and retrieve them wherever I am:

http://www.jdedtech.com/links.html

 

Coding a Sensor – Photocell

In doing the next part of my assignment, Coding a Sensor, I needed to be sure I was using the correctly rated resistor of 10KΩ. I had two kinds, so I had to figure out which was which. After learning a little on Wikipedia: Electronic Color Code
Resistor Color Coding

I found a Resistor Calculator on HobbyHour.Com that was helpful. The one I had been using is what I need, 10KΩ. I’m having trouble distinguishing the others I have because I can’t really tell the difference between black and blue in the second column to well. If it’s black it’s 500KΩ, but the calculator warns me that is a Non-standard 5% (E24) value! If I use blue it doesn’t warn and says that it’s 560KΩ. That number seems high, but I don’t know enough to know if it’s high or not. Anyway, I have the resistor I need.

I read a little about the Light-Dependent Resistor (LDR) from a resource on bildr.blog:

sensor

Simple Light Reading With LDR + Arduino – bildr.blog

“The LDR changes its resistance with light so we can measure that change using one of the Arduino’s analog pins. But to do that we need a fixed resistor (not changing) that we can use for that comparison (We are using a 10K resistor). This is called a voltage divider and divides the 5v between the LDR and the resistor. Then we measure how much voltage is on the LDR using the analog read on your arduino, and we have our reading. The amount of that 5V that each part gets is proportional to its resistance.”

Okay. Got that.

“With the arduino analogRead, at 5V (its max) it would read 1023, and at 0v it read 0. So if the the LDR and the resistor have the same resistance, the 5V is split evenly (2.5V), to each part. (analogRead of 512)

But if the LDR is hit with a ton of light and is reading only 1K of resistance, the 10K resistor is going to soak up 10 times as much of that 5V. So the LDR would only get .45V (analogRead of 92).

And if it is in a dark room, the LDR may be 40K or resistance, so the LDR will soak up 4 times as much of that 5V as the 10K resistor. So the LDR would get 4V (analogRead of 818).”

OK – seems accessible so far…

I was given a tutorial to use to code the Arduino for the photocell, but I’ve grown so accustom to my breadboard that I get lost if the description entails alligator clips and wires. I like the breadboard as it lays things out well for me to contemplate what’s happening more carefully. So I found this tutorial from Adafruit: Using a Photocell.

12

Breadboard using 2 resistors, one LDR, and one LED. Ravine crossed for the LED.

photcell

int photocellPin = 0; // the cell and 10K pulldown are connected to a0
int photocellReading; // the analog reading from the sensor divider
int LEDpin = 11; // connect Red LED to pin 11 (PWM pin)
int LEDbrightness; //
void setup(void) {
// We’ll send debugging information via the Serial monitor
Serial.begin(9600);
}

void loop(void) {
photocellReading = analogRead(photocellPin);

Serial.print(“Analog reading = “);
Serial.println(photocellReading); // the raw analog reading

// LED gets brighter the darker it is at the sensor
// that means we have to -invert- the reading from 0-1023 back to 1023-0
photocellReading = 1023 – photocellReading;
//now we have to map 0-1023 to 0-255 since thats the range analogWrite uses
LEDbrightness = map(photocellReading, 0, 1023, 0, 255);
analogWrite(LEDpin, LEDbrightness);

delay(100);
}

• Which coding concepts were introduced by coding the sensor (photocell)?

 a) ≠coding, but learning about resistors/ohms was helpful.

 b) Using variables again in a new form:
Serial.print(“Analog reading = “);
Serial.println(photocellReading);
LEDbrightness = map(photocellReading, 0, 1023, 0, 255);
analogWrite(LEDpin, LEDbrightness);

• Describe the computational thinking that you are practicing when creating/coding with the sensor (photocell):

Now that we are bringing in analog readings into the mix I’m having to keep two different levels of thinking in mind at the same time. I’m struggling with that a little now.

Coding a Switch in Arduino – Part Two

To further extend my understanding (and my disequilibrium) around coding switches I have taken a project from the book I mentioned previously, Introduction to Arduino: A piece of cake!, by Alan G. Smith, September 30, 2011, that uses two buttons, one LED, a resistor, and code that uses Pulse Width Modulation (PWM). I’ve seen the PWM before in another exercise and this project has helped reinforce the notion.

Breadboard with one LED, two switches, one resistor. +/- are wired into right column.

Breadboard with one LED, two switches, one resistor. +/- are wired into right column.

const int kPinButton1 = 2;
const int kPinButton2 = 3;
const int kPinLed = 9;

void setup() {
pinMode(kPinButton1, INPUT);
pinMode(kPinButton2, INPUT);
pinMode(kPinLed, OUTPUT);
digitalWrite(kPinButton1, HIGH);
digitalWrite(kPinButton2, HIGH);

int ledBrightness = 128;
void loop()
{
if(digitalRead(kPinButton1) == LOW){
ledBrightness–;
}
else if(digitalRead(kPinButton2) == LOW){
ledBrightness++;
}

ledBrightness = constrain(ledBrightness, 0, 255);
analogWrite(kPinLed, ledBrightness);
delay(20);
}

• Which coding concepts were introduced by coding two switches?

Just adding another switch wouldn’t have been too interesting without using PWM to differentiate between the use of the two switches. What makes this project interesting is introducing ‘– and ++’ to make the LED brighter and dimmer.

ledBrightness = constrain(ledBrightness, 0, 255); “guarantees the value of ledBrightness will be between 0 and 255 (including 0 and 255)”

analogWrite(kPinLed, ledBrightness); “uses analogWrite to tell Arduino to perform PWM on that pin with the set value.”

delay(20); “delays for 20 milliseconds so that we won’t make adjustments faster than 50 times in a second. (You can adjust this to find where you think the best response is to your pressing the buttons.) The reason we do this is that people are much slower than the Arduino. If we didn’t do this, then this program would appear that pressing the first button turns the LED off and pressing the second button turns it on.”

• Describe the computational thinking that you are practicing when creating/coding two switches:

Change of state through a variable. Taking human factors in mind when programming – without the delay the LED would look like it’s just turning off.

Coding a Switch in Arduino – Part One

My teacher has asked these two questions –

• Which coding concepts were introduced by coding a switch?

• Describe the computational thinking that you are practicing when creating/coding a switch:

I used a new (to me) book that I’m finding very handy to set up two types of switches, Introduction to Arduino: A piece of cake!, by Alan G. Smith, September 30, 2011.

The first is a simple one button switch:

Breadboard with one LED, one switch, one resistor. +/- are wired into right column.

Breadboard with one LED, one switch, one resistor. +/- are wired into right column.

const int Button1 = 2;
const int Led = 9;

void setup()
{
pinMode(Button1, INPUT);
digitalWrite(Button1, HIGH);
pinMode(Led, OUTPUT);
}

void loop()
{
if(digitalRead(Button1) == LOW){
digitalWrite(Led, HIGH);
}
else{
digitalWrite(Led, LOW);
}
}

• Which coding concepts were introduced by coding a switch?

Two things here:
1) HIGH = ‘On’ | high voltage & LOW = ‘Pressed ‘ | low voltage.
2) if/else statements

• Describe the computational thinking that you are practicing when creating/coding a switch:

I will be the first to admit that my brain isn’t ‘wired’ for the computational thinking that coding requires, it neither comes naturally or easily and it takes many iterations in different forms for me to start to take on concepts and show understanding.

It isn’t easy for me to divorce the physical thing that I see, the button being up or “HIGH” to the electronic reality of the circuit. It is when the button is down that the circuit is complete and ground is connected to pin 2. When it is not pushed down the circuit is from the +5V through the resistor and the Arduino sees the +5V. (HIGH). Again, I will need to this type of thing a few more times before it really takes hold.

I’m working on understanding if/else statements.

From the book: “An if statement can have an else clause which handles what should be done if the if statement isn’t true.”

If the button is pressed then turn on the LED. If not (else) keep the LED off.

Creation v. Consumption

I’m working with a class of middle school children locally. They’re the type of kids who for many reasons aren’t typically motivated to create. They are highly motivated to consume media and will do so whenever they have the chance, but their teacher is trying to change that dynamic. I’ve offered him the use of a MaKey MaKey, and he’s going to try to raise the funds to buy a few more. I’ll follow up on this post, but I’m already really encouraged with the reception that it received today:

All I did for them was plug it in and get the MIT Scratch Drum Machine up for them and let them do the rest. A little later, after they got the idea of a a small circuit I gave them a Serial Bus I made for another project the night before and that let more kids in on the human drum kit. I’ve encouraged the teacher to let them discover and create on their own. I’ll go back next week and see where they go. I’m also helping them to work with Zoombinis – we’re going to look at ways to move the concepts off the game and into other creative projects and transferring the skills to other areas.

Prototyping W/ Arduino

My homework for ‘Creating w/Code’ was to make a functioning prototype of some type of creation using an Arduino and writing reiterative sketches starting with one LED leading up to 3 LEDs and a Serial Bus:

Q1 What does your Code Look Like to control 1 LED?

I changed the delay to have the LED blink faster:

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a half second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(250); // wait for a quarter second
}

Q2 What does your Code Look Like to control 2 LEDs?

I alternated the two LEDs to blink opposite of each other at separate delays:

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 and 10 as outputs.
pinMode(13, OUTPUT);
pinMode(10, OUTPUT);

}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a half a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(250); // wait for a quarter second

digitalWrite(10, HIGH); // turn the LED on (HIGH is the voltage level)
delay(250); // wait for a quarter second
digitalWrite(10, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a half second
}

Q3 What does your Code Look Like to control 3 LEDs?

I added a third LED and made a serial bus for the circuit:

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 and 10 as outputs.
pinMode(13, OUTPUT);
pinMode(10, OUTPUT);
pinMode(7, OUTPUT);

}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a half a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(250); // wait for a quarter second

digitalWrite(10, HIGH); // turn the LED on (HIGH is the voltage level)
delay(250); // wait for a quarter second
digitalWrite(10, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a half second

digitalWrite(7, HIGH); // turn the LED on (HIGH is the voltage level)
delay(333); // wait for a third of a second
digitalWrite(7, LOW); // turn the LED off by making the voltage LOW
delay(333); // wait for a third of a second
}

And here it is:

And to make it functional – A Trippy Lamp:

This project was good because I could add on to the work that I did before and the reiteration helped me to retain the concepts learned along the way. In my previous post I wrote about how I understood MOST of what I was doing, but felt a little more disequilibrium than I would have preferred. Here I was able to put it all together without feeling out of my range. I love the hook of having a product for the prototype – to have a purpose for it. I was in no mood to create flowers (another project suggestion), nor did I have the materials at hand, but I do like my lamp!