Pages: [1]   Go Down
Author Topic: RFID logging clothes dryer  (Read 952 times)
0 Members and 1 Guest are viewing this topic.
Ålesund, Norway
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.
Not shure if this is the correct forum, but here goes nothing.

A friend of mine confronted me with a problem he has.
He rents out some appartments and they have a common clothes washer and dryer, and he has a suspicion that the dryer is used all the time.
the dryer has 4 users.

so what he wants is to be able to log the usage of the dryer, so that if one of the user uses it excessively he can give them a warning or make them pay. smiley-razz

So what I figured is that this would be a nice project for me to learn to use a arduino.

What I have planned is:
The front panel of the dryer gets 4 extra LEDs, one for each user.
the users LED will light up once he/she has identyfied himself by holding a RFID-tag in the same area as the LEDs, this LED will blink when the dryer is finished, and keep blinking until the next user has "loged in", so that if he/se has forgot something, or made a mess, the last user is easily identifyed.

next, when the user is logged in, a relay that is mounted in series with the start-button on the dryer, makes contact, so the dryer can be started, and when the dryer is finished another relay will give a signal back to the arduino.

the thing that I need the most help/input on is how to store/read the information about the number of usages.

one option is to have a 5th. RFID tag that when used makes the LED for each user blink out the number of times he/she has used it since last time the 5th. tag was read.
I guess this is the cheapest and easiest way to do this.
and I guess I need a SD-card or something to save the information, in case there is a loss of power. (or does the arduino remember stuff anyways?)

another way would be to mont a ethernet-shield and a web page where the usage is listed, and maybe have a password protected counter reset.
the problem is that this requires a ethernet-cable to be installed.....

Need to know what I should buy so I can get started on this

Any input would be appreciated  smiley-grin
« Last Edit: July 18, 2009, 09:56:33 pm by alekoy » Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 854
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It sounds quite doable.  To retrieve the data, you can plug a laptop into the Arduino and send a command that your sketch will recognize to dump all the data to your laptop, then cut and paste it from the terminal screen to a text file.

The ATmega328 version of Arduino has 1024 bytes of memory that can be saved when it loses power, if that's not enough you'll have to use an alternative like a serial eeprom or SD card.

A residential dryer takes 30 amps at 230 volts, so make sure you use a suitable relay and make very, very sure you know what you're doing to deal with that kind of power.  It can be deadly.  And make sure your tenants can't unplug the dryer from your project and plug it directly to the wall outlet.
Logged

Ålesund, Norway
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okidok,
so I buy the Duemilanove, then.

I am an electrician so I am not afraid to play around with the 230V, but the plan was to interrupt the start-button on the front of the dryer, so that the dryer acts like normal (you can put the clothes in, set the program) but it just won't start until the user logs in.

the data retrieval you mentioned is a good one, no possibility for a counting error. but maybe to difficult for my friend.

I am thinking about using the Parallax RFID-reader
Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 854
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The thing about Parallax is they start with prices several times too high and then never seem to improve their products or lower prices as technology evolves.

Consider this RF reader for 1/3rd the price: http://www.seeedstudio.com/depot/125khz-rfid-module-uart-p-171.html

He also sells a 5-pack of RFID tags for it for $2.50.
« Last Edit: July 19, 2009, 11:02:16 am by Oracle » Logged

Ålesund, Norway
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for the advice, I ordered som stuff from that seeedstudio-page now, progress reports will be posted when I get started.
Logged

Omaha
Offline Offline
Full Member
***
Karma: 0
Posts: 187
AC0KG
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looking forward to seeing this project progress, it's very similar to one I've considered doing, but have never gotten around to starting.
Logged


Ålesund, Norway
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I recieved the parts from seeed studio today, and feel that I'v got reasonably far with just a few minutes of experience with programming in something other than ladder (PLC-programming)

I found a code to read the ID of the RFID tags and started working on the main code.

trying to sort  out some issues with the reading now, will post results. smiley-wink
« Last Edit: July 31, 2009, 05:03:49 am by alekoy » Logged

Ålesund, Norway
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have built the hardware, and after some trial and erron, I'm starting to get the code working, the reading and identification of the tags is working, buzzer is beeping and leds are blinking  smiley-grin

Some pictures of the shield, with the coil for the reader temporary taped to the board, and user 2 logged in  smiley


and the back of it, with some wires. :smiley


the next bug to resolve is that after reading a tag, the software sort of locks up, and reports any tag that gets read to be the same ID as the first tag...

I will attach the code, so if anyone with more understanding of this can take a look at it  smiley-wink
the code is based of THIS CODE
Code:
//RFID Clothes Dryer

#include <SoftwareSerial.h>
#define rxPin 2
#define txPin 3

 SoftwareSerial mySerial= SoftwareSerial(rxPin, txPin);
 int buzzPin =  5; //buzzer
 int led1Pin =  6; //user 1
 int led2Pin =  7; //user 2
 int led3Pin =  8; //user 3
 int led4Pin =  9; //user 4
 int doorPin =  12; //doorswitch
 int startPin =  13; //start connected to pin 13
 
 
boolean open = true; // default start up is to assume the lock is open
int val = 0;
char code[12];
int bytesread = 0;
int pulse, switchVal;
 
 //RFID tags  
char tag1[13] = "390051A9ED2"; //user1
char tag2[13] = "39003A80D45"; //user2
char tag3[13] = "3900315FECB"; //user3
char tag4[13] = "390031587D2"; //user4
char tag5[13] = "24004D4AF5D"; //delete
char tag6[13] = "24004D31174"; //read
 
 
void LED(int state){
    
 switch (state){
 case 1: //user 1 LED on
 digitalWrite(led1Pin, HIGH);
 break;
 case 2: //user 2 LED on
 digitalWrite(led2Pin, HIGH);
 break;
 case 3: //user 3 LED on
 digitalWrite(led3Pin, HIGH);
 break;
 case 4: //user 4 LED on
 digitalWrite(led4Pin, HIGH);
 break;
 case 5: //user 1 LED blink
 digitalWrite(led1Pin, HIGH);
 delay(500);
 digitalWrite(led1Pin, LOW);
 delay(500);
 break;
 case 6: //user 2 LED blink
 digitalWrite(led2Pin, HIGH);
 delay(500);
 digitalWrite(led2Pin, LOW);
 delay(500);
 break;
 case 7: //user 3 LED blink
 digitalWrite(led3Pin, HIGH);
 delay(500);
 digitalWrite(led3Pin, LOW);
 delay(500);
 break;
 case 8: //user 4 LED blink
 digitalWrite(led4Pin, HIGH);
 delay(500);
 digitalWrite(led4Pin, LOW);
 delay(500);
 break;
 case 9: //all LED blink
 for (long i = 0; i < 2048 * 1; i++ )
 {
   digitalWrite(led1Pin, HIGH);
  digitalWrite(led2Pin, HIGH);
   digitalWrite(led3Pin, HIGH);
    digitalWrite(led4Pin, HIGH);
 delay(300);
 digitalWrite(led1Pin, LOW);
  digitalWrite(led2Pin, LOW);
   digitalWrite(led3Pin, LOW);
    digitalWrite(led4Pin, LOW);
 delay(300);
 }
 break;
 break;
 case 10: //all LED blink fast
 for (long i = 0; i < 2048 * 1; i++ )
 {
   digitalWrite(led1Pin, HIGH);
  digitalWrite(led2Pin, HIGH);
   digitalWrite(led3Pin, HIGH);
    digitalWrite(led4Pin, HIGH);
 delay(150);
 digitalWrite(led1Pin, LOW);
  digitalWrite(led2Pin, LOW);
   digitalWrite(led3Pin, LOW);
    digitalWrite(led4Pin, LOW);
 delay(150);
 }
 break;
 }
 }
    
 void user(int state){
 
   switch (state){
 case 1: //user 1
 beep(2);
 LED(1);
 Serial.print("User 1");
 break;
 case 2: //user 2
 beep(2);
 LED(2);
 Serial.print("User 2");
 break;
 case 3: //user 3
 beep(2);
 LED(3);
 Serial.print("User 3");
 break;
 case 4: //user 4
 beep(2);
 LED(4);
 Serial.print("User 4");
 break;
 case 5: //delete
 beep(2);
 LED(9);
 Serial.print("Delete");
 break;
 case 6: //read
 beep(2);
 Serial.print("Read");
 break;
 }
 }
 
 void beep(int state){

 switch (state){
 case 1: //long beep, bad tag
 for (long i = 0; i < 2048 * 1; i++ )
 {
    digitalWrite(buzzPin, HIGH);
    delayMicroseconds(244);
    digitalWrite(buzzPin, LOW);
    delayMicroseconds(244);
 }
 break;
 case 2: //short beep, good tag
 for (long i = 0; i < 1024 * 1; i++ )
 {
   digitalWrite(buzzPin, HIGH);
    delayMicroseconds(122);
    digitalWrite(buzzPin, LOW);
    delayMicroseconds(122);
 }
 }
 }
 
 void setup() {
  
   Serial.begin(9600);
   mySerial.begin(9600);
   pinMode(rxPin, INPUT);
   pinMode(txPin, OUTPUT);
   pinMode (buzzPin, OUTPUT);
   pinMode (led1Pin, OUTPUT);
   pinMode (led2Pin, OUTPUT);
   pinMode (led3Pin, OUTPUT);
   pinMode (led4Pin, OUTPUT);
   pinMode (doorPin, INPUT);
   pinMode (startPin, OUTPUT);
   }
 
  
 boolean checkTag(char *tag){

for (int x=0;x<11;x++){
if( tag[x] != code[x]){
return false;
}
}
return true;
}

boolean findGoodTag(){
if (checkTag(tag1)){ user(1); return true;}
else if (checkTag(tag2)){ user(2); return true;}
else if (checkTag(tag3)){ user(3); return true;}
else if (checkTag(tag4)){ user(4); return true;}
else if (checkTag(tag5)){ user(5); return true;}
else if (checkTag(tag6)){ user(6); return true;}


else{
Serial.print("Bad tag: ");
Serial.println(code);
beep(1);
LED(10);
return false;
}}

void loop(){
 
SoftwareSerial RFID = SoftwareSerial(rxPin,txPin);
RFID.begin(9600);

if((val = RFID.read()) == 11)
bytesread = 0;
while(bytesread<11)
{ // read 12 digit code
val = RFID.read();
if((val == 11)||(val == 12))
{ // if header or stop bytes before the 11 digit reading
break; // stop reading
}
code[bytesread] = val; // add the digit
bytesread++; // ready to read next digit
}



if((bytesread == 11) && (findGoodTag()))
{ // if 11 digit read is complete
delay(500);
}}
« Last Edit: August 01, 2009, 05:52:06 pm by alekoy » Logged

ottawa, canada
Offline Offline
God Member
*****
Karma: 5
Posts: 989
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

software serial has always been a good source of lockups for me...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry if this question strays a bit from the intended target, but I recently purchased this model of RFID reader from the Seeeduino store and tried a reading the 125kHz key chains and cards (also available from the Seeeduino store) but was only able to read 0xFF values using bot the SerialHardware objects and the Serial object.

I was curious if anyone else has seen this behavior or if perhaps this is the sign of a damaged unit.

Thanks in advance!
Logged

GA USA
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your friend better be careful or those of us with the means to produce rfid cards might just track this washer down and wash our clothes until it breaks.   That or sell them to the neighbors...

Nice project!  
Logged

Pages: [1]   Go Up
Jump to: