a twinkling star (and a non-twinkling one too)

Hurray! I finally found time to play with Circuit Stickers!

As much as I love the cuteness of the Circuit Sticker Sketchbook, I’m pretty stingy and wanted to use the stickers for a project in my own notebook instead. So I quickly sketched out a star pattern with pencil, to have as a guide for laying down copper tape. Because I wanted to light 5 LEDs, I needed to wire them in parallel, which is why there are two separate traces on the star. The inner trace is negative and the outer trace is positive.

From there, I wanted to play with the effects stickers, so I watched some of Jie Qi’s tutorial videos. I first tried to add a Twinkle sticker and another LED sticker in the middle of the big star, but space got way too tight. (You can see the random bits of copper tape leftover from experimenting with this configuration in the video.) But since I already had a star, I thought why not add a twinkling star next to it? The wiring here was a bit trickier because I had to cross the positive rail over the negative of the original big star in order to reach the blank part of the page. So I insulated with some Scotch tape to make sure the circuit isn’t shorting. Also because of where the negative and positive terminals of the Twinkle sticker are, I ended up having to run the signal wire past the two terminals under the sticker (again, insulating with some Scotch tape to make sure wires aren’t accidentally crossing).

End result? I love Circuit Stickers! I’m not convinced that they’re scalable for large groups of students – while not super expensive, they do cost more than just buying plain LEDs and batteries (obviously, since they have to be custom-made). But I would buy sets of these as gifts for kids in a heartbeat! Speaking of which, there is a Heartbeat sticker too….!

Continue Reading

a 3D printer assembled!

One of the bigger projects I had planned for this summer is to assemble a Printrbot Simple that I had ordered from Amazon at the end of last school year. The kit had been sitting in my house for a few weeks and finally, after all the trips and traveling and conferences were over, I found the time to sit down for a few days, turn on some crappy TV show on Netflix, and tinker with the kit.

I had been thinking of getting a 3D printer for my house for a while now and I specifically wanted to buy one I had to assemble. I thought that if I can build it, I would understand a lot better how they work and this would hopefully be helpful when the one in the lab acts up. Also, during the times when we have a backlog of prints queued up at school, I would be able to help out by doing some prints at home.

I was a bit intimated when I first opened the kit because there are A LOT of parts, many of which are tiny and can be easily lost. I decided to grab a tray I had lying around and sort all the tiny nuts and bolts on it, which helped the assembly process tremendously.

IMG_1632

Once everything was sorted, I started going through the assembly instructions. I think the only major thing I did was to read through all the comments for each step by other folks before attempting it myself. The comments were really helpful to both clarify the instructions and to warn about tricky parts.

After a few days (working on it a few hours each day), I had an assembled printer!
IMG_1643

The photo above shows the printer already printing but truth be told, it took a few more troubleshooting steps before I could get it to print successfully.

  • I had problems with some of the wires getting caught on the Acme rod when the Z-axis was getting adjusted. To keep the wires out of the way, I used some tape to hold down the wires and get them out of the way as much as possible.
  • I first tested with just the metal bed and prints were just not sticking. We don’t have any blue painter’s tape in the house but we do have Frog Tape from our recent round of painting the stairs. This worked fine.
  • I had to go through the recommended leveling process a few times before I could get the extruder nozzle at an appropriate height. I had first leveled with just the metal bed and forgot to re-level after putting down the painters tape. Even though the tape isn’t all that thick, the difference was enough. I could see the extruder nozzle actually pushing into the tape and carving lines onto it. Re-leveling again fixed it.
  • There were multiple steps after installing Repetier, including using the right settings for the Printbot and updating Slic3r.

The biggest difference I can see from the user angle with Printrbot is that you have to do more things manually. For example, you have to set the extruder temperature and turn it on manually, watch the temperature curve until it reaches the proper temperature, and then start the print. Unlike the Makerbot we have in the lab, all of this isn’t automatically taken care for you. I don’t think this is a deal breaker in terms of putting Printrbots in the lab – it would just require more training before letting kids loose on them.

Continue Reading

a machine sewing class

How do I know it’s truly summer break? Because I just spent a Friday afternoon, during normal work hours, at a Sewing 101 class at Workshop!!

Because the class is during when decent folks are at jobby jobs, there were just me and another teacher as students. Our instructor Aaron was an awesomely hipster young lad who taught himself how to sew and apparently lives with roommates who also sew. It really sounds like every night is a sewing party at their house!

Once Aaron taught us how to set up the machine (I now know what a “bobbin” is), we were off to create our first project – a beer koozie using scrap pieces of fabric.

IMG_1633

He also gave us a short crash course of making simple patterns and how to account for seams. To put this to the test, we each had to make a little pouch for our phones.

Continue Reading

an interactive neuron

At CMK 2014, after I had just about run out of ideas of what else i can do with fabric speakers, I found out that my friend Aaron and his group were working on another e-textiles project and trying to figure out how to use Arduino to control a bunch of NeoPixels and lights. And they graciously allowed me to crash the party.

Their project idea was awesome – build an interactive representation of a neuron that will sense when someone is near by and “fire” action potentials accordingly. They had already done a lot of the soldering and sewing work, so it was time to jump into the Arduino coding – yay, my favorite! One tricky part of this project was that they couldn’t find enough NeoPixels to cover the whole neuron, so ended up using a combination of NeoPixels and regular LEDs. Each regular LED was connected to a PWM output pin of the Arduino (so that we can control brightness). All the NeoPixels were wired in series and connected to a single Arduino pin – I do love that you only need one pin to control a whole bunch of NeoPixels!

After much initial head-scratching and whining about the difficult of working with the NeoPixels Arduino library and the not-exactly-intuitive documentation, we finally pulled together code that works! When the ultrasonic sensor does not sense anyone (or any object really) nearby, the lights all along the neuron will twinkle and randomly fade on/off. When the sensor senses someone close by, it will trigger a “firing” pattern, starting from the axon terminal, propagating up the axon, and spreading through to the dendrites. If the person/object isn’t close enough, the firing pattern only goes partway up the axon. You can see all three cases in the video above.

And because we love sharing, here’s our Arduino code:

#include <Adafruit_NeoPixel.h>

#define PIN 6
#define NUMPIXELS 25
#define NUMNEO 20
#define ARRAYSIZE 10

#define echoPin 7 // Echo Pin
#define trigPin 8 // Trigger Pin


// records whether a pixel is currently on or off... 
// first batch is neopixels and then normal LEDs
int state[NUMPIXELS]; 

int LEDpins[5] = { 
  3, 5, 9, 10, 11}; // pin numbers for the non-neopixel LEDs

// during explosion sequence, this is the order the lights should light up in
int sequence[NUMPIXELS] = {
  0,1,2,3,20,21,22,23,24,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
int vel=100;

// array to hold light sensor readings so we can keep an average
int sensorReadings[10];
long counter = 0;

// for ultrasonic sensor 
int maximumRange = 150; // Maximum range needed
int minimumRange = 0; // Minimum range needed
long duration, distance; // Duration used to calculate distance


// create neopixel strip object
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMNEO, PIN, NEO_GRB + NEO_KHZ800);

void setup() {

  // set up the averaging array 
  counter = 0;
  for (int i=0; i< ARRAYSIZE; i++)  {
    sensorReadings[i] = 0;
  }

  strip.begin();
  clear_all();

  // set up ultrasonic pins
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  Serial.begin(9600);
}



void loop() {

  // send pulses with ultrasonic sensor to detect distance
  digitalWrite(trigPin, LOW); 
  delayMicroseconds(2); 

  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10); 

  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);

  //Calculate the distance (in cm) based on the speed of sound.
  distance = duration/58.2;
  if (distance >= maximumRange || distance <= minimumRange){
   // Serial.println("out of range == TWINKLE!!");
    twinkle();
    counter = 0;
  }
  else {
    int thisIndex =  (counter % ARRAYSIZE);
    sensorReadings[thisIndex] = distance;
    counter++;

    // now calculate the average distance object is at
    int sum = 0;
    for (int i=0; i<ARRAYSIZE; i++) {
      sum += sensorReadings[i];
    }
    float average = sum/ARRAYSIZE*1.0;
      
    if (counter > 10) { // don't do anything until we've read 10 readings
     // convert average distance to number of LEDs to light
     float y = -1.0/12*distance + 32.0/3.0;
     clear_all();
     
     if (y >= 9.0) {
      explosion(24);
     } else {
       explosion((int) y);
     }
    }
  }
}


void explosion(int stop_point){
  strip.setBrightness(120);
  for (int i = 0; i<stop_point; i++){
    int lightIndex = sequence[i];
    if(lightIndex < NUMNEO){
      if(lightIndex < 4){
        strip.setPixelColor(lightIndex,255,255,255);
      }
      else{
        int r = random(255);
        int g = random(255);
        int b = random(255);
        strip.setPixelColor(lightIndex,r,g,b);
      }
      strip.show();
      delay(vel);
    }
    else {
      digitalWrite(LEDpins[lightIndex-NUMNEO], HIGH); 
      delay(vel);
    }
  }
  delay(1000);

  for (int i = stop_point; i>=0; i--){
    int lightIndex = sequence[i];
    if(lightIndex < NUMNEO){
      strip.setPixelColor(lightIndex,0,0,0);
      strip.show();
      delay(vel);
    }
    else {
      digitalWrite(LEDpins[lightIndex-NUMNEO], LOW); 
      delay(vel);
    }
  }
}

// random twinkling effect
void twinkle(){
  int pickMe = random(NUMPIXELS);
  strip.setBrightness(200); 

  if(state[pickMe]==1) { //fadeout
    fade_down(pickMe);
    state[pickMe] = 0;

  }
  else { //fadein
    fade_up(pickMe);
    state[pickMe] = 1;
  }
}

// fade the lights in
void fade_up(uint16_t u) {
  // pick a random color for the neo-pixels
  int r = random(255);
  int g = random(255);
  int b = random(255);

  for (int k=0; k<= 100; k++) { 
    if (u < NUMNEO) {
      strip.setPixelColor(u,k*r/100,k*g/100,k*b/100);
      strip.show();
      delay(5);
    } 
    else{
      analogWrite(LEDpins[u-NUMNEO], k*50/100);  
      delay(5);  
    }
  }
}

// fade the lights out
void fade_down(uint16_t u) {
  // figure out what color a neopixel is, if it's a neopixel
  uint8_t r,g,b;
  if (u< NUMNEO) {
    uint32_t c = strip.getPixelColor(u);
    r = (uint8_t)(c >> 16),
    g = (uint8_t)(c >>  8),
    b = (uint8_t)c;
  }
  for (int k=100; k>= 0; k--){ 
    if (u < NUMNEO) {
      strip.setPixelColor(u,k*r/100,k*g/100,k*b/100);
      strip.show();
      delay(5);
    } 
    else {
      analogWrite(LEDpins[u-NUMNEO], k*50/100);  
      delay(5);  
    } 
  }
}

// turn off all the lights, neo-pixels and normal LEDs
void clear_all() {
  for(int i=0; i<NUMPIXELS; i++){ //initialize strip off
    state[i]=0;
    if (i >= NUMNEO) {
      pinMode(LEDpins[i-NUMNEO], OUTPUT);
      digitalWrite(LEDpins[i-NUMNEO], LOW);

    } 
    else{ 
      strip.setPixelColor(i,0,0,0); 
    }
  }
  strip.show(); 
}
Continue Reading

a fabric speaker

Amongst the plethora of ideas at CMK 2014, one that stuck with me was the idea of wearable speakers, as I’ve been wanting for some time now to delve deeper into soft circuits and e-textiles. Specifically, I wanted to challenge myself to build actual speakers using simple materials instead of just embedding pre-made speakers into a wearable device. Although I didn’t have anyone to work with on this specific project, I ended up getting situated at a table of other folks working on individual projects, which gave me the best of both worlds: people to chat with/bounce ideas off of, yet total creative freedom in how I want to approach the project. (Which incidentally, is giving me ideas about the benefits of allowing students to opt to work by themselves on some projects.)

The first thing I did was to consult the interwebs to see if others had done similar projects and as is usually the case, someone also had this idea.  I first found this Instructables which gave me a great overview and also led me to this page with even more ideas and examples. Although I’ve taught electromagnetism in my engineering classes before, it still never fails to delight me when I get to build something using magnets and wire that will actually work!

With some research under my belt, I was ready to start prototyping. Although I didn’t have access to the exact types of conductive threads my references used, there were conductive yarn and the other types of conductive threads at the conference, so I decided to play with those. A quick measurement with the multimeter told me that the yarn had much higher resistance, so I opted to work with the conductive thread instead.

IMG_1547

My first prototype is the orange one of the left, where I sewed conductive thread into a spiral onto a small piece of felt. When I place it over a super strong magnet (courtesy of Jaymes) and put my ear really close to it, I can just make out the sound.  But given how large the magnet had to be (you can see it at the top of the photo and how literally anything sort of magnetic just get stuck to it Katamari-style), it didn’t exactly seem reasonable for wearable applications.

For my second iteration (magenta one in the middle), I used the same general idea but patiently tried to sew a tighter spiral to see if that would increase the output enough to be audible with just a small disc magnet or two – no luck. Upon further research, I realized that the example fabric speakers I saw all went through a simple amplifier circuit, for which I don’t have the parts. That meant conductive thread might be a dead end until I get home when I can order the chip I need to build an amplifier circuit.

So for my third iteration (black version on the right), I decided to forego the conductive thread altogether and just use normal magnet wire because it has an insulating coating which allows you to coil the wire over itself many many times over, thus creating a much stronger magnetic field. (Sadly, you can’t do that to conductive thread because the whole surface of the thread is conductive.) At this point, I had also gotten tired of my testing protocol of twisting very fine wires together, so I decided to sew snaps onto my speaker (you can see them on the photo above) and solder the other sides to my deconstructed earphones to make a better testing platform. I had to take a pair of cheapo airplane headphones apart in order to get a jack to connect to my computer/iPhone.

IMG_1548

This iteration actually worked ok when paired with two little disc magnets that I duct-taped onto a stretchy piece of fabric, especially when you add a stiff piece of paper onto the whole thing as a membrane that will push the air more effectively. It’s nothing that will rock your socks off but if you hold the whole thing up to your ear or if you are in a quiet room (which is hard to find at CMK), you can actually hear the music! 🙂 And actually, if you hook this up to an amplifier (which again, Jaymes had), it will be quite booming…at least until the wire gets so hot that it melts the felt and the whole thing starts smoking! Exciting!

IMG_1552

In the photo above, you can see that I added a small resistor to the coil just to make sure the speaker will have about 10Ω of resistance – supposedly, if speakers have lower resistance than 8Ω (which is what normal pre-made speakers are), it can mess up your audio source. I don’t know if this is absolutely true but I certainly wasn’t about to risk my computer or phone to test this out!

One idea that came to me while I was working on this last version was if there’s a way to coil up conductive materials like the wire to create a bigger magnetic field, so I tried to make a version where I sandwiched a long strip of conductive fabric in between non-conductive fabric and rolled the whole thing up. Cool idea, right? TOTAL FAIL! Ah well, it was worth a try!IMG_1551

 

Continue Reading

a jittery bot

I love leaving the lab open after school on Fridays because it’s a nice relaxing time when everyone can take some out to make something before the weekend. At least, that’s the idea.

What really happens is that on most Fridays, there is decent enough attendance, especially from some of our 6th graders, that I find myself running around helping everyone instead of making something myself. BUT I am absolutely not complaining because the alternative of no one coming to Bourn Fridays would be much much sadder.

Anyway, what this means is that when there is that Friday when attendance is minimal and the only kids here are those who know the lab inside and out, I will absolutely take advantage and play around myself. Like this Friday, I got to tinker around with this little guy:

I’ve had this project pinned on our lab’s Pinterest page forever and it feels good to finally get some time to make one!

Continue Reading

a lot of soldering and a LoL shield

After much patient soldering (made worse because of OCD nature of yours truly), the LoL shield is finally up and running! These assembly instructions were superb, especially the video on how to straighten all the LEDs for maximum OCD-ness.

It doesn’t last super long on a 9V battery (unsurprisingly) but it was enough to help me advertise the Valentine Day’s edition of Bourn Fridays. On top of that, I now kind of know what “charlieplexing” means!

Continue Reading

a light-up whale

I was at FabLearn the last couple of days and one of the highlights was definitely the soft circuits workshop I took. Even though we had only a short amount of time, many of us teachers were determined to finish a stuffed animal project that would light up.

Here’s my little light-up whale:
IMG_0872

The whale was one of the standard patterns given to us and I thought that as a former electrical engineer, I would blast right through it. Ha! Yeah, right! Turns out sewing circuits is a LOT different from breadboard, which my mind is way more used to. I can’t tell you how many times I had to undo the stitches and start over.

Looking back, I really should have sat down and drawn out the circuit paths before I jumped into sewing. Once I started sewing, I kept forgetting which path was supposed to connect with which side of which component and kept getting myself confused. If I ever do soft circuits with kids, I will definitely insist they do some planning first!

Continue Reading

a little motor

Success! The little motor kit I bought from RAFT has finally been put to the test!

It zips along pretty nicely but it’s probably a bit complicated to use if we want students to really understand the essentials of how to use electromagnetic interactions to generate movement. Something a lot simpler would work a lot better to strip away any “magic” and allow us to focus on the physics. For example, something like this or this.

Continue Reading