Lee Hewes

is totes becoming a teacher…

My Giant, Arduino and Aurasma Enhanced Classroom Creeper!

1 Comment

So some time last year, as I was walking past a games store at a local shopping centre, I noticed a giant cardboard creeper placed in front of their reduced-price console games table. Inspired, and perhaps a little on the lazy side, I decided to walk in and ask if they would consider donating it to my classroom once they were finished.

I was somewhat surprised when the person I spoke to at the counter said, “Yeah, we’ve had a quite a few people ask about him, some guy has offered to pay us $50. Leave your name and number on this piece of paper and we’ll get back to you if and when he’s for sale.” <- Please note that these definitely were not the actual words he used but they were something along those lines, and you should get the gist.

I also put a photo of the creeper on Instagram, stating that I thought my year one class could probably make a better one, to which a colleague replied, “With their eyes closed!” Anyway, this was enough to get me started on making my own giant creeper.

To cut a long story short, it took way longer than expected, was really messy, at times complicated, and ended up involving more than the just the students in my class. You can see a whole bunch of photos of the creeper building process below; super fun!

 

 

Thorax…

A post shared by waginski (@waginski) on

 

Oh nothing, really. Just your stock-standard, boss level, creeper building shiz.

A post shared by waginski (@waginski) on

 

The epic of #AurasmaCreeper

A post shared by waginski (@waginski) on

 

Class visitor… #AurasmaCreeper

A post shared by waginski (@waginski) on

 

sss

A post shared by waginski (@waginski) on

 

We made a start on da chest and guts.

A post shared by waginski (@waginski) on

 

 

El complete. El comprende?

A post shared by waginski (@waginski) on

 

 

He’s done now, and I do reckon he’s heaps better than the one at the store, and as spawned out of the original plan, I’ve created some Aurasma triggers using screenshots of student work so that classroom visitors can use their devices to see some of the awesome stuff that students do in my class. Here is a shot of some principals using Aurasma to check out 1L’s work!

Finally, some randoms checking out #AurasmaCreeper. #MinecraftEdu Yeyeyeyeye!

A post shared by waginski (@waginski) on

Yay.

I decided to keep going with it, and programmed an Arduino Uno Board with an attached Adafruit MP3 Shield, PIR sensor and 5V speaker to make the creeper ‘Hiss, boom!’ whenever somebody moves! I had to teach myself how to solder and all that type of stuff, but it was totally worth it, because I now have an interactive creeper in my classroom!

 

 

 

Creeper go boom. Now just gotta put it all inside his head.

A post shared by waginski (@waginski) on

 

#GiantCreeper brain assembly kit.

A post shared by waginski (@waginski) on

 

Eep…

A post shared by waginski (@waginski) on

 

Eek.

A post shared by waginski (@waginski) on

 

Aaagh!

A post shared by waginski (@waginski) on

 

A post shared by waginski (@waginski) on

 

Good Friday #giantCreeper brain cavity access door building.

A post shared by waginski (@waginski) on

 

Done.

A post shared by waginski (@waginski) on

As you can see, it’s taken a long time, but he’s totally awesome! This term, I’m gonna start building a zombie with my year 4 class. The plan is to eventually have a whole bunch of mobs scattered around my room, all programmed to make their own individual noises whenever anybody moves, with Aurasma triggers of student Minecraft work stuck on all of their bodies. I envisage a visit to my classroom as being akin to stepping into a museum like the Powerhouse … in time!

I’m also starting an afternoon coding club this term, so hopefully #GiantCreeper will serve as inspiration for some of my students to learn more about coding and how to apply it in a fun and hands on way!

I just looked through the photos one last time, and realised this project has taken me about 9 months. When I started it, I thought it would only take a couple of weeks! To be fair, I didn’t originally plan all of the Aurasma and Arduino stuff, but hey, it happened.

If you’re interested in making your own, you can use the Arduino code pasted below (modified from this awesome Christmas wreath project) to program your own Arduino Minecraft mob. When motion is detected, it picks a track at random, most of which are the creeper “Hiss, boom!”, although there is an ‘Easter egg’ in there, a five second snippet of the Creeper Revenge song by Captainsparklez, which plays every once in a while and totally excites the 4H Creepers!

Happy makering!!!

 

 

/***************************************************
This is an example for the Adafruit VS1053 Codec Breakout

Designed specifically to work with the Adafruit VS1053 Codec Breakout
—-> https://www.adafruit.com/products/1381

Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include <MemoryFree.h>
// include SPI, MP3 and SD libraries
#include <SPI.h>
#include <Adafruit_VS1053.h>
#include <SD.h>

// These are the pins used for the breakout example
#define BREAKOUT_RESET 9 // VS1053 reset pin (output)
#define BREAKOUT_CS 10 // VS1053 chip select pin (output)
#define BREAKOUT_DCS 8 // VS1053 Data/command select pin (output)
// These are the pins used for the music maker shield
#define SHIELD_RESET -1 // VS1053 reset pin (unused!)
#define SHIELD_CS 7 // VS1053 chip select pin (output)
#define SHIELD_DCS 6 // VS1053 Data/command select pin (output)

// These are common pins between breakout and shield
#define CARDCS 4 // Card chip select pin
// DREQ should be an Int pin, see http://arduino.cc/en/Reference/attachInterrupt
#define DREQ 3 // VS1053 Data request, ideally an Interrupt pin

Adafruit_VS1053_FilePlayer musicPlayer =
// create breakout-example object!
//Adafruit_VS1053_FilePlayer(BREAKOUT_RESET, BREAKOUT_CS, BREAKOUT_DCS, DREQ, CARDCS);
// create shield-example object!
Adafruit_VS1053_FilePlayer(SHIELD_RESET, SHIELD_CS, SHIELD_DCS, DREQ, CARDCS);

/*
* PIR sensor tester
*/

int ledPin = 13; // choose the pin for the LED
int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
unsigned long detectTime; //the time we started the app, compared ot millis
unsigned long resetTime;

//this array is initialized once, randomly selected in the loop
//Instead of using a random load of MP3s from the file system, I ran into problems after looping through the filesystem about 10 times the board would lock up
//I believe there was a problem opening the file system over and over again to query for random files
//secondly, I have files on the system that I dont want to play
char* myFiles[]={“track001.mp3”, “track002.mp3”, “track003.mp3”,
“track004.mp3”, “track005.mp3″,”track006.mp3″,”track007.mp3″,”track008.mp3″,”track009.mp3”,
“track010.mp3″,”track011.mp3″,”track012.mp3″,”track013.mp3″,”track014.mp3”,
“track015.mp3″,”track016.mp3″,”track017.mp3″,”track018.mp3″,”track019.mp3”,
“track020.mp3”};

int randFile; //random number variable
char MP3; //variable for MP3 filename

//VARS
//the time we give the sensor to calibrate (10-60 secs according to the datasheet)
int calibrationTime = 15;

void setup() {

Serial.begin(9600);
delay(50);
Serial.println(“Adafruit VS1053 Library Test”);

resetTime = millis(); //set reset time to millis and start counting

// initialise the music player
if (! musicPlayer.begin()) { // initialise the music player
Serial.println(F(“Couldn’t find VS1053, do you have the right pins defined?”));
while (1);
}
Serial.println(F(“VS1053 found”));
//musicPlayer.sineTest(0x44, 500); // Make a tone to indicate VS1053 is working at startup

pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare sensor as input

//give the sensor some time to calibrate
Serial.print(“calibrating sensor “);
for(int i = 0; i < calibrationTime; i++){
Serial.print(“.”);
delay(1000);
}
Serial.println(” done”);
Serial.println(“SENSOR ACTIVE”);
delay(50);

if (!SD.begin(CARDCS)) {
Serial.println(F(“SD failed, or not present”));
while (1); // don’t do anything more
}
//Serial.println(“SD OK!”);

// list files
printDirectory(SD.open(“/”), 0);

//show the array of mp3 files
int mp3ArrSize = 20; //get the array size
Serial.println(“——————“);
Serial.print(“MP3 Array Size: “);
Serial.println(mp3ArrSize);
for (int arrelement = 0; arrelement < mp3ArrSize; arrelement++) {
// turn the pin on:
Serial.println(myFiles[arrelement]);
}

// Set volume for left, right channels. lower numbers == louder volume!
musicPlayer.setVolume(0,0);
/***** Two interrupt options! *******/
// This option uses timer0, this means timer1 & t2 are not required
// (so you can use ’em for Servos, etc) BUT millis() can lose time
// since we’re hitchhiking on top of the millis() tracker
//musicPlayer.useInterrupt(VS1053_FILEPLAYER_TIMER0_INT);

// This option uses a pin interrupt. No timers required! But DREQ
// must be on an interrupt pin. For Uno/Duemilanove/Diecimilla
// that’s Digital #2 or #3
// See http://arduino.cc/en/Reference/attachInterrupt for other pins
// *** This method is preferred
if (! musicPlayer.useInterrupt(VS1053_FILEPLAYER_PIN_INT))
Serial.println(F(“DREQ pin is not an interrupt pin”));

}

void loop(){
val = digitalRead(inputPin); // read input value
Serial.println(val);

randFile = random(20); //set random number value anything between 1 and 20 so we can select from our array of MP3s

//select the MP3 from our array of MP3s using the random number just generated
char* MP3 = myFiles[randFile]; //select one of the filenames from the array

Serial.println(MP3); //show us which MP3 we selected

if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin, HIGH); // turn LED ON
delay(500);
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, HIGH);
delay(500);
// we have just turned on
Serial.println(“Motion detected!”);
detectTime = millis();

if (!musicPlayer.playingMusic==true){
if (! musicPlayer.playFullFile(“track002.mp3”)) {
Serial.print(“Could not open”);
Serial.println(“track002.mp3”);
musicPlayer.softReset();
while (1);
}
delay(1000);
if (! musicPlayer.startPlayingFile(MP3)) {
Serial.print(“Could not open”);
Serial.println(MP3);
while (1);
}
Serial.print(“Start Playing “);
Serial.println(MP3);

}

}

//if its been more than 15 seconds since no movement checks about once each second, stop playing
if ( (millis() – detectTime) >= 15000){
Serial.println(“No motion for 15 seconds”);

musicPlayer.stopPlaying();
musicPlayer.softReset();
delay(200);
digitalWrite(ledPin,LOW);
val = 0; // we start, assuming no motion detected
detectTime = 0;
}
Serial.print(“******* freeMemory()=”);
Serial.println(freeMemory());

//the following is used to reset the board every 30 minutes in case it got into a funky loop
//I don’t think it was useful but left it in
if ( (millis() – resetTime) >= 1800000){

void(* resetFunc)(void)=0; //declare reset function at address 0
if (!musicPlayer.playingMusic==true){
musicPlayer.stopPlaying();
delay(250);
}
musicPlayer.softReset();
delay(500);
resetFunc(); //call reset
}

delay(1000);
}

/// File listing helper
void printDirectory(File dir, int numTabs) {
while(true) {

File entry = dir.openNextFile();
if (! entry) {
// no more files
//Serial.println(“**nomorefiles**”);
break;
}
for (uint8_t i=0; i<numTabs; i++) {
Serial.print(‘\t’);
}
Serial.print(entry.name());
if (entry.isDirectory()) {
Serial.println(“/”);
printDirectory(entry, numTabs+1);
} else {
// files have sizes, directories do not
Serial.print(“\t\t”);
Serial.println(entry.size(), DEC);
}
entry.close();
}
}

Advertisements

One thought on “My Giant, Arduino and Aurasma Enhanced Classroom Creeper!

  1. Pingback: The Creepers in 4H | Progressive Educators Network

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s