Washing Machine Buzzer

Sometimes you need to do things the hard way.  This is one of those cases.

A few months ago, our washing machine died.  This one was beyond my ability to fix, so we broke down and bought a new one.  The model we chose had a bunch of fancy features, but the one that was missing was the end-of-cycle alarm.  With our last washer, we had grown used to hearing a buzzer when the cycle ended.  Now the washer stops and we go about our day not considering the wet clothes sitting in the washing machine. 

Any do-it-yourselfer with any self respect would have no problems opening up the control panel and adding a buzzer to the exising “Cycle Finished” light.  My wife, however, doesn’t have that kind of faith in me, so I have to do things the hard way.  Here is the plan:

A photoresistor will be placed over the cycle finished light.  The value of this sensor will be fed into an Arduino Pro Mini.  This will read the status of the washing machine.  When the light turns on, the arduino will activate a 9 volt buzzer (one second on, one second off) for ten minutes.

Figure 1:  Circuit diagram

Figure 2: Arduino code

int buzzcount=0;
int ledstatus=0;
int buzzerpin=2;  // connect to npn base 
int sensorpin=0;  // connect to photoresistor (w/ pull-down)

// preferences ///////
int trigger=512;    //
int buzzlimit=300;  //
//////////////////////

void setup() {               
  pinMode(buzzerpin, OUTPUT);  
}

void loop() {
  setStatus();
  if(ledstatus==1){
    if(buzzcount<buzzlimit){
      buzz();
      buzzcount++;
    }
  }
}

void buzz(){
  digitalWrite(2, HIGH);
  delay(1000);
  digitalWrite(2, LOW);
  delay(1000);
}

void setStatus(){
  if(analogRead(sensorpin)>trigger){
    ledstatus=1;
  }else{
    ledstatus=0;
    buzzcount=0;  // reset to 0 when the lid is opened
  }
}

Advertisements

Drone: Onboard Computer

While I haven’t yet nailed down which helicopter I’m using as a base, the onboard computer is all but finalized.  For now, let’s assume that I’ll be using the S031.  Give that, here is a description of the final product:

The s031 RC helicopter has an onboard 9.6 volt battery.  This will be used to power the Arduino, which supplies both 5v and 3.3v logic to the remaining parts.

Pins D11-D13 -> SD card shield (SPI interface)

Pins 0,1 -> GPS (Serial interface)

Pins A4, A5 -> Magnetometer/Accellerometer ( I2C interface )