element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
EXPLORE-NFC
  • Products
  • Dev Tools
  • EXPLORE-NFC
  • More
  • Cancel
EXPLORE-NFC
Blog NFC or RFID Reader
  • Blog
  • Forum
  • Documents
  • Events
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join EXPLORE-NFC to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mcb1
  • Date Created: 5 Mar 2015 9:19 AM Date Created
  • Views 3367 views
  • Likes 5 likes
  • Comments 13 comments
  • 125khz
  • tag
  • explore-nfc
  • prox
  • nfc
  • transponder
  • arduino
  • micro_chip
Related
Recommended

NFC or RFID Reader

mcb1
mcb1
5 Mar 2015

NFC Reader

 

In my last posts

NFC What is it?

NFC Uses

 

I introduced NFC and explained how it worked in simplistic terms.


In this post I want to show how easy it is to use NFC or RFID readers and make them do something.



Common Terms


Reader

The term 'reader' if often used, but depending on the card/tag type and the software, many 'readers' are also capable of writing to RFID devices.


Card

The term card refers to a credit card sized RFID device which may or may not have a magnetic stripe.

Generally the card type tags have physically larger antenna and can work at a larger distance from the reader.


Cards can be printed on with advertising, use or anything else.

BUT if you print " xyz House " then it is the same as adding a tag on your keyring with you home address, so be secure.


Button, Tags, Stickers

These are all smaller tags made of different materials, and generally work at reduced distance.

Some are OTP (One Time Program), while others can be written to and have differing storage capacities.


Antenna

The antenna is the most important part of a reader.

It is tuned to the correct frequency and the ideal design has a very high Q to maximise the sensitivity.


Swapping antenna may be possible, but generally the manufacturer will offer antenna to suit that reader.

SO buying xyz's antenna to stick on abc's reader might not work.






EXPLORE-NFC

This is a very cost effective kit provided by NXP (Phillips for us who remember earlier times) and fits the Raspberry Pi.

EXPLORE-NFC


It is nice tidy hardware solution that suits certain 13.5MHz cards/tags and includes some very basic software.


I purchased one some time back and thought it would be great to use with my NFC Ring.

I hadn't actually used it until this conversation appeared, and the OP asked about the software.

card polling problem


It turns out the latest Raspbian distribution has 'broken' some of the previous examples of software.

NXP to their credit have provided a solution.

EXPLORE-NFC Software Download



The instructions have a couple of minor issues that have been passed back to NXP.

I note that element14 have not updated the Quick Start Guide.

Quick Start-up Guide for EXPLORE-NFC working with Raspberry Pi


sect 4.3 Number 5 is incorrect

while the instruction says
sudo dpkg -i libneardal<version>_armhf.deb
 
wiringpi<version>.deb
neard-explorenfc_<version>_armhf.deb

 

The contents of SW282711.zip are
libneardal0_0.14-1_armhf.deb
libwiringpi2-2.25-1_armhf.deb
neard-explorenfc_0.1-1_armhf.deb


NXP also spotted the instruction for launching was incorrect

Instead of starting the examples with the command “./explorenfc-<example name>”, it should be started with the command “explorenfc-<example name>”.


So well done for being so responsive and thanks to Dr Christian DeFeo  doctorcdf for assisting in getting it sorted.



So does it work. image

Well the new software does give you the ability to read a card/tag, but that is about it.


For a novice user, it leaves you dead in the water.

NXP even suggest downloading their Android App to program the card/tag, and quite frankly the Andriod Apps available on Play Store run rings around it.

(Don't ask about apple as I keep away from itoys)


The card supplied with the kit appears to be unprogrammed, so even the ability to read that is limited.


It is a shame that good affordable hardware is let down so badly by a lack of software to support it.


Any new person is going to look at it and decide to go elsewhere.

If they do buy and it leaves a bad taste, then it is likely they might avoid NXP products in the future (once bitten, twice shy image ).

Hence you have to make a good first impression, and since you have coupled this to Raspberry Pi, then chances are it is a novice who will be buying it.


At the very least something that reads the card and controls a GPIO pin would be the minimum example in python.

You don't need to change the hardware to incorporate it, just point the user at this.

PiFace SHIM GPIO Duplication Board for Raspberry Pi




SO are there alternatives image

There are a few other boards around for 13.5MHz, and some even use NXP chipsets.

Some have external antenna, and others are quite large and cumbersome looking.


I haven't tried any others, so linking to an unknown product won't help.


If you want to play, most smart phones have NFC and are very inexpensive.

It doesn't help you making a door lock, or similar but IMO using a RPi for that is a waste anyway.


If you look for a RFID board that uses serial then it will be suitable for other controllers.



125KHz Readers

There are many other readers available.

element14 has a few VERY expensive units, and a few tags, but the focus does appear to be 13.5MHz.


Luckily for us makers there is other sources.


Most readers use serial to send and receive the data, and for Arduino UNO/Nano/Pro, etc it is easer to use SoftSerial to keep the Tx/Rx pins free for programming and debugging.

Many readers require 5v, and for our project to assist the elderly, we used a boost converter to raise the LiPo 3.7v upto 5v.


image

     photo source 3 minions (me, myself and I)


In this image the reader is in the lower left, while the 5v out boost module is to the right.

The USB charger for the LiPo is on the right side, and an Arduino Nano is standing vertically.


image

          photo source 3 minions (me, myself and I)


This image shows the antenna attached to the bottom.

This unit was used to determine the read distance of the card and tag against various surfaces.


image

The block diagram shows the interconnection, and I've attached the sketch at the end.

The credit for putting it together along with the sketch goes to Morgan, who was also mentoring the students.



How does it work.? image

When the reader detects a card, it sends the information out the Tx pin.

The Arduino uses SoftSerial ( Arduino - SoftwareSerial ) to read Pin10 and process it.

In this case it matches the card number against 4 stored cards in the EEProm, and lights the appropriate LED.


If the card is not one of the 4 stored card numbers, then it cycles through each LED to indicate it did something.



Is that it.? image

Well yes it is that simple.

The rest of the circuitry simply provides a charging solution for the battery, and a booster to bring it up to 5v.

The design was a portable handheld reader, so the final production would be a single board and could be smaller.



What did the finished product look like.?

Sadly I didn't see the final product.

As I understand the students designed and 3D printed a holder which had 4 keys and the 4 LED's in a pocket/handbag sized package.


The students fitted swivels between the key and holder, so the key could be turned.

They also ensured the design would allow doors with a lock close to the door jam to work.


In all quite a bit of thought and engineering went into what at first glance seems a simple piece.




Care to share the code?

I've attached the code at the end of this to show how easy it is.

It needs some polishing for saving the tags, and flashing the LEDs, but the general concept is there to use in projects.

The code includes the connections, and the later versions of Arduino IDE include SoftSerial.


If you use an earlier version you can find it here

Arduino - SoftwareSerial





In the next post I'll detail a simple reader that drives a relay and a LED.

The intention is to include some options such as Latching ON v Momentary, and I'll look at using a 'master' card for programming.

In the meanwhile I'll have a think about what other options could be useful, and whether to include them as hardware options or software choices that you 'uncomment'.



Mark



Attachments:
Portable_Reader.ino.zip
  • Sign in to reply

Top Comments

  • michaelneurohr
    michaelneurohr over 10 years ago in reply to mcb1 +1
    Mark, thanks a lot for your feedback. That really helps us a lot! Michael
  • michaelneurohr
    michaelneurohr over 10 years ago in reply to mcb1

    Mark,

    thanks a lot for your feedback. That really helps us a lot!

     

    Michael

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 10 years ago in reply to 4ringfan

    4ringfan

    Mike

    Great link

     

    I might add it to the next post (please remind me if I forget)

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 10 years ago

    Thanks guys.

     

    I've been a little busy (and away) but I'm sorting out the next blog for the card access type use.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 10 years ago in reply to michaelneurohr

    michaelneurohr

    Michael

    Apologies for the delayed responce but I've been away (and with no internet).

     

    IMO having a simple example in python that controls a GPIO pin would suit the begineer.

    The hardware is well priced and very good, but without the easy software most novices just give up.

    something based on some control commands stored on the card?

    Ideally having one pin that flashes the LED to show a good/bad read, and another that can control a relay, opto-coupler, etc would get them started.

    Together with being able to see the card ID and program to use the ID would be a great compliment to the kitset.

     

    A simple acess control type application if you like.

     

    However the ability to respond to different data on the card would be a fantastic use of the capabilities. image

     

    Would you say, example code in C is a no go, or let's say a bad choice in the Raspberry Pi community?

    For your target audience C might be stretching it, but if you provided C as an example (with the python) you would cover both worlds.

     

     

    Many of us have come from a hardware background (rather than software) and moved from discrete components into micros .... so anything that eases the transition is a benefit. image

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 10 years ago in reply to neilk

    I guess that is why Mark has so many marks here. (pun intended)image No, seriously not only good blog, but well timed with current interest in the community.

    Kudos to down under,

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube