presented by: kris magri stamps in class instructor
TRANSCRIPT
1
Presented By: Kris MagriStamps In Class [email protected]
www.parallax.com599 Menlo Drive Suite 100
Rocklin, CA 95765(916) 624 - 8333
Build and ProgramYour Own RFID Reader
2
WARRANTY
Parallax Inc. warrants its products against defects in materials and workmanship for a period of 90 days from receipt of product. If you discover a defect, Parallax Inc. will, at its option, repair or replace the merchandise, or refund the purchase price. Before returning the product to Parallax, call for a Return Merchandise Authorization (RMA) number. Write the RMA number on the outside of the box used to return the merchandise to Parallax. Please enclose the following along with the returned merchandise: your name, telephone number, shipping address, and a description of the problem. Parallax will return your product or its replacement using the same shipping method used to ship the product to Parallax.
14-DAY MONEY BACK GUARANTEE
If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a full refund. Parallax Inc. will refund the purchase price of the product, excluding shipping/handling costs. This guarantee is void if the product has been altered or damaged. See the Warranty section above for instructions on returning a product to Parallax. COPYRIGHTS AND TRADEMARKS This documentation is copyright 2006 by Parallax Inc. By downloading or obtaining a printed copy of this documentation or software you agree that it is to be used exclusively with Parallax products. Any other uses are not permitted and may represent a violation of Parallax copyrights, legally punishable according to Federal copyright or intellectual property laws. Any duplication of this documentation for commercial uses is expressly prohibited by Parallax Inc. Duplication for educational use is permitted, subject to the following Conditions of Duplication: Parallax Inc. grants the user a conditional right to download, duplicate, and distribute this text without Parallax's permission. This right is based on the following conditions: the text, or any portion thereof, may not be duplicated for commercial use; it may be duplicated only for educational purposes when used solely in conjunction with Parallax products, and the user may recover from the student only the cost of duplication. This text is available in printed format from Parallax Inc. Because we print the text in volume, the consumer price is often less than typical retail duplication charges. BASIC Stamp, Stamps in Class, Board of Education, Boe-Bot SumoBot, SX-Key and Toddler are registered trademarks of Parallax, Inc. If you decide to use registered trademarks of Parallax Inc. on your web page or in printed material, you must state that "(registered trademark) is a registered trademark of Parallax Inc.” upon the first appearance of the trademark name in each printed document or web page. HomeWork Board, Propeller, Ping))) Parallax, and the Parallax logo are trademarks of Parallax Inc. If you decide to use trademarks of Parallax Inc. on your web page or in printed material, you must state that "(trademark) is a trademark of Parallax Inc.”, “upon the first appearance of the trademark name in each printed document or web page. Other brand and product names are trademarks or registered trademarks of their respective holders.
3
DISCLAIMER OF LIABILITY
Parallax Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, or any costs of recovering, reprogramming, or reproducing any data stored in or used with Parallax products. Parallax Inc. is also not responsible for any personal damage, including that to life and health, resulting from use of any of our products. You take full responsibility for your BASIC Stamp application, no matter how life-threatening it may be.
INTERNET DISCUSSION LISTS
We maintain active web-based discussion forums for people interested in Parallax products. These lists are accessible from www.parallax.com via the Support → Discussion Forums menu. These are the forums that we operate from our web site:
BASIC Stamp – This list is widely utilized by engineers, hobbyists and students who share their BASIC Stamp projects and ask questions.
Stamps In Class® – Created for educators and students, subscribers discuss the use of the Stamps in Class educational products in their courses. The list provides an opportunity for both students and educators to ask questions and get answers.
Parallax Educators –Exclusively for educators and those who contribute to the development of Stamps in Class. Parallax created this group to obtain feedback on our educational products and to provide a forum for educators to develop and obtain Teacher’s Guides and other resources.
Translators – The purpose of this private list is to provide a conduit between Parallax and those who translate our documentation to languages other than English. Parallax provides editable Word documents to our translating partners and attempts to time the translations to coordinate with our publications. To join, email [email protected].
Robotics – Designed for Parallax robots, this forum is intended to be an open dialogue for robotics enthusiasts. Topics include assembly, source code, expansion, and manual updates. The Boe-Bot®, Toddler®, SumoBot®, HexCrawler and QuadCrawler robots are discussed here.
SX Microcontrollers and SX-Key – Discussion of programming the SX microcontroller with Parallax assembly language SX – Key® tools and 3rd party BASIC and C compilers.
Javelin Stamp – Discussion of application and design using the Javelin Stamp, a Parallax module that is programmed using a subset of Sun Microsystems’ Java® programming language.
ParallaxEFX – For animators, theatre prop builders, and those who create Halloween and other holiday displays using the ParallaxEFX product line.
Propeller Chip – Forum for those using the Parallax Propeller™ chip.
4
Radio Frequency Identification (RFID)
• Generic term for non-contacting technologies that use radio waves to automatically identify people or objects*
• An RFID system consists of a reader and one or more tags
• There really is no such thing as a "typical" RFID tag
• Different frequencies, types, styles…
* Material in this section is based on information provided by the RFID Journal (www.rfidjournal.com).
5
RFID Applications
• Access Control - Card access for doors• Payment Systems - Toll-bridge passes such as EZ-Pass and
FasTrak• Asset tracking - Tagging pallets or products in a warehouses
and stores• Package tracking – DHL and UPS
– Tag thermal printable labels• Implanting chips in pets for identification • Tagging livestock or wildlife for identification and tracking• Doggie door• Automobile key• Robot inventory for classroom• Smart shelves
6
The Reader
• Reader - Reads the data from the tag
• The reader can then send the data to a microcontroller, such as the BASIC Stamp
• Reader’s antenna transmits RF energy
• The tag responds with its unique ID number
7
The Tag• Combined microchip and antenna
• Stores a unique serial number
• Passive
– Does not contain power source or transmitter
– Converts radio wave energy from the reader into electricity that powers the tag.
– Tag sends back information by reflecting the electromagnetic waves
• Active
– Have their own power source and transmitter
8
Parallax / Grand Idea StudiosRFID Reader/Tags
• Reader designed specifically for these tags
• Tags passive, read-only
• Each tag contains a unique 10-character ID
• 1,099,511,627,776 possible combinations
• 2400 baud serial interface
• 5.0 V, 10 – 90 mA
9
Today’s Workshop
• Connect Homework Board and battery• Run a test program• Talk about the BASIC Stamp and the Homework
Board• Wire up the RFID Reader• Program 1 - Read IDs from the tags, and display on
your laptop• Wire up a speaker and LED• Program 2 – Access control with beeper and LED
indicator
BASIC Stamp HomeWork Board
You’ll also need:
Quick-StartParts
11
Quick-Start
Write a PBASIC program then
download it to the BASIC Stamp
Connect serial cable and battery to HomeWork Board
Connect serial cable to computer COM port.
Com
Attach adhesive rubber feet to the underside of your board
12
Test Program
1. Run the BASIC Stamp Editor Software
5. Click the ‘Run’
button
3. Click the PBASIC 2.5
button
2. Click the BASIC Stamp
2 Button
DEBUG "Hello!" END
4. Enter this program
Running the ProgramThe command:
Causes the BASIC Stamp to send a message to the Computer
DEBUG "Hello!" END
Click the ‘Run’
button
The Debug Terminal appears with a message sent by the BASIC Stamp
Press/release Reset
button to run the
program again.
1
Reset
(916 ) 624 -8333www.pa rallax inc.comwww.stam psinc lass.com
R ev A
S TA M PS CL A SSin
© 2002
Power
BASIC Stamp HomeW ork Board
P 15P 14P 13P 12P 11P 10P 9P 8P 7P 6P 5P 4P 3P 2P 1P 0
X2
X3
Vdd VssVin
2
Alkaline B
atteryP
ow
erc
ell
BASIC Stamp Microcontroller
HomeWork BoardHomeWork Board
Embedded BASIC Stamp 2
BASIC Stamp 2 BASIC Stamp 2 (BS2)(BS2)
• 16 I/O Pins16 I/O Pins
15
Prototyping Area with Breadboard
• Vdd = + 5 Volts
• Vss = GND = 0 Volts
• Vin = Battery Volts = 9 V
• 16 I/O Pins– Labelled P0..P15
• 5 Horizontal squares are connected in rows
• No connection across channel• No connection from black
headers to white breadboard
16
RFID Reader Connections
BASIC Stamp 2
RFID Reader
Vdd Vcc
I/O Pin #15
P15
/ENABLE
I/O Pin #14
P14
SOUT
Vss GND
17
Disconnect Your Battery!
• Before you build a circuit• Before you make changes to a circuit• Before you leave your board unattended
18
Wire up the RFID ReaderCheck your wiring carefully before going on!
19
Control the Reader with the BASIC Stamp program
• First, define the I/O pins in your code• Insert these lines above your DEBUG command
• Save your file – you will be adding to it
Enable PIN 15 RX PIN 14 DEBUG "Hello!" END
20
RFID Data Format
• How should we store the data coming from the RFID reader?
• The unique ID will be transmitted as a 12-byte ASCII string in the following format:
• We’ll store the 10 unique characters and throw away the start and stop byte
21
Define a place to hold the data Enable PIN 15 RX PIN 14 buf VAR Byte(10)
Define the baud rate Enable PIN 15 RX PIN 14 T2400 CON 396 ' 2400 baud buf VAR Byte(10)
22
Controlling the Reader
• Step 1
Set Enable Low to send a start signal
• Step 2
Receive serial data into RX pin
The BASIC Stamp receives 10 bytes of data.
• Step 3
Set Enable High to end the communication.
23
Add main code to control reader
Enable PIN 15 RX PIN 14 T2400 CON 396 ' 2400 baud buf VAR Byte(10) Main: LOW Enable SERIN RX, T2400, [WAIT($0A), STR buf\10] HIGH Enable
24
Display the data and repeatSave, then run your program
Enable PIN 15 RX PIN 14 T2400 CON 396 ' 2400 baud buf VAR Byte(10) Main: DO LOW Enable SERIN RX, T2400, [WAIT($0A), STR buf\10] HIGH Enable DEBUG STR buf, CR PAUSE 1000 LOOP
25
BASIC Stamp output to LED
' HighLowExample.bs2 ' {$STAMP BS2} ' {$PBASIC 2.5} HIGH 11 PAUSE 1000 LOW 11 END
LED Test Circuit Parts(1) LED – Green
(1) Resistor – 470 (yellow-violet-brown)
470 Yellow
VioletBrown
GoldS ilverorB lank
+
LED
470
Program 2 – Access Control SystemAdd Speaker and LED
26
LED Schematic and Wiring Diagram
P11
LED
Vss
X 3
P15P14P13P12P11P10P9P8P7P6P5
P3P4
P2P1P0
27
Add speaker and test
P15P14P13P12P11P10
P8P7P6P5P4P3P2P1P0
P9
X 2
X 3
V dd V ssV in
Vss
P9 +
'{$STAMP BS2}'{$PBASIC 2.5}
DEBUG “Test speaker...", CRFREQOUT 9, 1500, 2000DEBUG “Done."
f = 2000 Hz
duration = 1500 ms
= 1.5 s
I/O pin = P9
Vss
P9
28
Program 2 – Access Control System
“RFID SecuritySystem.bs2”
• Replace Tag1 & Tag3 DATA with your IDs • (We don’t have any Tag2 oval tags)• Try your tags on your reader and your neighbor’s reader• Customize your program using different sounds or devices
' -----[ EEPROM Data ]----------------------------
Tag1 DATA "0F0296C557"
Tag3 DATA "04158DBCF8"
29
Remember YourBasic Stamp HomeWork Board
Parallax CD
RFID Reader and Tags
Bags of electronic parts
Please Leave Behind
Batteries
Programming Cables
The Laptops
Have fun!!!