Bonjour,nous sommes un groupe de travail en Terminale STI2D SIN qui avons pour travail de réaliser un projet pour le BAC. "Amélioration de la sécurité dans les centres médicalisés"
Contraintes imposées :
-Utilisation d'Arduino
-Capteurs RFID
-Page WEB
Principe du projet :
Il s'agit de réguler l'accès a une salle en équipant les patients d'un bracelet à capteur RFID, de tel sorte que la porte ne s'ouvre pas pour tout le monde.
par exemple Monsieur X (qui est autorisé à passer) possède le bracelet jaune, le capteur de la porte détecte le code du bracelet jaune et ouvre la porte.
Monsieur Y (qui n'a pas le droit d'accéder à la salle) possède le bracelet rouge, le capteur remarque que le code de ce bracelet interdit l'ouverture, la porte reste donc fermé.
Il faut ensuite que tout les passages soit répertoriés sur une page WEB en indiquant la personne, la date, l'heure et si oui ou non elle est passées.
Nous avons plusieurs problèmes :
Le premier par rapport à la page WEB sur Arduino, nous avons la forme de la page (cela dois représenter une liste avec les donnés cités plus haut), mais il faudrais que ce sois sous forme de tableau, en gros il y a tout, sauf les lignes pour en faire un tableau. Car la programmation WEB sur Arduino et différents que le HTML et CSS
Le deuxième en rapport avec les capteurs : nous avons des difficultés avec la programmation sous arduino , pour autoriser ou non l'accès mais nous avons commencer ce programme (ci dessous):
/*
Example 15.2
read RFID tag, if it matches a preset tag, set a digital pin high for 10 seconds
tronixstuff.com/tutorials > Chapter 15
*/
int data1 = 0;
int ok=-1;
// define the tag numbers that can have access
int yellowtag[14] = {
1,11,1,1,12,224,151,161,255,2,154}; // my yellow tag. Change this to suit your own tags, use example 15.1 sketch to read your tags
int redtag[14] = {
1,11,1,1,12,227,163,190,255,147,110}; // my red tag...
int newtag[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // used for read comparisons
int okdelay = 500; // this is the time the output will be set high for when an acceptable tag has been read
int notokdelay = 500; // time to show no entry (red LED)
void setup()
{
Serial.flush(); // need to flush serial buffer, otherwise first read from reset/power on may not be correct
pinMode(3, OUTPUT); // this if for "rejected" LED
pinMode(4, OUTPUT); // this will be set high when correct tag is read. Use to switch something on, for now - an LED.
Serial.begin(9600); // for debugging
}
boolean comparetag(int aa[14], int bb[14])
// compares two arrrays, returns true if identical - good for comparing tags
{
boolean ff=false;
int fg=0;
for (int cc=0; cc<14; cc++)
{
if (aa[cc]==bb[cc])
{
fg++;
}
}
if (fg==14)
{
ff=true;
}
return ff;
}
void checkmytags()
//compares each tag against the tag just read
{
ok=0; // this variable helps decision making, if it is 1, we have a match, zero - a read but no match, -1, no read attempt made
if (comparetag(newtag,yellowtag)==true)
{
ok++;
}
if (comparetag(newtag,redtag)==true)
{
ok++;
}
}
void readTag()
// poll serial port to see if tag data is coming in (i.e. a read attempt)
{
ok=-1;
if (Serial.available() > 0) // if a read has been attempted
{
// read the incoming number on serial RX
delay(100); // Needed to allow time for the data to come in from the serial buffer.
for (int z=0; z<14; z++) // read the rest of the tag
{
data1=Serial.read();
newtag[z]=data1;
}
Serial.flush(); // stops multiple reads
// now to match tags up
checkmytags(); // compare the number of the tag just read against my own tags' number
}
//now do something based on tag type
if (ok>0==true) // if we had a match
{
digitalWrite(4, HIGH);
delay(okdelay);
digitalWrite(4, LOW);
ok=-1;
}
else if (ok==0) // if we didn't have a match
{
digitalWrite(3, HIGH);
delay(notokdelay);
digitalWrite(3, LOW);
ok=-1;
}
}
void loop()
{
readTag(); // we should create a function to take care of reading tags, as later on
// we will want other things to happen while waiting for a tag read, such as
// displaying data on an LCD, etc
}
Le dernier problème est : comment assemblé nos 2 fichiers, le fichier Arduino avec la page avec le fichier Arduino sur la régulation d'accès.