Maker Spaces Experiments

I am currently taking a graduate course on the Makerspaces Movement and its impact on education. I will document my play with the Arduino Uno here:

Week 1:

Explanation: Our challenge was to follow the instruction booklet and create our very first circuit that would cause an LED to blink on and off.  Then, I chose to attempt to make two lights blink simultaneously. 

Code: It took me several tries to figure out how to make the lights blink simultaneously.  Turns out that I did not even have to change the code.   

Final Circuit:

Electronic Diagram:  My first try to make two LEDs blink simultaneously did not work at all.  Here is my electronic sketch of the circuit that did not work. However, I realized as I was drawing the sketch that it would not function because the two LEDs were not even on the same circuit.  I could get one to blink, or the other to blink, but not both.



Eureka! Here's the electronic diagram that worked. I'm not sure if my sketch is in the proper format, but both LEDs did light up.



Video:  I created a brief YouTube playlist with video from the very first time I was able to get the LED working, video of me changing the values in the program from 1000 to 2000 to 3000, and video of both LEDs blinking simultaneously.  I also explain my thoughts working through my additional challenge with the two blinking LEDs.

Final Reflections: If I could continue iterating, I would attempt to make the circuit that I initially made in the first electronic diagram work.  I feel like I was close to success with that route, but I discovered a simpler route beforehand.  I also learned the value of the engineering design notebook and great notes.  The solution did not occur to me until I saw the circuit drawn out.  LEDs are in nearly every piece of electronics.  Additional, LED light bulbs are swiftly replacing the incandescent light bulb because of the long life of LED bulbs and the energy efficiency.


Week 2:

Explanation:  Our challenge this week was to make a circuit that included a potentiometer to dim and brighten an LED.
The small blue knob is the potentiometer.
 

Code:  

Final Circuit:



Electronic Diagram: 


Video: Here is the link to my YouTube Playlist for this week's adventures.  I incorrectly wired my circuit initially, but I discovered that I didn't push one of my wires into the Arduino far enough.  Next, I show my working circuit and finally, the results of Circuit Play #1 and #2.  For Circuit Play #3, we were to substitute all of the "digitalWrite" mentions in the program for "analogWrite".  I got the error represented in the picture below.

Final Reflections:  Creating a circuit this time made a lot more sense than the first attempt, mostly because I had more background knowledge.  Dr. Bigenho uploaded this very helpful video which clearly explained some of the details of the functionality of the Arduino.  I learned what a ground wire is, which is cathode(-) and anode (+) and how digital ports compare to analog ports.  I also learned that potentiometer are in everyday items, such as the volume knob on a radio.



Week 3:

Explanation:  Our basic challenge this week was to make to different circuits--once that made an RGB light change colors and one that makes eight LEDs light up down the row similar to a marquee.

My functional RGB set up.
My functional eight LED set up.
Code:  I used the standard downloadable code for Circuit #3:  the RGB set up and for Circuit #4:  The 8 LED set up.  They functioned properly the first time.


First set of errors.  I learned that the Arduino program cannot read two of the same commands.

Second set of errors after I deleted voidsetup() and voidloop() from the second program.
Then, I attempted to merge the two sketches in the Arduino program and was met with a series of errors.  During the process, I felt like my circuit was wired correctly (Final Circuit below), but I know there are just details that I am missing in the program.  I still do not fully understand all of the intricacies of the program, so I found this resource:  



I was able to successfully do step one, getting the two sketches into one file, but I kept getting snagged on step 2, resolve duplicate functions.  The site explained really well that I got the first error because I had two commands that were named the same thing.  It then recommended that I rename them, somehow excluding the "void" statement.  When I attempted that, I got the following error: 

Next, I am going to try copying and pasting small amounts of code at a time per the recommendations of this site and this video.
  
Final Circuit:
My final circuit, (unsuccessfully) attempting to have seven LEDs light up followed by the RGB light.  

Electronic Diagrams:




Video: Here is the link to my YouTube Playlist for this week's assignments. 

Final Reflections:  I pushed myself a bit into uncomfortable territory, but I learned much through my struggles. My circuit still doesn't work, but I learned how to decipher the error text.  I learned that the number after the initial text in the error is the actual line of code where the error is occuring.  I learned that there are many resources out their to help with the Arduino, but many of them require background knowledge that I'm still gaining.  I will embark on a self-study this week to help prepare for next week's challenge.



Week 4:

Explanation:  Our basic challenge this week was to make a working die using our Arduino, code, LEDs, a button, wires and breadboard. When the button is depressed, the LEDs should light up randomly in the same formations as presented on a die.


My final LED Dice Circuit.

Code:  I followed this model from Instructables for this Arduino Project. 


//Easy Arduino Dice - Code
//.A.

const int ONE = 13; 
const int TWO = 12;
const int THREE = 11;
const int FOUR = 10;
const int FIVE = 9;
const int SIX = 8;
const int SEVEN = 7;
const int BUTTON = 4;
const int INDI = 2;//indicator light
/* this sets all of the terms to number values */

int val = 0; //integer value set to 0

int state = 0; //state set to 0, aka off

long randNumber; //this is needed for the random number gen

void setup(){
  pinMode(ONE, OUTPUT);
  pinMode(TWO, OUTPUT);
  pinMode(THREE, OUTPUT);
  pinMode(FOUR, OUTPUT);
  pinMode(FIVE, OUTPUT);
  pinMode(SIX, OUTPUT);
  pinMode(SEVEN, OUTPUT);
  pinMode(BUTTON, INPUT);
  pinMode(INDI, OUTPUT);
  Serial.begin(9600);
  randomSeed(analogRead(0));
}
/* this sets all of the pins to input
or output, and keeps them that way */

 void loop(){
   val = digitalRead(BUTTON); //value set to button state
   
   if (val == HIGH){
     digitalWrite(INDI, HIGH); //red light on
     delay(100);               //0.1 sec delay
     randNumber = random(1, 7);//creates a random number 
     delay(100);               //0.1 sec delay
     Serial.println(randNumber);//prints the number to serial monitor
     delay(100);               //0.1 sec delay
     digitalWrite(INDI, LOW);  //red light off
     
     
     if (randNumber == 6){ //if it lands on 6
       digitalWrite(ONE, HIGH);
       digitalWrite(TWO, HIGH);
       digitalWrite(THREE, HIGH);
       digitalWrite(FIVE, HIGH);
       digitalWrite(SIX, HIGH);
       digitalWrite(SEVEN, HIGH);
       delay(2000);
       digitalWrite(ONE, LOW);
       digitalWrite(TWO, LOW);
       digitalWrite(THREE, LOW);
       digitalWrite(FIVE, LOW);
       digitalWrite(SIX, LOW);
       digitalWrite(SEVEN, LOW);
     }
     if (randNumber == 5){ //lands on 5
       digitalWrite(ONE, HIGH);
       digitalWrite(THREE, HIGH);
       digitalWrite(FOUR, HIGH);
       digitalWrite(FIVE, HIGH);
       digitalWrite(SEVEN, HIGH);
       delay(2000);
       digitalWrite(ONE, LOW);
       digitalWrite(THREE, LOW);
       digitalWrite(FOUR, LOW);
       digitalWrite(FIVE, LOW);
       digitalWrite(SEVEN, LOW);
     }
     if (randNumber == 4){ //lands on 4
       digitalWrite(ONE, HIGH);
       digitalWrite(THREE, HIGH);
       digitalWrite(FIVE, HIGH);
       digitalWrite(SEVEN, HIGH);
       delay(2000);
       digitalWrite(ONE, LOW);
       digitalWrite(THREE, LOW);
       digitalWrite(FIVE, LOW);
       digitalWrite(SEVEN, LOW);
     }
     if (randNumber == 3){ //lands on 3
       digitalWrite(ONE, HIGH);
       digitalWrite(FOUR, HIGH);
       digitalWrite(SEVEN, HIGH);
       delay(2000);
       digitalWrite(ONE, LOW);
       digitalWrite(FOUR, LOW);
       digitalWrite(SEVEN, LOW);
     }
     if (randNumber == 2){ //lands on 2
       digitalWrite(ONE, HIGH);
       digitalWrite(SEVEN, HIGH);
       delay(2000);
       digitalWrite(ONE, LOW);
       digitalWrite(SEVEN, LOW);
     }
     if (randNumber == 1){//lands on 1
       digitalWrite(FOUR, HIGH);
       delay(2000);
       digitalWrite(FOUR, LOW);
     }
   } //closes all loops
 }

       
Electronic Diagrams:

This is the first time I attempted to draw the diagram on my own.  Hoping to get some input on any corrections I need to make.  This is also the first time I've use the 10K ohm resistor instead of lots of 330 ohm resistors.


Video:  Here is the link to my YouTube video playlist explaining my adventures this week building and programing the LED die.

Data:  Part of our challenge was to create a spreadsheet displaying the data we received from clicking our button 100 times.  The goal was to see if our program was truly random or not.  As I mentioned in the videos about randomization, I had to run the experiment a second time since I discovered my circuit was not properly wired.  Here is the data from both sets of trials.

Final Reflections:  I went into this week totally freaked out about this challenge.  I was nervous about even attempting to create something new using information that is so new to me.  I noticed that I have way more trepidation when attempting these challenges than I do with other classes.  I think it is my personal fear of failure and my steadfast adherence to always attempting to be perfect.  This class is making me confront those fears in order to learn.  I feel like I get a little more successful at conquering my fear with each challenge we have.  My goal for next week is to try BEFORE I look for resources online.

Additionally, this is exactly what I ask my students to do with every engineering challenge I give them.  Yet they dive in with reckless abandon.  I bet it's because they trust that I will help them and because they believe in themselves.  I'm struggling with the latter part, but it's getting better. Thank the Lord this one actually worked!:)


Possible Extensions:  If I had time to continue iterating, I wonder if I could make something similar to Jumping Jackpot from Dave & Busters and Main Event.  You stand on a weight-sensitive pad and when the LED lights circle towards you, you're supposed to "jump over them" as many times as possible.  If not this game, I wonder what other types of games could I make?


Week 5:

Explanation:  Our challenge this week was to choose any project we liked as long as we learned something new and pressed ourselves beyond our current knowledge.  I chose to attempt to make the servo work by depressing a button. I have previously used the button for last week's challenge creating the electronic dice, but had never worked with the servo before.  I also had never successfully merged two sets of code, so this all posed quite the challenge for me.


Functional servo circuit without the button.
Final circuit with the servo functioning when the button is pressed.



Code:  Originally, I tried to merge two sketches from the Vilros Ultimate Starter Kit Guide--the one for running the servo (Circuit 8 in the book) and the one for using buttons (Circuit 5 in the book).  I just continually got error codes that I could not decipher.  Here's a video of my attempt to talk through my code issues and my hardware questions.   

So, when all else failed, I literally Googled "Arduino circuit with servo and button" and I found this post on the Arduino forum.  The entry from the user Zoomkat was super easy-to-follow.  Here is the code I copied from his entry in the forum: 

//zoomkat servo button test 7-30-2011

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
}

void loop()
{
  press1 = digitalRead(button1);
  if (press1 == LOW)
  {
    servo1.write(160);
  }
  else {
    servo1.write(20);
  }
}
  
       
Using Zoomkat's very helpful notes from the program, above, I realized that the button requires its own power source, so I plugged it in to the 3.3V on the Uno. Additionally, I knew that the numbers identified in the program had to match the way I had the circuit wired on my Uno.  I made a few changes, and the servo worked using the button.  Here's the video of my final functional circuit.

Electronic Diagrams:

Diagram of the servo functioning without the button.

Diagram of final functional circuit with the servo and button.
Videos:
Here is a link to the YouTube video playlist chronicling my adventures this week.

Final Reflections:
This week, I learned how important good notes are in a code.  I was finally successful using someone else's code, but I would not have been able to get my circuit to function if the code didn't clearly tell me how my circuit should be wired.  I also learned how to persist even when it looks hopeless and to always turn to Google when in doubt, especially for these challenges.  The Arduino community is very helpful and thorough in their explanations.

With all I've learned, I still don't know how to successfully merge two sets of code.  Maybe I'll figure that out during weeks six and seven.

Possible Extensions:
As I was trying to find some help with using the servo, I found numerous sites that focus on creating animatronics using Arduino.  I would love to work with my students to do something cool like these animatronic eyes created by Instructables user LGProspects.



Week 6:

Explanation:  This week, Dr. Bigenho challenged us to use the "secret sauce"--a servo or a motor, to create any circuit we wanted.  I chose to attempt to control the servo with light using the photo resistor.
My final functional circuit

Code: Here's a brief video that explains my thought process for how to approach the hardware and programming for this circuit.  I thought that I had the wiring correct, but I got several error messages after I modified the code for Circuit's 6 and 8 from the Vilros Ultimate Starter Kit Guide website.

After many failed attempts, I found these instructions by quaddel on Instructables.  I felt pretty secure in my wiring, so I just changed the Pin for the servo to match the program and uploaded the program to my Arduino.  Sure enough, it worked immediately. 

#include <Servo.h>

Servo myservo;
int val;

void setup()
{
myservo.attach(12);
}
void loop()
{
val = analogRead(0);
val = map(val, 0, 1023, 0, 179);
myservo.write(val);
delay(15);


Electronic Diagram: (from the instructions by quaddel)

Video:  Here is my video of my functional circuit with the photo resistor controlling the servo.

Final Reflections:  Initially, I was sad that I yet to be able to merge two program since that seems to be a crucial skill in programming.  However, what I did take away was that the resources are out there for me to still be able to accomplish my goal until I develop the know-how required to understand programming enough to make changes to it.  

Possible Extension:  I found this cool insect robot created with servos while searching for resources to help with this week's build.  Surprising, I would love to try to build it.  





No comments:

Post a Comment