Updates from March, 2012 Toggle Comment Threads | Keyboard Shortcuts

  • Yury Gitman 10:27 pm on March 29, 2012 Permalink | Reply  

    RGB PulseSensor TryMe Code, for BPM 70 / 70-84 / 85 

    //—————————————————
    //—————————————————
    // Output
    int redPin = 3; // Red LED, connected to digital pin 9
    int greenPin = 5; // Green LED, connected to digital pin 10
    int bluePin = 6; // Blue LED, connected to digital pin 11

    // Program variables
    int redVal = 1; // Variables to store the values to send to the pins
    int greenVal = 1; // Initial values are Red full, Green and Blue off
    int blueVal = 1;

    int i = 0; // Loop counter
    int j =0 ;
    int jOld = 0;
    int wait = 50; // 50ms (.05 second) delay; shorten for faster fades
    int DEBUG = 0; // DEBUG counter; if set to 1, will write values back via serial

     

    //—————————————————
    //—————————————————

    long Hxv[4]; // these arrays are used in the digital filter
    long Hyv[4]; // H for highpass, L for lowpass
    long Lxv[4];
    long Lyv[4];

    unsigned long readings; // used to help normalize the signal
    unsigned long peakTime; // used to time the start of the heart pulse
    unsigned long lastPeakTime = 0;// used to find the time between beats
    volatile int Peak; // used to locate the highest point in positive phase of heart beat waveform
    int rate; // used to help determine pulse rate
    volatile int BPM;

    // used to hold the pulse rate
    int offset = 0; // used to normalize the raw data
    int sampleCounter; // used to determine pulse timing
    int beatCounter = 1; // used to keep track of pulses
    volatile int Signal; // holds the incoming raw data
    int NSignal; // holds the normalized signal
    volatile int FSignal; // holds result of the bandpass filter
    volatile int HRV; // holds the time between beats
    volatile int Scale = 13; // used to scale the result of the digital filter. range 12<>20 : high<>low amplification
    volatile int Fade = 0;

    boolean first = true; // reminds us to seed the filter on the first go
    volatile boolean Pulse = false; // becomes true when there is a heart pulse
    volatile boolean B = false; // becomes true when there is a heart pulse
    volatile boolean QS = false; // becomes true when pulse rate is determined. every 20 pulses

    int pulsePin = 0; // pulse sensor purple wire connected to analog pin 0

    void setup(){
    pinMode(13,OUTPUT); // pin 13 will blink to your heartbeat!
    Serial.begin(115200); // we agree to talk fast!
    // this next bit will wind up in the library. it initializes Timer1 to throw an interrupt every 1mS.
    TCCR1A = 0x00; // DISABLE OUTPUTS AND BREAK PWM ON DIGITAL PINS 9 & 10
    TCCR1B = 0x11; // GO INTO ‘PHASE AND FREQUENCY CORRECT’ MODE, NO PRESCALER
    TCCR1C = 0x00; // DON’T FORCE COMPARE
    TIMSK1 = 0x01; // ENABLE OVERFLOW INTERRUPT (TOIE1)
    ICR1 = 8000; // TRIGGER TIMER INTERRUPT EVERY 1mS
    sei(); // MAKE SURE GLOBAL INTERRUPTS ARE ENABLED

    pinMode(redPin, OUTPUT); // sets the pins as output
    pinMode(greenPin, OUTPUT);
    pinMode(bluePin, OUTPUT);

    }

     

    void loop(){
    Serial.print(“S”); // S tells processing that the following string is sensor data
    Serial.println(Signal);
    Serial.print(” BPM: “);
    Serial.println(BPM);
    if (B == true){ // B is true when arduino finds the heart beat
    Serial.print(“B”); // ‘B’ tells Processing the following string is HRV data (time between beats in mS)
    Serial.println(HRV); // HRV holds the time between this pulse and the last pulse in mS
    B = false; // reseting the QS for next time
    }
    if (QS == true){ // QS is true when arduino derives the heart rate by averaging HRV over 20 beats
    Serial.print(“Q”); // ‘QS’ tells Processing that the following string is heart rate data
    Serial.println(BPM); // BPM holds the heart rate in beats per minute
    QS = false; // reset the B for next time
    }
    // Fade -= 15;
    // Fade = constrain(Fade,0,255);
    // analogWrite(11,Fade);

    //—————————————————
    //—————————————————

    i = BPM;

    // i = (j+jOld)/2;

    // Serial.println(“j”);
    // Serial.println(j);
    // Serial.println(“jOld”);
    // Serial.println(jOld);
    //
    // Serial.println(“i”);
    // Serial.println(i);

    if (i < 70) // First phase of fades
    {

    analogWrite (redPin, 0);
    analogWrite (greenPin, 0);
    analogWrite (bluePin, 255);

    }
    else if (i > 70 && i <= 85) // Second phase of fades
    {

    analogWrite (redPin, 0);
    analogWrite (greenPin, 255);
    analogWrite (bluePin, 0);
    }
    else if (i > 85 ) // Third phase of fades
    {
    analogWrite (redPin, 255);
    analogWrite (greenPin,0 );
    analogWrite (bluePin, 0);
    }
    else // Re-set the counter, and start the fades again
    {
    jOld = j;

    Serial.println(j);
    Serial.println(jOld);
    Serial.println(i);

    }

    // analogWrite(redPin, redVal); // Write current values to LED pins
    // analogWrite(greenPin, greenVal);
    // analogWrite(bluePin, blueVal);

    //—————————————————
    //—————————————————

     

    delay(20); // take a break

    }

    // THIS IS THE TIMER 1 INTERRUPT SERVICE ROUTINE. IT WILL BE PUT INTO THE LIBRARY
    ISR(TIMER1_OVF_vect){ // triggered every time Timer 1 overflows
    // Timer 1 makes sure that we take a reading every milisecond
    Signal = analogRead(pulsePin);

    // First normailize the waveform around 0
    readings += Signal; // take a running total
    sampleCounter++; // we do this every milisecond. this timer is used as a clock
    if ((sampleCounter %300) == 0){ // adjust as needed
    offset = readings / 300; // average the running total
    readings = 0; // reset running total
    }
    NSignal = Signal – offset; // normalizing here

    // IF IT’S THE FIRST TIME THROUGH THE SKETCH, SEED THE FILTER WITH CURRENT DATA
    if (first = true){
    for (int i=0; i<4; i++){
    Lxv[i] = Lyv[i] = NSignal <<10; // seed the lowpass filter
    Hxv[i] = Hyv[i] = NSignal <<10; // seed the highpass filter
    }
    first = false; // only seed once please
    }
    // THIS IS THE BANDPAS FILTER. GENERATED AT www-users.cs.york.ac.uk/~fisher/mkfilter/trad.html
    // BUTTERWORTH LOWPASS ORDER = 3; SAMPLERATE = 1mS; CORNER = 5Hz
    Lxv[0] = Lxv[1];
    Lxv[1] = Lxv[2];
    Lxv[2] = Lxv[3];
    Lxv[3] = NSignal<<10; // insert the normalized data into the lowpass filter
    Lyv[0] = Lyv[1];
    Lyv[1] = Lyv[2];
    Lyv[2] = Lyv[3];
    Lyv[3] = (Lxv[0] + Lxv[3]) + 3 * (Lxv[1] + Lxv[2])
    + (3846 * Lyv[0]) + (-11781 * Lyv[1]) + (12031 * Lyv[2]);
    // Butterworth; Highpass; Order = 3; Sample Rate = 1mS; Corner = .8Hz
    Hxv[0] = Hxv[1];
    Hxv[1] = Hxv[2];
    Hxv[2] = Hxv[3];
    Hxv[3] = Lyv[3] / 4116; // insert lowpass result into highpass filter
    Hyv[0] = Hyv[1];
    Hyv[1] = Hyv[2];
    Hyv[2] = Hyv[3];
    Hyv[3] = (Hxv[3]-Hxv[0]) + 3 * (Hxv[1] – Hxv[2])
    + (8110 * Hyv[0]) + (-12206 * Hyv[1]) + (12031 * Hyv[2]);
    FSignal = Hyv[3] >> Scale; // result of highpass shift-scaled

    //PLAY AROUND WITH THE SHIFT VALUE TO SCALE THE OUTPUT ~12 <> ~20 = High <> Low Amplification.

    if (FSignal >= Peak && Pulse == false){ // heart beat causes ADC readings to surge down in value.
    Peak = FSignal; // finding the moment when the downward pulse starts
    peakTime = sampleCounter; // recodrd the time to derive HRV.
    }
    // NOW IT’S TIME TO LOOK FOR THE HEART BEAT
    if ((sampleCounter %20) == 0){// only look for the beat every 20mS. This clears out alot of high frequency noise.
    if (FSignal < 0 && Pulse == false){ // signal surges down in value every time there is a pulse
    Pulse = true; // Pulse will stay true as long as pulse signal < 0
    digitalWrite(13,HIGH); // pin 13 will stay high as long as pulse signal < 0
    Fade = 255; // set the fade value to highest for fading LED on pin 11 (optional)
    HRV = peakTime – lastPeakTime; // measure time between beats
    lastPeakTime = peakTime; // keep track of time for next pulse
    B = true; // set the Quantified Self flag when HRV gets updated. NOT cleared inside this ISR
    rate += HRV; // add to the running total of HRV used to determine heart rate
    beatCounter++; // beatCounter times when to calculate bpm by averaging the beat time values
    if (beatCounter == 7){ // derive heart rate every 10 beats. adjust as needed
    rate /= beatCounter; // averaging time between beats
    BPM = 60000/rate; // how many beats can fit into a minute?
    beatCounter = 0; // reset counter
    rate = 0; // reset running total
    QS = true; // set Beat flag when BPM gets updated. NOT cleared inside this ISR
    }
    }
    if (FSignal > 0 && Pulse == true){ // when the values are going up, it’s the time between beats
    digitalWrite(13,LOW); // so turn off the pin 13 LED
    Pulse = false; // reset these variables so we can do it again!
    Peak = 0; //
    }
    }

    }// end isr

     

     

     

     
  • Yury Gitman 9:29 pm on March 27, 2012 Permalink | Reply  

    Making Toys Final, 1st Protos 

    Make 10 from below. Number each, present in class.

    3 Look and Feel Prototypes

    3 Role Prototypes

    3 Implementation Prototypes

    3 Examples of Prior Art

     
  • lizastark 7:47 pm on March 27, 2012 Permalink | Reply  

    Final Project Concepts || Caitlin+Liza 

    Descriptions coming soon!

     
  • theliztaylor 6:29 pm on March 27, 2012 Permalink | Reply  

    Final Project Concepts-Liz Taylor 

    My concepts are all fairly similar, I basically know that I want to work with a group of small objects that are networked together and communicating.

    Idea 1: Small animal shaped objects/lamps or small geodescic objects/lamps that communicate to each other.  Each object has it’s own individual color when it is the only object in a zone. The closer they are to each other, the more they try to assume the same color.  I’m not sure what would determine the hierarchy of what final color they assume, unless it is that they’re always trying to mix between the colors. (aka a red object and a blue object would always turn purple)
    Loose precedent: Suwappu: http://www.dentsulondon.com/blog/2011/04/05/introducing-suwappu/

    Idea 2: Little objects made out of cardboard that have small motors/wheels that they can move around with.  They communicate and are always trying to find each other.  Once they find each other, they stop moving.
    Precedents: Tween Bots: http://www.moma.org/interactives/exhibitions/2011/talktome/objects/146369/
    Cardboard Radio: http://www.betterlivingthroughdesign.com/accessories/cardboard-radio.html

    Idea 3: Small sound objects (with some light) that serve as speakers that can communicate.  They’re running on max, and work together to build off each other’s sounds.  Possibly made out of clay or ceramics?
    Precedents:
    Ohm: http://noisedesign.blogspot.com/2008/07/ohm-lo-fi-cardboard-sampler.html
    Cardboard Radio: http://www.betterlivingthroughdesign.com/accessories/cardboard-radio.htmlCeramic Speakers: http://fab.com/inspiration/ceramic-speakers-2

     
  • kierbarr 2:20 pm on March 26, 2012 Permalink | Reply  

    Final Concepts 

    Image

    This first idea would be another monster in the love is a monster series. It would be called I love my career. It would ideally be a desk toy for those who are in a cubicle office setting. The two toys would communicate wirelessly with a garage door opener technology. These toys would be used during those times when you strongly dislike your job. You would then be able to communicate with other employees you empathize with a similar situation.

    Image

    This second idea is would be for children. I have a 5 year old brother and my favorite thing to do with him in the spring time is the easter egg hunt. When he was a toddler he enjoyed the easter egg hunts but had a difficult time detecting the oversized eggs even when they were hidden in obvious places. This toy would hide a light in an oversized easter egg and would light up with a switch allowing the child to locate the egg easily.

    Image

    This third idea would be for reading. When I read print books that are not on my tablet I have a difficult time finding a balance with the lighting. If I turn on the room light its too bright and if I use a snap on light the l.e.d. is not diffused and it hurts my eyes. This idea would use lights in a pillow to allow a person to be able to comfortably read in the bed. 

     

     
  • Joe Volpe 9:33 pm on March 25, 2012 Permalink | Reply  

    Mid Term update 

    So the wiring is up and working. The code needs some work as I’m having a bit of trouble getting the lights to start pulsing upon reaching various levels of heart rate. Also, as of now I have built the prototype around an Arduino NANO but as soon as my LilyPad arrives I will be using that and embedding it into the wristband along with slimmer LEDS

     
  • kierbarr 2:44 pm on March 25, 2012 Permalink | Reply  

    Date Monsters 

    Theses are the Date Monsters from my Love is a Monster Series. These toys are supposed to highlight the awkward qualities of a first date. The concept behind the toys is that the couple would wear the bow tie and hair bow on a first date. Threw the use of a pulse sensor the couple would be able to see if their heartbeats sync to determine if they should go on a second date. This is more of a conceptual design/geek chic.

     

    Image

    Image

    Image

    http://vimeo.com/39140624 http://vimeo.com/39140651 

     
  • kierbarr 2:24 pm on March 25, 2012 Permalink | Reply  

    I only have EYE for you 

    Here is a photo and video of a monster from a series I called Love is a monster. I created this to express a playful take on the awkward and qualities about love.

    http://vimeo.com/39140582?utm_source=internal&utm_medium=email&utm_content=cliptranscoded&utm_campaign=adminclipImage

     

     
  • adamsabh 1:45 am on March 25, 2012 Permalink | Reply  

    Midterm 2nd Iteration 

    Here is a video of my second iteration of the midterm.

    I have made the project tangible and have completed one of the stages.

    I am having trouble getting the colors to adjust between the different pulse readings. So when some one goes from relaxed to energetic music the colors aren’t as smooth of a transition as I was hoping for. Hopefully I can polish this out by Monday.

     
  • adamsabh 2:28 pm on March 24, 2012 Permalink | Reply  

    Midterm Sketches 

    So for my midterm project I want to construct a light system that will react to the people that are within a confined space. Instead of having to set mood lighting or buy different types of bulbs for certain types of parties, events or even just daily use you can buy my one product and be covered for any occasion.

    Below is a sketch of what it will look like. The Computer is set up to the Arduino and a set of headphones so the user can feel as if they are connected to the machine and enhance their experience (for now). I will later power the light separately with a 9v but for now it will be powered by the computer.

    The Arduino sits beneath the light and it will be programmed to take the pulse of the user and interpret that into an appropriate light display. So for instance the user has had a rough day, comes home, put on Radioheads “Nude” and sips a glass of wine their pulse will go from a rapid rate to a very subdued and relaxed state. In which case my lights will react with an ambient mesh of blues, purples, and dull yellow tones. This will help the user relax as well as light their room according their mood without them having to get up and find an appropriate light bulb or brightness level.

     

    Here are the 3 songs that I will use the help achieve the most effective results.

    Relaxed pulse rate:  Radiohead – “Nude”

    Active pulse rate:   Avicii – “Levels”

    Highly Active pulse rate: Every Time I Die – “Cities and Years”

     
  • Yury Gitman 8:35 pm on March 23, 2012 Permalink | Reply  

    Nebulophone, Arduino Music System 

    Impressive sound!

    Nebulophone.

     
  • Joe Volpe 2:20 pm on March 23, 2012 Permalink | Reply  

    Midterm Journal Entry 2: pulse sensor Runner’s band 

    The look at feel for my project is practical and simple. I want to embed the pulse sensor and an array of lights and possibly a speaker into a cotton wrist band. The lights that are aligned linearly with in the band will gradually light up appropriately as the users heart rate increase or decreases. The battery will also be embedded with an pocket that can be easily accessed when changing it. I also would like to add a light sensor as an on and off/reset switch.

    -What surprised you?-

    The wiring is fairly simple so I quickly wired up one LED at the start and attempted to slip my newly purchased arduino NANO into my wristband. The pins on the NANO make it extremely difficult to cleanly place inside the band and also make it uncomfortable to wear. Also, the led itself is rather large.

    So I have decided to use a lily pad and possibly some smaller flatter LEDs if I can find them. I think I’ll also steal a small speaker from a pair of headphones.

    I hope to have a usable and integrated prototype by Monday.

    Any suggestion from any of you would be awesome.

     
  • aisencc 5:38 am on March 23, 2012 Permalink | Reply  

    TSG phase 2 

    I have cleaned up my code and redesigned the pcb to a smaller more compact circuit. Tomorrow Joel Murphy will walk me through the pcb etching machine to print the board out. I am very happy about how it turned out. You can see an image here: 

    Image

    I have picked out the new fabric:

    Image

    In order to finish Theater Safety Glasses 2 I will attend Rhino workshop on Saturday to print the part that encases the battery circuit and servos, and assemble the pieces tighter. Creating a circuit for it has been spending and I hope that creating a 3d file will be as rewarding and useful.

     
  • Amira Pettus 3:44 am on March 23, 2012 Permalink | Reply  

    Amira and Ramiro’s Midterm Journal 2 Entry 

    pictures above in order: 1. physical prototype 2. Code( next phase ) 3. Cards ( look and feel )to indicate patterns players should attempt to mimic using their BMP

     

    In 4-8 sentences, Describe what how you will work on your prototypes between now in next class.  What is left to do?  What surprised you?

    Between now and next class Ramiro and I will

    1.) Implement and refine final physical protoype. —We will make 2 controllers so that there is the option to play against another person as well as yourself.

    2.) Transfer our paper version patterns to actual cardstock — we will make a complete deck of patterns for our players to compete.

    3.) Refine our code

    Our materials to house our final version/hardware has been ordered and we await its arrival. We will be using a wooden casing to house our Arduino because of the look and feel it provides.( Also our metal version is conductive and interferes with the hardware.

     

     

     

     

     

     

     
  • normandiaz 1:46 am on March 23, 2012 Permalink | Reply  

    Norman Diaz’s Midterm Journal Entry 2 (Ambient Lamp) 

    As a reminder my project will be an ambient lamp, lighted up by an RGB LED and controlled by the pulse sensor.

    For the look and feel prototype I’ve been working on the design of the lamp. I was inspired by the arteries of the heart and came up with and abstract shape that represents them.
    After having a final design of my lamp, I started the 3d modeling which will help me have some renders to represent how my design would look in my next prototype and then be 3d printed.

    For my Implementation prototype, I decided to use only one RGB LED to change the colors of the lamp, and currently working on it.

     

     
  • mikesusol 12:27 am on March 23, 2012 Permalink | Reply  

    Robot prototype 

    I finally received my Speakjet from Sparkfun so I spent some time carefully soldering that together so I can get my bot speaking. Not as simple as I had hoped. I’m still building and testing the components to make sure they will all fit and work inside the robot. I prototyped a few different sets of eyes based on the input of my classmates. One option is to mount the LEDs externally in plastic caps and another is to enclose the LEDs in little fabric “dumplings” to stitch inside the head. Both options create a different effect so I’ll keep testing. Ultimately, I think I’ll commit to mounting the LED heart inside the robot – it gives off a nice glow behind the printed black fabric. The pulse sensor is still giving me a little trouble so I need to work on the mounting situation in the robot arm. After that… code, code, code…and more code.

     
    • Yury Gitman 4:13 pm on March 24, 2012 Permalink | Reply

      Mike, if you are getting to much light “bleeding” from the eyes you can: 1) put a higher resistor on the LED so it’s more dim OR 2) make the dumpling smaller or 3) explore a way to stop light bleeding from the edges like a different dumpling material….?

      • mikesusol 4:23 pm on March 24, 2012 Permalink | Reply

        Thanks Yury. Hope you are feeling better. After testing about 15 different eye configurations, I finally committed to using the clear caps on the outside with a higher transistor rating to dim the LEDs a bit. Using the LED dumplings inside the head produced a cool effect but after some user testing people preffered the look of the externally mounted eyes. I’m now trying to make a similar decision about internally or externally mounting the heart LEDs. I’ll bring my prototypes to class on Monday.

  • christopherkoelsch 11:00 pm on March 22, 2012 Permalink | Reply  

    “‘Appointment With Death/aka Working Title” 

    Look and Feel Prototype is pretty much complete:  I built my house today.  Though I don’t want to spend too much type on “Look and Feel,” I want to give the house an exterior of photos/or a dark/goth wallpaper.

    Circuitry is next.

    I have been working on the code but have yet to get it implementing.  Further work with if/else statements will have to be worked on.

     

    1. Led to blink (at at frequency in each room noting tension), then once the attic level is hit — below happens:

    Two servo motors in the attic with rotary blades/fans will be encased in the attic in a box with shards of glass.  This willl give the effect of a “happening” once the blades spin in glass:  i.e. windows breaking, violence occurring.

     

     

     
  • naterudolph 5:18 pm on March 22, 2012 Permalink | Reply  

    Midterm Project 

    I choose to originally to do some sort of exercise ball that you would have to orient to various LEDs to the beat of your heart. That didn’t really seem to fit with the Pulse Sensor very well so I changed it, but kept the same components.

    I’ve always been awful at anything requiring balance, so I thought I would make some that could help a beginner exercise the muscles involved in balancing. This prototype just shows the LEDs marking your angle relative to the ground. A few of the practices you can do are walking backwards and forwards while trying to keep only one LED lit, or walking backwards and forwards while trying to smoothly go through all of the LEDs. Tightrope walking also needs to have a level of relaxation, so the pulse sensor will be included once I get another board, to help you slow down and practice calmly moving through the exercise.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel