Bathroom Duck

So this was quite a struggle! First couldn’t get api mode to work, then got it working with two arduinos and managed to fry one of them! But finally got it up and running. The duck lives in the bathroom and sends a signal to the alertbox (an old 60s clock) if the bathroom is occupied.
duck sensor wiring

Here is the wiring inside of the duck. I attempted multiple times to get my xbee set up as a coordinator api but I had done some damage to it so was unable to set up the sensor router with an arduino. Fortunately, I had a LilyPad on hand I’d wanted to use anyway, and it fit perfectly inside the duck. I put the sensor on his collar and wire wrapped and soldered the internal connections to make sure nothing came undone when it was backed in.
duck LilyPad
duck on shelf
I found the duck at this awesome place in Gowanus called Film Biz Recycling that I stumbled into. The duck was not so special even though it only cost 75 cents, but they also had boxes upon boxes of old clocks, and I thought the combination of the madmen aesthetic of the clock paired with the ridiculousness of the duck would be a nice combo for this somewhat contrived assignment.
clock shell
I took out the guts and put an arduino uno, 9v battery, and the Xbee inside. Of course, I then shorted out the Xbee and had to buy a new one, but finally the project was working.
clock unlit
clock lit


/*Bathroom Duck Wireless Sensor
Scott Peterman*/

#include 
NewSoftSerial mySerial(3, 2);
#define VERSION "1.00a0"

int sensor = A4;

void setup(){
  mySerial.begin(9600);
}

void loop(){
  //Serial.println(analogRead(sensor));
    if (analogRead(sensor) > 20) {
        mySerial.print('D');
        delay(200);
        digitalWrite(13,HIGH);
        delay(10);
        digitalWrite(13,LOW);
      }
    else{
      mySerial.print('N');
      delay(200);
    }
    //Serial.println(analogRead(sensor));
}
//Bathroom Duck Base Station
//Scott Peterman

#include 
NewSoftSerial mySerial(2, 3);
#define VERSION "1.00a0"

int LED = 11;
char read1;
char read2;

void setup(){
  pinMode(LED, OUTPUT);
  mySerial.begin(9600);
}

void loop(){
  if (mySerial.available() > 0){
      if (mySerial.read()=='D'){
        digitalWrite(LED, HIGH);
        digitalWrite(13, HIGH);
        
      }
      delay(200);
     if (mySerial.read()== 'N'){
        digitalWrite(LED, LOW);
        digitalWrite(13, LOW);
//        
      }
     // Serial.println(Serial.read());
}
}