• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Kadaj · Dec 08, 2015 at 12:02 PM · unity5externalusbsensor

Connecting an external NFC reader with Unity

Hi all,

After much research on the subject, most solutions are oriented on the Android NFC detection.

However, I'd like connected an external NFC reader (the ACR122U) with Unity to my game publishing on desktop (Windows).

What I found most similar to my project is ShadowRealmVR. But, they use a NFC reader created with Arduino.

Do you have any ideas for just reading the NFC Tag with my external NFC reader into Unity?

Thanks for your help.

Kadaj

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image arilicious · Nov 30, 2016 at 02:08 PM 0
Share

push, any answers to this? im trying the same (same reader)

avatar image Kadaj arilicious · Dec 06, 2016 at 11:19 AM 0
Share

Hi Arilicious,

No, unfortunately, I've finally buy an Arduino with a NFC shield to communicate simply with Unity.

$$anonymous$$adaj

avatar image arilicious Kadaj · Dec 06, 2016 at 01:15 PM 0
Share

Hey $$anonymous$$adaj,

thanks for your reply, even if you had no success with the ACR122U - imo the SD$$anonymous$$ and their examples.. just dont work properly. I also just ordered the RC522 RFID Reader to use it with an Arduino

Show more comments
avatar image wildbytesDev · Aug 27, 2019 at 02:09 PM 0
Share

Hey @$$anonymous$$adaj ! we're trying to do the same thing. Did you find a solution?

thanks!

avatar image Kadaj wildbytesDev · Aug 27, 2019 at 06:31 PM 0
Share

Hi @wildbytesDev ! Unfortunately no... I finally took an Arduino with a NFC shield.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by crazyrems · Aug 28, 2019 at 09:02 AM

I managed to make a Unity app that reads a tag from a ACR122U card reader.

My solution relies on a third part dll (https://github.com/g-rad/Lando)

I managed to build that dynamic library from Visual Studio. This gives me the Lando.dll file.

Then I imported the file into my Unity project.

 using Lando;

I can use an instance of it

 this.cardReader = new Lando.Cardreader();

It works with delegate methods

 private void CardReader_CardConnected(object sender, CardreaderEventArgs e)
 {
     Debug.Log(e.Card.Id);
 }

…and then

 this.cardReader.CardConnected += CardReader_CardConnected;

Now your reader can respond to reading a card asynchronously, but you still need to turn on and off the reading.

 this.cardReader.StartWatch();
 // you can read your tags now!
 ...
 this.cardReader.StopWatch();
 // read is over…

Don't forget to dispose of your card reader so you can use it later in the application lifetime.

 this.cardReader.Dispose();

The downside of this library is that I can only read the tag identifiers and not their content. I bypassed that limitation by creating different files the app reads at runtime to identify the nature of the IDs.


You may need to change the C# subset from the player settings.

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Charlin1712 · Feb 19, 2020 at 03:04 AM 0
Share

Hi!, i try to make a build too in visual studio, but visual show me two errors in the code and i cant solution it, can you share de dll dynamic library pls? :D

avatar image crazyrems Charlin1712 · May 05, 2020 at 10:04 AM 0
Share

Are you still looking for that dll?

avatar image tieum67 crazyrems · Jul 09, 2020 at 10:23 AM 0
Share

hello, i'm having the same issue to build the dll. Could you share it please ?

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Make a motor turn in real life. 0 Answers

Can unity send an output to an external device? 2 Answers

Possible to use an external camera (USB) while running on Android? 1 Answer

Can I connect real-android-device with USB port and access 127.0.0.1 IP? 0 Answers

Custom Sensor integration 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges