RaspberryPaws — RFID Microchip Scanner For Lost Pets

Noy Pearl
7 min readJul 22, 2023

--

TL;DR

I built Animal RFID scanner that shows you instantly the owner’s phone number (and a few other details) for lost dogs.

Pet’s name, age, (censored) owner’s phone No. + city are displayed

If you are in a hurry you can skip to the POC videos 1 2 or the github project

Why

Have you ever found a dog wandering around and wondered whether (s)he’s lost, sick, waiting for the owner or just vibing?

A few weeks ago I found a dog tied to an abandoned warehouse and had the exact same question in my mind. I had to search around the area for a while and make a few phone calls only to get an idea of whose that dog is.

Well, I knew that I had to get creative and solve this somehow. I built a tool for that which shows me the name, age, owner phone number and city of the dog — so I can even call the owners myself and notify them about their lost dog.

All I need is just my Raspberry Pi, animal chip scanner (RFID) and my phone (for hotspot) and I can walk around and scan lost dogs’ microchips.

I press a button, put the scanner close to the pet’s neck and after a few seconds I can get all the information that I needed and mentioned above.

A word about pets microchips

It’s very common that the owner of a pet implants a microchip - an identifying integrated circuit placed under the skin of an animal. The chip, about the size of a large grain of rice, uses passive radio-frequency identification (RFID) to identify an animal. Microchips can be implanted by a veterinarian or at a shelter. After checking that the animal does not already have a chip, the vet or technician injects the chip with a syringe and records the chip’s unique ID. No anesthetic is required, as it is a simple procedure and causes little discomfort; the pain is minimal and short-lived.

The chip acts as the identifier of the pet, so the ID of the chip is saved is a large database that contains other details alongside the ID — such as name of the owner, name of the pet, address of the owner/pet, phone No. of the owner, pet birth date and more.

When there’s a suspect that a pet is lost — the chip is a reliable way to learn about him/her and to find the owners.

What

Prerequisites:

  • A Raspberry Pi (RPi) — a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse
  • RaspberryPaws python project from my repository
  • A display to see the pet’s details. I used 0.91" display with this library
  • Pet microchip RFID scanner — I used this one
  • An animal that has a microchip implant
  • (Optional) — portable battery (to power up Raspberry and walk around). You can also power it with a laptop but it’ll look even more weird while walking, up to you.
  • (Optional) Hotspot enabled in your phone — so you can walk with your RPi
The RFID Animal Reader that I used

Here’s what actually happens in a nutshell

Diagram of the different components
  1. We scan the chip of the pet using the RFID chip Scanner while being connected to the RPi via bluetooth. The Scanner acts as a HID device — like a real keyboard that is connected to the RPi and after a successful chip scan — it sends the RFID value that we scanned as keystrokes to the RPi via Bluetooth. Make sure to pair the RPi and the Scanner together once before walking around — otherwise it won’t work.
Initial Bluetooth pairing RPi with the RFID Scanner (180 HID)

2. The RPi is running the scanner.py script — waiting for an input from the user.

RPi waiting for RFID tag from user input to send in POST request

The Scanner also sends a newline right after the RFID tag value, as input, which is exactly what we need in our script (we get the RFID value using the python input() function which requires newline). After we got the RFID from the Scanner we send it in a POST request to a national Dogs Registration Database website. It won’t work for pets that are not registered in Israel so you should modify the script for your own country’s registry website.

3. The website returns a lot of details about the dog — such as pet name, age and owner’s phone number. The RPi dumps all the information to a local file called data.txt for debugging, and also sends the mandatory fields’ text to the OLED display, so that’s how you can see it eventually:

Pet’s name, age, (censored) owner’s phone No. + city are displayed

The script runs our functions in a loop to listen for incoming inputs so you can scan more and more pets over and over again while walking around, without changing anything in your RPi.

*The RPi can send HTTP requests since I connected it to my phone’s hotspot, so I can walk around.

More about the project

Here’s a circuit design of the project. Notice that for simplicity I didn’t use a breadboard — I connected the OLED directly to the pins of the RPi so I’ll look more like a legit human while walking around town with it.

Other Photos

Prototyping how the tool will look like — initial screen
My dog asking for another treat after a long day of being an *Animal Microchip Carrier*

Important / funny / cool things to know

  1. Please don’t be creepy. The website of the Dogs Microchips Lookup exposes much more information than intended. I chose to display only the necessary pieces of data that I wanted from the API request, so please use this article only for positive & educational purposes.
  2. Initially I wanted to connect the RFID Scanner to Flipper Zero physically via SPI, so I tested the connection first with FTDI and my computer:
My failed attempts to connect via SPI

But the SPI communication attempts didn’t work — the computer didn’t detect the Scanner device, I guess that SPI communication wasn’t enabled as default (?) in the Scanner and I didn’t want to go through the hassle of debugging the Scanner’s chip / changing the firmware just to send the RFID to RPi.

So I fallbacked to RPi+Bluetooth which [kinda] worked “smoothly”.

(If someone has an idea how to enable SPI or want to go together through this journey please let me know, I’m up for challenges :) )

Also — here’s the manual of the Scanner that shows the different communication options.

RFID Scanner manual

3. My dog’s RFID chip that I scanned is FDX-B which is suitable with the international standard, and I think that it’s cool that there’s actually a standard for pets microchips all over the world.

4. If you want to implement this project yourself — you can clone the pet’s RFID tag to other tag / card and use it instead of your pet while debugging. My dog would have hated me if I scanned him for the whole day when I tried to make it work.

I used Flipper Zero just to clone the RFID tags and to write other Animal tags to other cards/tags and emulate them.

Writing invalid animal tag to RFID tag for debugging

5. I could connect the RFID Scanner via USB to the RPi, but 1 — during USB transfer ALL the scanned IDs that the Scanner has ever scanned are sent. And 2 — I have to press a button for 3 seconds to start the transfer which looks less cool for the POC.

Also — 10 hours into this project and I still didn’t think to increase the font in my 0.91" OLED, so you should hurry up and do this

POV: My eyes when trying to read the text from my OLED 0.91"

POC — Does it really work?

Here’s a video of me while nudging my dog, don’t worry — he was rewarded afterwards for helping me to write the script and act as the main star of the video

Scanning the RFID microchip tag of my dog

*No dogs were harmed, but according to his reaction it’s very possible that he just got tired of me and walked away, which is pretty common

Also — I tested the tool outside and scanned him and IT WORKED! I was connected my Hotspot from my phone, but the OLED display that I use is pretty cringy and it was difficult to see the text when I was outside when there was sun.

Walking around the neighborhood with the tool — waiting for scan

Here’s how the results looked like when I was outside.

Walking around the neighborhood — the OLED isn’t displayed well in the sun

I REALLY need to get a better display.

Here’s a video of an invalid tag (and an invalid animal) — that shows that the chip has to be a valid Animal RFID FDX-B chip AND to exist in the national animals registration website that I’m querying:

Scanning not-animal-RFID tag
I wrote non-animal-RFID data so that the scan will fail on purpose

link to the project in github

Any feedback will be appreciated!

--

--