nfc reader by philsson 3d model
3dmdb logo
Thingiverse
nfc reader by philsson

nfc reader by philsson

by Thingiverse
Last crawled date: 3 years, 1 month ago
Nfc reader using a RC522 and an ESP32 D1 mini with a couple of neopixel's ws2812. Software I'm using is esphome.
Example code. One light will pulsate while detecting a tag. Another light will shine with a different color for a different tag.
esphome:
name: nfc-scanner
platform: ESP32
board: wemos_d1_mini32

platformio_options:
lib_deps: NeoPixelBus@2.6.1

wifi:
ssid: "****"
password: "****"

# Enable Home Assistant API
api:

ota:

web_server:
port: 80

spi:
#sda: 5 # This pin is not used in the configuration but IS connected. Seems to
# be needed
clk_pin: 14
mosi_pin: 13
miso_pin: 12

rc522_spi:
cs_pin: GPIO15
reset_pin: 4

on_tag:
then:
- homeassistant.tag_scanned: !lambda 'return x;'

- light.turn_on:
id: partition_1
brightness: 50%
red: 50%
green: 70%
blue: 100%
- delay: 0.5s
- light.turn_off: partition_1

binary_sensor:
- platform: rc522
uid: D9-73-6D-C2
name: "RC522 RFID Tag"
on_press:
then:
- light.turn_on:
id: partition_2
brightness: 70%
red: 0%
green: 0%
blue: 100%
on_release:
then:
- light.turn_off: partition_2

- platform: rc522
uid: B3-A5-33-40
name: "RC522 RFID card"
on_press:
then:
- light.turn_on:
id: partition_2
brightness: 70%
red: 100%
green: 100%
blue: 100%
on_release:
then:
- light.turn_off: partition_2

light:
- platform: neopixelbus
#variant: WS2812
num_leds: 2
pin: GPIO16
name: "RGB strip"
id: rgb_led
default_transition_length: 0s

- platform: partition
name: "Partition Light 1"
id: partition_1
segments:
- id: rgb_led
from: 0
to: 0
- platform: partition
name: "Partition Light 2"
id: partition_2
segments:
- id: rgb_led
from: 1
to: 1
RC522 and ESP32 are held in place with double sided tape. The RC522 could also just be snapped into place. To hold the two neopixels I've used hot glue.

Tags