|
Main Links:
Final Projects
|
Main /
Group6Group Members Week 1: Observation We will observe people exiting their apartment buildings, hopefully without being noticed. We will post our findings on our personal pages. Week 2: Prototyping We've have a basic plan set up for our ciruit, we'll come up with a complete schematic within the next few days. We purchased a a magnetic door switch to turn the system on when the door is opened, but we'll have to wait a few days for our RF transponder and reader. We're going to use low frequency RFID for the proximity detection of the keychain. The parts we're currently looking at buying are both from Texas Instruments: The Keyring Tag and the Micro Reader
![]()
![]() click here to see the magnet switch in action! Week 3: More Prototyping We're having a lot more trouble than we anticipated getting the RFID reader to function correctly. As it turns out, RS232 sends and receives in 12v pulses, and the RFID reader sends and receives 5v pulses. This means we need a MAX232 chip to have them communicate. It's also unfortunate that we're going to need to use a computer at all for our project, but there doesn't appear to be any other way to process the signal at the moment. ![]()
![]()
![]()
![]()
void setup() { Serial.begin( 9600 ); //pinMode(rfidIn, INPUT); pinMode(doorIn, INPUT); pinMode(speaker, OUTPUT); } void loop() { Serial.print(analogRead(doorIn));
Serial.print(", ");
Serial.println(analogRead(rfidIn)); if((analogRead(doorIn) < 1) && (analogRead(rfidIn) == 0))
{
digitalWrite(speaker, HIGH);
}
else digitalWrite(speaker, LOW);
}
latest Arduino code
int interval = 2000; long lastTime = 0; int tag = 0; int maxtag = 0; int maxdoorvolt = 1023; void setup() { Serial.begin( 9600 ); //pinMode(rfidIn, INPUT); pinMode(doorIn, INPUT); pinMode(speaker, OUTPUT); } void loop() { Serial.println(analogRead(rfidIn));
Serial.print("door: ");
Serial.println(analogRead(doorIn));
Serial.println(millis());
Serial.println(lastTime);
if((maxdoorvolt - analogRead(doorIn)) >900){
lastTime = millis();
}
if(analogRead(doorIn) < 50){
maxdoorvolt = 0;
tag = analogRead(rfidIn);
if (tag > maxtag){
maxtag = tag;
}
if(maxtag > 400){
analogWrite(speaker,0);
}
else if (millis() - lastTime > interval)
{
lastTime = millis();
analogWrite(speaker,500);
}
}
else {
maxtag = 0;
maxdoorvolt = 1023;
analogWrite(speaker,0);
}
}
|