https://github.com/andrewn/rfid-publisher
Publish RFID tag IDs over MQTT
https://github.com/andrewn/rfid-publisher
Last synced: 22 days ago
JSON representation
Publish RFID tag IDs over MQTT
- Host: GitHub
- URL: https://github.com/andrewn/rfid-publisher
- Owner: andrewn
- Created: 2013-07-05T15:59:50.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-07-05T16:06:17.000Z (almost 13 years ago)
- Last Synced: 2025-03-03T02:24:45.631Z (over 1 year ago)
- Language: JavaScript
- Size: 457 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RFID Publisher
A very small set of scripts to read a tag ID from an RFID reader, transmit it to a host computer over a serial interface and publish using the MQTT protocol.
## Equipment
You need:
- an [RFID reader](http://www.coolcomponents.co.uk/catalog/rfid-readerwriter-1356mhz-p-504.html)
- an [Arduino](http://www.arduino.cc/)-[compatible](http://shrimping.it/blog/) microcontroller
## Software
- Arduino IDE
- node js and npm
## Wiring it up
Connect up the Arduino like this:

See the `rfid-arduino.fzz` for the [Fritzing](http://fritzing.org/) file.
## Arduino sketch
Upload `rfid_sketch/rfid_sketch.ino` to your Arduino.
This will read an ID from the reader and send any cards it finds down the serial port.
## Host code
Connect the Arduino up to a computer and install the app's dependencies:
$ npm install
Then, run the app specifying what topic it should publish as and teh USB port the arduino is connected to:
$ MQTT_TOPIC=house/rfid USB_PORT=/dev/cu.usbserial-A600agbw node rfid.js
You should see the messages connecting to MQTT server and the serial port:
MQTT connected
open!
Placing a card on the reader should emit its ID, which you can read on the same topic e.g.
mosquitto_sub -h test.mosquitto.org -t "house/#" -v