RFID Mass Key Finder

by Remysaurus in Circuits > Raspberry Pi

418 Views, 2 Favorites, 0 Comments

RFID Mass Key Finder

IMG_3658.jpeg

This is a modular key finder using RFID. It uses magnets to stick the keys to the board. The keys can be stuck on any magnet, and it can be found through a website. The website can be interacted with and turns on LEDs above the keys to indicate their locations. It is modular because any number of key hangers can be made. My program will take an input for how many readers are available and automatically makes a wiring plan to take the greatest advantage of the limited pins on the Raspberry Pi. It does this by connecting the readers in parallel and only having separate RST pins to wake each reader, as well as Charlieplexing the LED indicators to multiply how many can be separately turned on. I made this project because my dad owns a lot of apartment units, and he needs to get the find keys to them quickly.

Supplies

IMG_3560.jpeg
IMG_3636.jpeg
IMG_3543.jpeg
IMG_3664.jpeg
raspberry-pi-zero-w-2-543625391.jpg

General Raspberry Pi Setup

  1. If the header pins are not pre-soldered, solder them.
  2. Plug the Micro-USB power supply into the USB port on the right of the Pi; pretty much anything that has enough power to charge your phone will work.
  3. Connect Pi to monitor with HDMI; you will need to adapt it into Mini HDMI.
  4. Plug the USB splitter into the left Micro-USB port of the Pi using the Micro-USB to USB adapter.
  5. Connect a mouse and keyboard into the splitter.
  6. Insert Micro SD card into another computer. Install Raspberry Pi OS using these instructions.
  7. Go back to the Raspberry Pi.
  8. Set up a static IP address
  9. Open the LXTerminal by clicking on the icon in the top left and enter the following command:
sudo raspi-config
  1. Use the arrow keys to navigate to Interfacing Options and press enter. Enter the SSH and SPI menus and activate them once done:
sudo reboot

Software Setup

  1. Go to my GitHub to get the code to run this project.
  2. Click the green Code button and click Download ZIP.
  3. Open the Downloads folder
  4. Right click the ZIP file
  5. Right click and select Extract Here
  6. Open another terminal
cd /home/pi/Downloads/KeyFinder-main
sudo pip3 install -r requirements.txt
sudo apt install nodejs
sudo npm install
sudo python WriteBookInfo.py
  1. When prompted, type how may RFID readers you have.
  2. The program will return an explanation on how to wire that specific number of readers.
  3. Note it down
  4. Open two other terminal windows and put one command in each
sudo pynodered /home/pi/Downloads/KeyFinder-main/WriteBookInfo.py
sudo node-red
  1. Go to your Downloads folder
  2. open KeyFinder-main
  3. open flows.json
  4. copy it
  5. Open the web browser in the top left
  6. Go to localhost:1880
  7. Click the three lines icon in the top right
  8. Click import
  9. Paste in the box
  10. Click import
  11. Click deploy in the top right

Wiring

Screen Shot 2022-08-15 at 8.46.50 PM.png
IMG_3651.jpeg
  1. Open pinout.xyz for reference.
  2. Wire the RFID readers' MOSI, MISO, SCK, and SDA pins like in the first image.
  3. Follow the wiring instructions from the python script
  4. Note that the pin numbers in the wiring instructions are BCM numbers. On pinout.xyz, that is the number after the abbreviation GPIO.
  5. The numbers for the RFID readers correspond to which Raspberry Pi GPIO pin the RST pin of the reader should be connected to. The RST pin is the second one from the right between the VCC and GND.
  6. The number pairs for the LEDs show which Raspberry Pi GPIO pin the LED should be connected to. The first number of each pair is the Cathode connections, while the second is the Anode connection. The first pair represents the connections of the LED that should be placed above reader1, the second pair is the LED for reader2, and so on.

Assembly

IMG_3636.jpeg
IMG_3661.jpeg
IMG_3651.jpeg
IMG_3656.jpeg
IMG_3660.jpeg
IMG_3662.jpeg
IMG_3663.jpeg
  1. Get the cardboard about 64x48 cm and a cardboard lid at least 3 cm high.
  2. Glue the magnets where you want the keys to be
  3. Flip the cardboard
  4. Find where the magnets are on the other side and attach the RFID readers to those spots.
  5. Make sure to have the reader marked as 'reader1' is in the top right corner.
  6. Peel the adhesive off the breadboard and stick it on
  7. Tape the Raspberry Pi to the back.
  8. Poke holes above each reader and insert the LED through.
  9. Wires may need to be added to make this work.
  10. Attach the lid to the back with packing tape or some other material, covering electronics
  11. Get the RFID tags.
  12. Take the larger key ring off and glue it to the face of the tag
  13. Flip it back around to confirm LEDs are poking through
  14. Highlight the top left magnet to remind yourself that it is the input magnet.

Testing

  1. Go into your router settings. And set up port forwarding your public IP on port 1880 to the static IP of the Raspberry Pi you set in the first step on port 1880. Every router is different, so I have no specific instructions on how to do this.
  2. Open a browser on another computer and type in your routerPrivateIP:1880/ui
  3. Stick a tag to the top left magnet
  4. Type in desired details in the input form and submit
  5. Move the tag to another magnet
  6. If the details appear in the table under Keys List, then it is a success
  7. If something is not working, do some troubleshooting, and then if it is a program bug, open an issue on the Github repository.

Thank you for reading!

Appendix & References