Updates from March, 2011 Toggle Comment Threads | Keyboard Shortcuts

  • Alvaro Soto 10:14 pm on March 3, 2011 Permalink | Reply  

    Traffic Light Doorbell 

    First time

    The first time anyone presses the button a green light turns On and plays a nice melody. This way the user will know the bell worked.

    Second Time

    Usually the bell is pressed twice after sometime waiting, this is Ok and the Doorbell will tell the user that it worked, but a warning color and tone will be given to the user.

    Third Time

    This is the final notice, the user will now have to wait 5 minutes until he/she can press the button and get a signal. (a warning red color and angry tone will be given to the user).

     
  • Oylum 10:10 pm on March 3, 2011 Permalink | Reply  

    Soak ’em Up 

    With this tool, no one will dare to annoy you by buzzing your doorbell for long…or no one will ever visit you again!






    Process

    Source Code for the Receiver

    
    #include <NewSoftSerial.h>
    NewSoftSerial mySerial(2,3);
    
    /*
    doorbell basic DINGY!!
    by Rob Faludi faluudi.com
    */
    
    #define VERSION "1.00a0"
    
    boolean dumpWater = false;
    int water = 7;
    
    long previousMillis = 0;
    long interval = 5000;
    int BUTTON = 5;
    int counter=0;
    
    void setup(){
      pinMode(water, OUTPUT);
      pinMode(BUTTON, INPUT);
      pinMode(13,OUTPUT);
      mySerial.begin(9600);
    }
    
    void loop(){
      //look for a capital D over the serial port and ring the bell if found
      unsigned long currentMillis = millis();
      if(currentMillis - previousMillis > interval&&dumpWater==true) {
        dumpWater=false;
        digitalWrite(water, LOW);
        digitalWrite(13, LOW);
      }
      if(counter>=300){
          previousMillis = currentMillis;
          dumpWater=true;
          digitalWrite(water, HIGH);
          digitalWrite(13, HIGH);
          counter=0;
      }
      if (mySerial.available() > 0){
        if (mySerial.read() == 'W') {
            //ring bell briefly
            previousMillis = currentMillis;
            dumpWater=true;
            digitalWrite(water, HIGH);
            digitalWrite(13, HIGH);
            delay(10);
            
          }
        }
        if (digitalRead(BUTTON) == HIGH){
         mySerial.print('R');
         counter++;
         //digitalWrite(13,HIGH);
         delay(10); //prevents overwhelming the serial port
        }
    }
    
    

    Source Code for the Sender Button

    
    #include <NewSoftSerial.h>
    
    /*
    doorbell basic BUTTON!!
    by Rob Faludi faluudi.com
    */
    NewSoftSerial mySerial(2,3);
    
    #define VERSION "1.00a0"
    boolean dumpWater=false;
    int BUTTON = 5;
    int resetButton = 8;
    int bell = 7;
    
    
    
    void setup(){
      pinMode(BUTTON, INPUT);
      pinMode(resetButton, INPUT);
      pinMode(bell, OUTPUT);
      pinMode(13,OUTPUT);
      mySerial.begin(9600);
    }
    
    void loop(){
      //send a capital D over the serial port if the button is pressed
      if(dumpWater==false){
        digitalWrite(13,HIGH);
      }else{
        digitalWrite(13,LOW);
      }
      if(digitalRead(resetButton)==HIGH && dumpWater==true){
        dumpWater=false;
      }
      if (digitalRead(BUTTON) == HIGH){
        if(dumpWater==false){
           mySerial.print('W');
           //digitalWrite(13,HIGH);
           delay(10); //prevents overwhelming the serial port
           dumpWater=true;
        }
      }
      if (mySerial.available() > 0&&dumpWater==false){
        if (mySerial.read() == 'R') {
            //ring bell briefly
            //previousMillis = currentMillis;
            //dumpWater=true;
            digitalWrite(bell, HIGH);
            //digitalWrite(13, HIGH);
            delay(10);
            digitalWrite(bell, LOW);
            
          }
        }
    }
    

    by Leif, Chris, Oylum

     
  • thisisvictorkim 9:56 pm on March 3, 2011 Permalink | Reply  

    Traffic Light Doorbell by Alvaro, Bree, and Victor 

    code for the doorbell buzzer and doorbell bell

    (More …)

     
  • Behnaz Babazadeh 9:36 pm on March 3, 2011 Permalink | Reply  

    Simon Package Delivery System 

    Look & Feel Presentation

    SIMON

     (More ...)
     
  • hilalkoyuncu 9:31 pm on March 3, 2011 Permalink | Reply  

    Romantic Lighting Sensor with Feedback(Exercise-2) 

    You keep the exact same wiring as the first exercise.

    • Additionally, you will add an LED to pin 19 of the Sensor Breadboard.


    • Configure your Router XBee:

    +++

    ATD14(To put pin 1 in low digital output mode, LED.)

    ATWR(To save the settings.)

    • Upload the second code that Kate posted to the base board Arduino.

    You will get this:

     
  • catherine 9:19 pm on March 3, 2011 Permalink | Reply  

    Code for Romantic Lighting with Feedback 

    Code needed for the second part of the lesson.

    /*
     * *********ROMANTIC LIGHTING SENSOR WITH FEEDBACK********
     * detects whether your lighting is
     * setting the right mood and shows
     * you the results on the sensor module
     * USES PREVIOUSLY PAIRED XBEE ZB RADIOS
     * by Rob Faludi http://faludi.com
     */
    
    /*
    *** CONFIGURATION ***
     
     SENDER: (REMOTE SENSOR RADIO)
     ATID3456 (PAN ID)
     ATDH -> set to SH of partner radio
     ATDL  -> set to SL of partner radio
     ATJV1 -> rejoin with coordinator on startup
     ATD02  pin 0 in analog in mode with a photo resistor (don't forget the voltage divider circuit--resistor to ground is good)
     ATD14  pin 1 in digital output (default low) mode with an LED from that pin to ground
     ATIR64 sample rate 100 millisecs (hex 64)
     
     
     * THE LOCAL RADIO _MUST_ BE IN API MODE *
     
     RECEIVER: (LOCAL RADIO)
     ATID3456 (PAN ID)
     ATDH -> set to SH of partner radio
     ATDL  -> set to SL of partner radio
     
     */
    
    #define VERSION "1.02"
    
    int LED = 11;
    int debugLED = 13;
    int analogValue = 0;
    int remoteIndicator = false; // keeps track of the desired remote on/off state
    int lastRemoteIndicator = false; // record of prior remote state
    unsigned long lastSent = 0; // records last time the remote was re-set to keep it in sync
    
    
    void setup() {
      pinMode(LED,OUTPUT);
      pinMode(debugLED,OUTPUT);
      Serial.begin(9600);
    }
    
    
    void loop() {
      // make sure everything we need is in the buffer
      if (Serial.available() >= 23) {
        // look for the start byte
        if (Serial.read() == 0x7E) {
          //blink debug LED to indicate when data is received
          digitalWrite(debugLED, HIGH);
          delay(10);
          digitalWrite(debugLED, LOW);
          // read the variables that we're not using out of the buffer
          // (includes two more for the digital pin report)
          for (int i = 0; i<20; i++) {
            byte discard = Serial.read();
          }
          int analogHigh = Serial.read();
          int analogLow = Serial.read();
          analogValue =  analogLow + (analogHigh * 256);
        }
      }
    
      /*
       * The values in this section will probably
       * need to be adjusted according to your
       * photoresistor, ambient lighting and tastes.
       * For example, if you find that the darkness 
       * threshold is too dim, change the 350 value
       * to a larger number.
       */
    
      // darkness is too creepy for romance
      if (analogValue > 0 && analogValue <= 350) {
        digitalWrite(LED, LOW);
        remoteIndicator = false;
      }
      // medium light is the perfect mood for romance
      if (analogValue > 350 && analogValue <= 750) {
        digitalWrite(LED, HIGH);
        remoteIndicator = true;
      }
      // bright light kills the romantic mood
      if (analogValue > 750 && analogValue <= 1023) {
        digitalWrite(LED, LOW);
        remoteIndicator = false;
      }
    
      // set the indicator immediately when there's a state change
      if (remoteIndicator != lastRemoteIndicator) {
        if (remoteIndicator==false) setRemoteState(0x4);
        if (remoteIndicator==true) setRemoteState(0x5);
        lastRemoteIndicator = remoteIndicator;
      }
    
      // re-set the indicator occasionally in case it's out of sync
      if (millis() - lastSent > 10000 ) {
        if (remoteIndicator==false) setRemoteState(0x4);
        if (remoteIndicator==true) setRemoteState(0x5);
        lastSent = millis();
      }
    
    
    }
    
    void setRemoteState(int value) {  // pass either a 0x4 or and 0x5 to turn the pin on or off
      Serial.print(0x7E, BYTE); // start byte
      Serial.print(0x0, BYTE); // high part of length (always zero)
      Serial.print(0x10, BYTE); // low part of length (the number of bytes that follow, not including checksum)
      Serial.print(0x17, BYTE); // 0x17 is a remote AT command
      Serial.print(0x0, BYTE); // frame id set to zero for no reply
      // ID of recipient, or use 0xFFFF for broadcast
      Serial.print(00, BYTE);
      Serial.print(00, BYTE);
      Serial.print(00, BYTE);
      Serial.print(00, BYTE);
      Serial.print(00, BYTE);
      Serial.print(00, BYTE);
      Serial.print(0xFF, BYTE); // 0xFF for broadcast
      Serial.print(0xFF, BYTE); // 0xFF for broadcast
      // 16 bit of recipient or 0xFFFE if unknown
      Serial.print(0xFF, BYTE);
      Serial.print(0xFE, BYTE);
      Serial.print(0x02, BYTE); // 0x02 to apply changes immediately on remote
      // command name in ASCII characters
      Serial.print('D', BYTE);
      Serial.print('1', BYTE);
      // command data in as many bytes as needed
      Serial.print(value, BYTE);
      // checksum is all bytes after length bytes
      long sum = 0x17 + 0xFF + 0xFF + 0xFF + 0xFE + 0x02 + 'D' + '1' + value;
      Serial.print( 0xFF - ( sum & 0xFF) , BYTE ); // calculate the proper checksum
      delay(10); // safety pause to avoid overwhelming the serial port (if this function is not implemented properly)
    }
    
    
     
  • catherine 9:14 pm on March 3, 2011 Permalink | Reply  

    Code for Romantic Light Sensor base station 

    PART ONE OF LESSON. COPY & PASTE THIS INTO ARDUINO FIRST.

    /*
     * *********ROMANTICLIGHTING SENSOR ********
     * detects whether your lighting is
     * setting the right mood
     * USES PREVIOUSLY PAIRED XBEE ZB RADIOS
     * by Rob Faludi http://faludi.com
     */
    
    /*
    *** CONFIGURATION ***
     
     SENDER: (REMOTE SENSOR RADIO)
     ATID3456 (PAN ID)
     ATDH -> set to SH of partner radio
     ATDL  -> set to SL of partner radio
     ATJV1 -> rejoin with coordinator on startup
     ATD02  pin 0 in analog in mode
     ATIR64 sample rate 100 millisecs (hex 64)
     
     
     * THE LOCAL RADIO _MUST_ BE IN API MODE *
     
     RECEIVER: (LOCAL RADIO)
     ATID3456 (PAN ID)
     ATDH -> set to SH of partner radio
     ATDL  -> set to SL of partner radio
     
     */
    
    #define VERSION "1.02"
    
    int LED = 11;
    int debugLED = 13;
    int analogValue = 0;
    
    
    void setup() {
      pinMode(LED,OUTPUT);
      pinMode(debugLED,OUTPUT);
      Serial.begin(9600);
    }
    
    
    void loop() {
      // make sure everything we need is in the buffer
      if (Serial.available() >= 21) {
        // look for the start byte
        if (Serial.read() == 0x7E) {
          //blink debug LED to indicate when data is received
          digitalWrite(debugLED, HIGH);
          delay(10);
          digitalWrite(debugLED, LOW);
          // read the variables that we're not using out of the buffer
          for (int i = 0; i<18; i++) {
            byte discard = Serial.read();
          }
          int analogHigh = Serial.read();
          int analogLow = Serial.read();
          analogValue =  analogLow + (analogHigh * 256);
        }
      }
    
      /*
       * The values in this section will probably
       * need to be adjusted according to your
       * photoresistor, ambient lighting and tastes.
       * For example, if you find that the darkness 
       * threshold is too dim, change the 350 value
       * to a larger number.
       */
    
      // darkness is too creepy for romance
      if (analogValue > 0 && analogValue <= 350) {
        digitalWrite(LED, LOW);
      }
      // medium light is the perfect mood for romance
      if (analogValue > 350 && analogValue <= 750) {
        digitalWrite(LED, HIGH);
      }
      // bright light kills the romantic mood
      if (analogValue > 750 && analogValue <= 1023) {
        digitalWrite(LED, LOW);
      }
    
    }
    
     
  • hilalkoyuncu 9:09 pm on March 3, 2011 Permalink | Reply  

    Romantic Lighting Sensor(Exercise 1) 

    “WIRELESS NETWORKING IS NOT NEARLY AS TRICKY AS NAVIGATING ROMANCE.”~Robert Faludi

    But here is what you can do:

    • Set up your COORDINATOR to API mode on X-CTU:


    • Note that after setting up your coordinator firmware to API mode on X-CTU, you can only configure your PAN ID(your chosen address),  ATDH(0013a200) and ATDL(the remainder of your routers address) on X-CTU as the following:

    • Then click Write button to save changes.
    • Set up your ROUTER on Coolterm:

    +++

    ATID (Same as Coordinator ATID)

    ATDH0013a200

    ATDL ( Remainder of Coordinator’s address)

    ATJV1 ( To ensure that router attempts to rejoin the coordinator on startup.)

    ATD02 ( To put pin “0” in analog mode.)

    ATIR64 [ To set up the sample rate to 10 times/second—1000ms/10=100ms=64(hex)]

    ATWR (To save the settings.)

    • Wiring ————ROUTER:

    • Wiring ————COORDINATOR:

     

    PITFALLS:

    Make sure your voltage regualtor is plugged in properly. If you have the LM1086CT the pin where etched circle is located would be GROUND, the middle one would be OUTPUT and the third one would be INPUT.

    Make sure your breakboard has the RIGHT pins connected to Arduino.

    When its all done, upload the first code that Kate posted.

    If everything is correctly hooked up you will observe this:

     
  • Thom Hines 7:42 pm on March 3, 2011 Permalink | Reply  

    Hostile Interaction Mediator & Doorbell 

    When thinking about ways of improving on the doorbell, it was hard to come up with ways in which it’s most basic purpose could be improved. But after living in apartments for a number of years, the most interesting part isn’t what happens when the doorbell rings, but rather what happens just after.

    Our front doors literally connect the interior to the exterior, but more than that, it is the one place where people tend to allow their private, inside selves to be on display to outsiders. When living near other people, it’s hard not to hear when Mr. Johnson has ordered Chinese food for the third time this week, or that Betty has very strong opinions about Jehovah’s Witnesses, or most painfully, when a couple two doors down is having a fight.

    So, in the spirit of highlighting this awkward exchange, Andy and I decided to make a doorbell that would allow two people having a fight to hash it out a bit without ever having to open the door. The device on the outside would have a standard doorbell, but also a variety of statements that would allow him/her to respond to any questions or statements by the the person on the inside.

    Hostile Interaction Mediator, Outside

    Initially we were going to give the user on the inside a keyboard to type specific questions to the person on the outside, but we were running into some serial issues and had to simplify our device to a more humorous and specific interaction. Even so, the person on the inside is in a more dominant position just by being inside already and controlling the door lock, get’s the chance to ask some pointed (albeit pre-chosen) questions of the guest.

    Hostile Interaction Mediator, Inside

    Also, the person on the inside has one extra button that the person outside does not: the FUCK YOU button. This fist-sized button will flash, in all capital letters, “Fuck You” over and over again and prevent the person on the outside from being able to send any messages back in. This implies that the conversation is over.

    The code for both of these actually sends the entire message over the XBee serial connection letter by letter. We built it this way since we were planning on sending typed messages). The code for each device is quite similar since this is a conversation and each is displaying to an LCD screen; the only difference is in the content of each message sent and that the device inside has a buzzer to indicate when somebody is at the door.

    Here is the arduino code for each:

    Internal/dominant

    External/abusee

     
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