RFID
RFID (Radio Frequency Identification, nhận dạng bằng sóng vô tuyến) là một phương pháp nhận dạng tự động dựa trên việc lưu trữ dữ liệu từ xa, sử dụng thiết bị thẻ RFID và một đầu đọc RFID
1, Mô tả:
– Radio Frequency Identification (RFID) là công nghệ nhận dạng đối tượng bằng sóng vô tuyến. Hai thiết bị này hoạt động thu phát sóng điện từ cùng tần số với nhau. Các tần số thường được sử dụng trong hệ thống RFID là 125Khz hoặc 900Mhz
- Sử dụng hệ thống không dây thu phát sóng radio. Không sử dụng tia sáng như mã vạch.
- Thông tin có thể được truyền qua những khoảng cách nhỏ mà không cần một tiếp xúc vật lý nào.
- Có thể đọc được thông tin xuyên qua các môi trường, vật liệu như: bê tông, tuyết, sương mù, băng đá, sơn và các điều kiện môi trường thách thức khác mà mã vạch và các công nghệ khác không thể phát huy hiệu quả.
2, Cấu tạo:
Một thiết bị hay một hệ thống RFID được cấu tạo bởi hai thành phần chính là thiết bị đọc ( reader) và thiết bị phát mã RFID có gắn chip hay còn gọi là tag. Thiết bị đọc được gắn antenna để thu- phát sóng điện từ, thiết bị phát mã RFID tag được gắn với vật cần nhận dạng, mỗi thiết bi RFID tag chứa một mã số nhất định và không trùng lặp nhau.
3, Nguyên lý hoạt động:
Thiết bị RFID reader phát ra sóng điện từ ở một tần số nhất định, khi thiết bị RFID tag trong vùng hoạt động sẽ cảm nhận được sóng điện từ này và thu nhận năng lượng từ đó phát lại cho thiết bị RFID Reader biết mã số của mình. Từ đó thiết bị RFID reader nhận biết được tag nào đang trong vùng hoạt động.
4, Độ bảo mật và tin cậy:
Thẻ chip (tag) RFID chứ rất nhiều mã nhận dạng khác nhau, thông thường là 32bit tương ứng với hơn 4 tỷ mã số khác nhau. Ngoài ra khi xuất xưởng mỗi thẻ chip RFID được gán một mã số khác nhau . Do vậy khi một vật được gắn chip RFID thì khả năng nhận dạng nhầm vật đó với 1 thẻ chip RFID khác là rất thấp, xác suất là 1 phần 4 tỷ.
Với ưu điểm về mặt công nghệ như vậy nên sự bảo mật và độ an toàn của các thiết bị ứng công nghệ RFID là rất cao.
Module RFID RC522
Điện áp hoạt động: 3.3V 13-26mA
Dòng tiêu thụ ở chế độ Stand by: 3.3V 10-13mA
Sleep-mode: <80uA
Tải tối đa: 30mA
Tần số hoạt động: 13.56Mhz
Khoảng cách đọc: 0 – 60mm
Giao thức truyền thông: SPI
Tốc độ dữ liệu tối đa: 10Mbit / s
Kích thước: 40 x 60 mm
Nhiệt độ hoạt động: -20 đến 80 ° C
Độ ẩm hoạt động: 5% -95%
Tốc độ cao SPI: 10Mbit / s
HỖ TRỢ ISO / IEC 14443A /MIFARE

1: SDA(CS)-Chân lựa chọn chip khi giao tiếp SPI( Kích hoạt ở mức thấp)
2: SCK-Chân xung trong chế độ SPI
3: MOSI(SDI)-Master Data Out- Slave In trong chế độ giao tiếp SPI
4: MISO(SDO)-Master Data In- Slave Out trong chế độ giao tiếp SPI
5: IRQ – Chân ngắt
6: GND – Chân mass
7: RST – Chân reset module
8: Nguồn 3V3
#include <16F877A.h>
#device ADC=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used FOR I/O
#use delay(crystal=20000000)
#define DELAY 10
#define LCD_ENABLE_PIN PIN_E2
#define LCD_RS_PIN PIN_E0
#define LCD_RW_PIN PIN_E1
#define LCD_DATA4 PIN_D4
#define LCD_DATA5 PIN_D5
#define LCD_DATA6 PIN_D6
#define LCD_DATA7 PIN_D7
#include <lcd.c>
char key[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
char writeData[] = "TNT";
#define MFRC522_CS PIN_B3
#define MFRC522_SCK PIN_C3
#define MFRC522_SI PIN_C5
#define MFRC522_SO PIN_C4
#define MFRC522_RST PIN_B4
#include<Built_in.h>
void main(){
CHAR UID[6];
UNSIGNED int TagType;
CHAR size;
CHAR i;
lcd_init ();
printf (LCD_PUTC, "\f Test RFID\nPIC 16/18 Basic Kit");
delay_ms (1000) ;
printf (LCD_PUTC, "\fInitializing");
MFRC522_Init ();
printf (LCD_PUTC, "\nDone!");
WHILE (true){
IF (MFRC522_isCard (&TagType)){
printf (LCD_PUTC, "\fTAG TYPE:");
printf (LCD_PUTC, "%X",TagType);
//Read ID
IF (MFRC522_ReadCardSerial (&UID)){
printf (LCD_PUTC, "\nUID: ");
FOR (i = 0; i < 5; i++){
printf (LCD_PUTC, "%X",UID[i]);
}
size = MFRC522_SelectTag (&UID);
IF (MFRC522_Auth (PICC_AUTHENT1A, 7, &key, &UID) == 0){ //authentication key A
//Write data to block 1
lcd_gotoxy(13,1);
MFRC522_Write (1,&writeData);
printf (LCD_PUTC, "W-A!");
}
else IF (MFRC522_Auth (PICC_AUTHENT1B, 7, &key, &UID) == 0){ //authentication key B
//Write data to block 1
lcd_gotoxy(13,1);
MFRC522_Write (1,&writeData);
printf (LCD_PUTC, "W-B!");
}
ELSE{
lcd_gotoxy(13,1);
printf (LCD_PUTC, "W-Err!");
CONTINUE;
}
IF (MFRC522_Read (4,&writeData) == 0){
printf (LCD_PUTC, "\n%c", &writeData);
}
//Ngu dong
MFRC522_Halt () ;
}
}
}
}
RTC DS1307
DS1307 là chip thời gian thực hay RTC (Read time clock). Đây là một IC tích hợp cho thời gian bởi vì tính chính xác về thời gian tuyệt đối cho thời gian : Thứ, ngày,tháng, năm, giờ, phút, giây. DS1307 là chế tạo bởi Dallas. Chip này có 7 thanh ghi 8 bit mỗi thanh ghi này chứa : Thứ , ngày, tháng, năm, giờ , phút, giây. Ngoài ra DS1307 còn chứa 1 thanh ghi điều khiển ngõ ra phụ và 56 thanh ghi trống các thanh ghi này có thể dùng như là RAM. DS1307 được đọc thông qua chuẩn truyền thông I2C nên do đó để đọc được và ghi từ DS1307 thông qua chuẩn truyền thông này. Do nó được giao tiếp chuẩn I2C nên cấu tạo bên ngoài nó rất đơn giản. Ví dụ 1 dạng đóng vỏ của DS1307 như sau :


Trên là hai dạng cấu tạo của DS1307. Chip này có 8 chân và chúng ta hay dùng là dạng Dip và các chân nó được mô tả như sau :
+ X1 và X2 là đầu vào dao động cho DS1307. Cần dao động thạch anh 32.768Khz.
+ Vbat là nguồn nuôi cho chip. Nguồn này từ ( 2V- 3.5V) ta lấy pin có nguồn 3V. Đây là nguồn cho chip hoạt động liên tục khi không có nguồn Vcc mà DS1307 vẫn hoạt động theo thời gian
+ Vcc là nguồn cho giao tiếp I2C. Điện áp cung cấp là 5V chuẩn và được dùng chung với vi xử lý. Nếu mà Vcc không có mà Vbat có thì DS1307 vẫn hoạt động bình thường nhưng mà không ghi và đọc được dữ liệu.
+ GND là nguồn Mass chung cho cả Vcc và Vbat
+ SQW/OUT là một ngõ ra phụ tạo xung dao động (xung vuông). Chân này tôi nghĩ không ảnh hưởng đến thời gian thực nên chúng ta không sử dụng chân này trong thời gian thực và bỏ trống chân này!
+ SCL và SDA là hai bus dữ liệu của DS1307. Thông tin truyền và ghi đều được truyền qua 2 đường truyền này theo chuẩn I2C

Một module DS1307 kèm Pin trên thị trường:

#include <16F877A.h>
#device *=16 ADC=10
#use delay(clock=20000000)
//////////Khai bao
#FUSES NOWDT, HS, NOPUT, NOPROTECT, NODEBUG, NOBROWNOUT, NOLVP, NOCPD, NOWRT
#use i2c(Master, sda = PIN_A1, scl=PIN_A2)
#use FIXED_IO( D_outputs=PIN_D7,PIN_D6,PIN_D5,PIN_D4 )
#use FIXED_IO( E_outputs=PIN_E2,PIN_E1,PIN_E0 )
#include "lcd.c"
#include "RTC.c"
#define Slave_add 0x68
#define Read 1
#define Write 0
void send(int8 a);
int8 sec,min,hrs,day,month,yr,dow;
void main(){
enable_interrupts(INT_EXT); //cho phep ngat RB0
ext_int_edge(0,H_TO_L); //dat suon ngat
enable_interrupts(GLOBAL); //cho phep ngat toan cuc
LCD_init(); //Khoi tao LCD.
delay_ms(10);
ds1307_init(); // khoi tao DS1307, tao xung 1Hz o chan 7 DS1307.
ds1307_set_date_time(12,4,12,5,12,59,10); /// Cai thoi gian bat dau dem
while(true){
ds1307_get_date(day,month,yr,dow); ///Lay du lieu thoi gian
ds1307_get_time(hrs,min,sec); /// Lay du lieu
//Truyen len LCD
LCD_PutCmd(0x80);
LCD_PutChar(hrs/10+48);
LCD_PutChar(hrs%10+48);
LCD_PutChar(":");
LCD_PutChar(min/10+48);
LCD_PutChar(min%10+48);
LCD_PutChar(":");
LCD_PutChar(sec/10+48);
LCD_PutChar(sec%10+48);
LCD_PutChar(" " );
LCD_PutChar(day/10+48);
LCD_PutChar(day%10+48);
LCD_PutChar(45);
LCD_PutChar(month/10+48);
LCD_PutChar(month%10+48);
}
}
Nguồn: Mualinhkien.vn
Nice weblog here! Also your web site lots up fast! What web host are you using?
Can I get your affiliate hyperlink in your host? I desire my website loaded up as fast as
yours lol
Have you ever considered publishing an e-book or guest authoring on other websites?
I have a blog based upon on the same ideas you discuss and would
love to have you share some stories/information. I know my readers would appreciate your work.
If you are even remotely interested, feel free to send
me an e mail.
I all the time emailed this webpage post page to all my contacts, as if like to read it after that my links will
too.
Today, I went to the beach front with my children. I found
a sea shell and gave it to my 4 year old daughter
and said “You can hear the ocean if you put this to your ear.” She
placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this
is entirely off topic but I had to tell someone!
I’m not that much of a internet reader to be honest but your
blogs really nice, keep it up! I’ll go ahead and bookmark
your website to come back in the future. Many thanks
Hi there it’s me, I am also visiting this site daily, this web site is genuinely nice and
the viewers are genuinely sharing nice thoughts.
Hmm is anyone else encountering problems with the images on this blog loading?
I’m trying to determine if its a problem on my end or if it’s the blog.
Any feedback would be greatly appreciated.
Every weekend i used to go to see this website, because i wish for
enjoyment, as this this web site conations truly pleasant funny data too.
Your style is really unique in comparison to other people I have read stuff from.
I appreciate you for posting when you have the opportunity,
Guess I will just bookmark this page.
Hello my family member! I wish to say that this article
is amazing, nice written and come with approximately all vital infos.
I’d like to look more posts like this .
Heya i’m for the first time here. I came across this board and I find
It really useful & it helped me out a lot. I hope to give something back and aid others like you aided me.
Nice blog here! Also your website loads up fast!
What web host are you using? Can I get your affiliate
link to your host? I wish my web site loaded up as fast as yours lol
Your style is very unique compared to other folks I have
read stuff from. Thanks for posting when you’ve got the opportunity, Guess I’ll just bookmark this web site.
When I originally left a comment I seem to have clicked the -Notify
me when new comments are added- checkbox and now every time a comment is added I receive 4
emails with the same comment. There has to be an easy method you can remove me from that service?
Many thanks!
Hi there! I know this is kinda off topic however
, I’d figured I’d ask. Would you be interested in exchanging links or
maybe guest writing a blog post or vice-versa? My blog addresses a lot of the
same topics as yours and I think we could greatly benefit from each other.
If you’re interested feel free to send me an e-mail.
I look forward to hearing from you! Wonderful blog by the way!
Hi my loved one! I wish to say that this article is awesome,
great written and come with almost all significant infos. I’d like to look more posts like this .
Here is my web page; idn poker online
Greetings! Very helpful advice in this particular post!
It’s the little changes that will make the largest changes.
Thanks a lot for sharing!
Hey would you mind letting me know which
hosting company you’re utilizing? I’ve loaded your blog in 3 completely different internet browsers and I must say this blog loads a lot
faster then most. Can you suggest a good internet hosting provider at a honest price?
Thanks, I appreciate it!
my blog post – https://gonebeachin.com/groups/gas-mileage-in-trucks-having-the-best-within-your-pickup/
I believe this internet site has got some very fantastic info for everyone :D.
Feel free to visit my web site: pathta.jp
Hi everyone, it’s my first pay a visit at this website, and piece of writing
is really fruitful for me, keep up posting
these types of articles or reviews.
Feel free to visit my web page :: entertainers.cafe24.com
I’m really еnjoying the design and layout of your blog.
It’s a very eaѕy on the eyes which makes it much more pleaѕant fօr me to come
һerе and visit more often. Did yοu hire out a developer to ceate youг theme?
Excellent work!
This is really attention-grabbing, You are a very skilled blogger.
I have joined your feed and stay up for looking for extra of
your wonderful post. Also, I’ve shared your web site in my social
networks
Review my blog post :: https://freeglobalclassifiedad.com
Lovely just what I was searching for. Thanks to the author for taking his clock
time on this one.
Also visit my blog post … http://www.physics-s3.org.uk
This paragraph will assist the internet viewers for building up new blog or even a weblog from start to end.
Wow! At last I got a web site from where I know how
to actually obtain useful facts regarding my study and knowledge.
my page :: dominogaple.net
It’s actually a cool and helpful piece of information. I am satisfied that you simply shared this useful information with us.
Please stay us informed like this. Thanks for sharing.
We’re a group of volunteers and opening a new scheme
in our community. Your site offered us with helpful info to paintings on.
You have performed an impressive job and our entire group can be thankful to you.
Feel free to surf to my web site freeholmes.com
For most recent news you have to go to see world wide web and on the web
I found this website as a best website for most recent updates.
Here is my website … http://prahacom.cz/
You are so aѡeѕ᧐me! I dо not think I have rеаⅾ thrⲟugһ a single thіng like thhis before.
So great too discover someЬody with some originjal thoughts on this topic.
Reɑlly.. thanos foг starting this up.Tһis web site is one thing
that is requireⅾ on the web, someone wіth a bit off ߋriginality!
If some one needs to be updated with most up-to-date technologies afterward he must be visit this site and be
up to date daily.
Also visit my web blog: https://kebe.top/viewtopic.php?id=767481
What’s up all, here every one is sharing these kinds of experience, so it’s
fastidious to read this blog, and I used to go
to see this website everyday.
Here is my web blog … http://www.africatopforum.com
Hi i am kavin, its my first occasion to commenting
anywhere, when i read this paragraph i thought i could also make comment due
to this sensible article.
Feel free to visit my webpage :: https://anatomieunesco.org
Very great post. I simply stumbled upon your weblog and wanted to mention that I’ve truly enjoyed browsing your blog posts.
After all I’ll be subscribing for your feed and I am hoping you write again very
soon!
Thank you for the blog post. Brown and I are actually saving for a new publication on this matter and your
post has made us all to save money. Your ideas really responded all our
inquiries. In fact, a lot more than what we had known in advance of the time we stumbled on your superb blog.
My spouse and i no longer nurture doubts and a troubled mind because you have really attended to each of
our needs above. Thanks
My blog: http://bgmobile.eu
I blog often and I really appreciate your content.
Your article has really peaked my interest. I
am going to bookmark your site and keep checking for new details about once a week.
I opted in for your Feed too.
Visit my website: http://www.sixfigureclassifieds.com
You really make it seem so easy with your presentation but I find this matter
to be actually something which I think I would never understand.
It seems too complex and extremely broad for me.
I’m looking forward for your next post, I will try to get the hang of it!
Saved as a favorite, I really like your site!
my blog http://www.soulmta.infora.hu/index.php?action=profile;u=285194
Hello, I enjoy reading through your article post.
I wanted to write a little comment to support you.
Feel free to visit my web site … risolvesmart.com
I used to be recommended this blog through
my cousin. I am now not sure whether this publish is
written by means of him as nobody else recognise such specified approximately my problem.
You’re incredible! Thanks!
Take a look at my blog post :: xe888 apk
Have you ever considered about adding a little bit more than just your articles?
I mean, what you say is important and all. But think about if you added some great pictures or
videos to give your posts more, “pop”! Your content is excellent but
with pics and videos, this website could certainly be one of the very best in its
niche. Fantastic blog!
Remarkable issues here. I am very satisfied to peer
your post. Thank you a lot and I am having a look forward
to contact you. Will you kindly drop me a mail?
Do you have a spam problem on this blog; I also am
a blogger, and I was curious about your situation; many of us have created some nice procedures and we are looking to exchange solutions with others,
please shoot me an e-mail if interested.
Also visit my web blog https://www.mademental.co.uk/forum/index.php?action=profile;u=138152
Hi there to every body, it’s my first visit of this blog; this webpage includes amazing and truly good
material in support of readers.
Greetings! Very useful advice within this article! It’s
the little changes that produce the most significant changes.
Many thanks for sharing!
Incredible quest there. What happened after? Good luck!
Stop by my blog post – deposit pulsa tanpa potongan
Greate post. Keep writing such kind of info on your page.
Im really impressed by your site.
Hello there, You have done an excellent job. I’ll definitely digg it and for my part recommend to my friends.
I’m confident they will be benefited from this web site.
You need to take part in a contest for one of the most useful websites on the net.
I will highly recommend this site!
Simply wish to say your article is as astounding. The clarity to
your post is simply cool and that i could assume you’re knowledgeable on this subject.
Well along with your permission allow me to grasp your
RSS feed to keep updated with imminent post. Thank you a million and please keep up the gratifying work.
My site; https://ads.wealthxo.com
I enjoy reading an article that can make people think.
Also, many thanks for allowing me to comment!
Visit my web blog – http://returngain.com/forum/index.php?action=profile;u=16926
certainly like your web site but you have to take a look at the spelling on several of your
posts. Several of them are rife with spelling problems and I find it very bothersome to tell the truth
nevertheless I will certainly come again again.
Hi! I know this is kind of off topic but
I was wondering if you knew where I could find a captcha plugin for
my comment form? I’m using the same blog platform as yours and I’m having
trouble finding one? Thanks a lot!
My web-site; slotpulsa77.xyz