In this project I show how to setup RFID on a Raspberry Pi using Microsoft IOT Core. This project is coded in C# and will eventually make its way into Stronghold CMD to turn on and off the security system in my house. To see the how to video visit the link below. Enjoi
Source code for making the project work. Included are the MFRC522 Libraries from here:
How To Setup RIFD on Raspberry Pi using Microsoft IOT Core
In this Tutorial from Hobbyware.org I will show you how to how to setup an RFID Reader on Windows IOT Core, from start to finish. Some of the things we will go over will be: Products to Purchase, Hooking up the RFID and Installing the OS, the code, and what else you can do with the RFID sensor once you have a prototype.
The first things you will want to do is to buy a Raspberry Pi B 3+, or a Raspberry Pi Model B. I suggest picking up the model B 3 instead of the plus version is there is more support for this model. I will be using the plus version in this video, however I will go over the things that you need to make the B work as well.
I also suggest picking up a 5v power adapter and 16GB memory card, these can be bought as a kit to save the hassle of finding the compatible parts. If you are not buying as a kit then ensure that the parts are compatible with Windows IOT Core. The second thing that you need to buy is the RFID Reader MFRC522, a simple search yields plenty of results on amazon. You can buy from local DIY Tech suppliers as well, and they are cheap, around $5 - 10 dollars a piece.
The last thing you will want to do is pick up some female to female pin header connection cables of various colours. Again this is available on amazon and is quite cheap. If you don’t already have a soldering iron then you will need to get this as well along with some electronics solder. I don't suggest buying a low wattage soldering iron as they can be quite difficult to use effectively. Something around 60 watts should be sufficient.
Once you have your parts, Pull out the MFRC522 RFID board and solder the header to the board. Start by Plugging in or powering on the soldering iron and then applying water to the sponge. Once the soldering iron has reached temp, Tin the Tip of the soldering iron with solder, and then touch the Tip to the pin to be soldered. Ensure no two pins are inadvertently connected with a piece of solder, You can use a business card to keep the solder from transferring to another pin.
Next hook up the connections carefully in the following order, ideally use separate colours for each connection as this will allow you to identify the pins: >
This is a picture of the Pin Header on the Raspberry Pi, note pin 1 is Second from the Top on the left hand side when the USB and Network ports are on the Right. Pin two is directly above Pin 1 and Pin 3 is right of pin 1 and so on and so forth.
Before proceeding any further ensure you have correctly hooked up your Raspberry Pi to the MFRC522. Failure to do so will result in lots of various errors.
Now download Windows IOT Core Dashboard, a quick google search for this product name will get you what you need. You will need to do this on a computer which supports SD Cards.
Next if you are using a Raspberry Pi 3 B, download the latest version of the software and install though the Windows IOT Core Dashboard. If you are using a Raspberry Pi 3 B+ you will need to install insider preview build 17661 on the Raspberry Pi, it will not boot otherwise. Note that wireless and bluetooth will not work on this build of the software.
Once you have installed, boot up the raspberry pi, if successful you should get a rainbow screen followed by a windows loading screen.
Next is the code. You can download my project file and have a working project to use or you can do it yourself using the following links:
This guys post provides the whole library in one and you can copy and paste the code into it's own C# file.
Lastly is my code which will allow you to see the UID in question, and scan the tag multiple times over, which is available at the top of this page.
Finally, You will need to run the code, go to the properties of the project and Change the target device to remote machine, and type in the ip address of the raspberry pi, as displayed on the screen the raspberry pi is hooked up to. Next make sure the build type is configured to ARM. Then hit Play, with a little luck you will get a screen showing the application running on the Pi. Use google to troubleshoot any issues you are having. Using my application will streamline a path to success and you can modify from there.
You will know you hooked everything up correctly and the code is working if you get a RFID UID when you scan a tag. If you scan a tag and get repeating zeros, try to wait 10 seconds after the program loads before you scan, if you are still having issues use your troubleshooting skills, going over the video again may help you find success.
Congrats if you got a UID to show up! Now the next and the most interesting thing to think about is what can you do with your prototype? I built a case for mine to hold all the wiring and the electronics using sketchup. From there I will use the RFID to turn on and off a security system for my home. There are plenty of ideas you could create, dream BIG! Let me know what would be cool to make in the comments below… maybe it will be awesome enough for me to commit my time to.