Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. RFID Lock Sensor/Actuator (1.4)

RFID Lock Sensor/Actuator (1.4)

Scheduled Pinned Locked Moved Development
rfidpn532lock
12 Posts 10 Posters 9.2k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • hekH Online
    hekH Online
    hek
    Admin
    wrote on last edited by hek
    #1

    Here is a simple RFID reader/lock sensor. Add your tag ids to the sketch and use it for opening a door or starting a scene on your controller. Thanks @korttoma for supplying the hardware.

    The RFID tag sensor used

    Latest code is included in the examples folder of the MySensors library:
    https://github.com/mysensors/Arduino/tree/development/libraries/MySensors/examples/RFIDLockSensor

    https://codebender.cc/example/MySensor/RFIDLockSensor

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bandra
      wrote on last edited by
      #2

      @hek thanks for putting that together.

      I'm designing my new house at the moment and have planned to have a custom arduino-driven RFID reader at the front door. I was debating including it into the mysensors network.

      My current line of thinking is to connect it to my LAN and have it make a call back to the controlling system (Vera?). The controller has the list of valid cards and it then calls to the z-wave lock to tell it to disengage.

      There's two reasons doing it this way. It keeps the valid/invalid logic off the RFID arduino, making it harder for attackers to compromise the system. Also, the mysensors wireless network is not secure. Finally, it also makes it easier to program new cards, since I don't have to put a new sketch onto the RFID reader.

      However, I was thinking about making it easier to build anciliary systems, such as shed door, front gate, etc, and this sketch would be perfect.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        legeantvert
        wrote on last edited by
        #3

        Hi,
        I'm trying to make exactly the same thing with another reader, RC-522.
        I was using Mysensor 1.3 and that works for most things but without possibillity to change status from my Vera.
        So I decided to turn on 1.4.
        I've update my gateway, change the Vera files, delete all nodes and sensors related to Mysensors in Vera. (just keep the MySensorGW Module.

        And rewrite MyRFID code...

        The problem is this reader is only SPI... But I'm not sure this is here my problem...

        The code I'm using now:
        MYRFID.ino

        So the first problem is when using 1.4, I have make a test with DHT source code, launch node searching... This find 2 modules: One for temp and one for humidity... Those modules are working... I'm just surprized not to see the module "Arduino Node"...

        I ve tested with my code and launch node searching, this have just created me the Arduino Node Module and not the Lock module...

        When I check the serial debug information on my node I can see:

        Setup is starting Up
        sensor started, id 1
        send: 1-1-0-0 s=255,c=0,t=17,pt=0,l=15,st=ok:1.4b1 (18848a2)
        send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0
        send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=11,st=fail:MYRFID Lock
        send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,st=fail:1.0
        send: 1-1-0-0 s=1,c=0,t=19,pt=0,l=15,st=fail:1.4b1 (18848a2)
        Close lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:0
        RF24 initialized and GW contacted
        RFID Reader initialized
         
        ------- SETUP IS DONE --------
         
        Cardnumber Read : 151612433071
        Open lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:1
        Close lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:0
        send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
        Open lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:1
        Close lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:0
        Open lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:1
        Close lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:0
        Open lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:1
        Close lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:0
        send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
        Open lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:1
        Close lock
        send: 1-1-0-0 s=1,c=1,t=36,pt=2,l=2,st=fail:0
        Open lock
        

        So As I understand, as the Sensor node could not receive the ack from the GW, it change back the status of the lock...

        Did you have any recommandation? Idea?

        Thank you.

        Legeantvert

        -Oregon Scientific meteo sensors 433mhz
        -Vera3 fw:1.5.408fr
        -Zwave 3HSM02 1Duwi5457 2*AD142-6
        -IPX800v3
        -3 X Foscam
        -Synology DS413
        -Domoticz on Raspberry => on progress
        -MySensors Serial Gw + some arduino sensors => on progress

        1 Reply Last reply
        0
        • N Offline
          N Offline
          niccodemi
          wrote on last edited by
          #4

          @hek I uploaded RFID sketch to 3 nanos and I don't get any serial output - it just stays blank, even if I disconnect radio wires I don't receive "check wires" message. Same nanos work ok with other sketches. I am using latest Master library.

          1 Reply Last reply
          0
          • hekH Online
            hekH Online
            hek
            Admin
            wrote on last edited by
            #5

            If I remember you had to enable I2C mode on the module (dip switches). Did you do this?

            1 Reply Last reply
            0
            • N Offline
              N Offline
              niccodemi
              wrote on last edited by
              #6

              @hek , thanks, I never even realized there was a switch. It works now.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Spezialtrick
                wrote on last edited by
                #7

                Is it possible to update the following sketch to make it work with the current MySensors 1.4 release?

                https://github.com/wbcode/ham/blob/master/arduino/MySensorRFIDandRGB/SendRfidToGateway/SendRfidToGateway.ino

                That would be very great , because I am a Arduino beginner and not able to do it... :(

                It would offer me the opportunity to send the Tag/Card IDs to FHEM .

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  Dagwood08
                  wrote on last edited by
                  #8

                  I recently built a sensor using the code listed above and everything seems to work fine. However, I do have a problem with it recognizing one of my RFID tags as being valid. When I scan the tag it comes back with the key 0x33, 0x92, 0x94, 0x0, 0x00, 0x00, 0x00. I have included this key in the code for valid keys but the tag will not activate the lock since it's not being recognized as valid. I suspect the issue is with the 4th part of the key being 0x0 rather than 4 bytes. While I understand some programming, Arduino code is new to me and I'm also not fluent in hex codes.

                  Wondering if anyone can offer a simple solution.

                  Thanks.

                  1 Reply Last reply
                  0
                  • Mad MooM Offline
                    Mad MooM Offline
                    Mad Moo
                    wrote on last edited by
                    #9

                    Hello guys!

                    What do you think about security aspect? With simple equipment anybody can sniff your RFID tag code.
                    Wireless lock actuator sounds much worse... Thieves will be happy...

                    1 Reply Last reply
                    0
                    • miroM Offline
                      miroM Offline
                      miro
                      wrote on last edited by miro
                      #10

                      I have problem with this.

                      Nothing happends when tag is over the reader? I can´t see anything special in serial monitor.

                      Starting sensor (RNNNA-, 2.0.0)
                      TSM:INIT
                      TSM:RADIO:OK
                      TSM:FPAR
                      TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                      TSM:FPAR
                      TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                      TSM:FPAR
                      TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                      TSM:FPAR
                      TSP:MSG:SEND 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                      !TSM:FPAR:FAIL
                      !TSM:FAILURE
                      TSM:PDT
                      

                      Please help me someone.

                      1 Reply Last reply
                      0
                      • U Offline
                        U Offline
                        UC530
                        wrote on last edited by UC530
                        #11

                        Hello!
                        A little late but maybe this could help to somebody else...
                        !TSM:FPAR:FAIL
                        !TSM:FAILURE
                        You have no radio, or not connected properly.
                        Hope you corrected it already.

                        1 Reply Last reply
                        0
                        • cadetC Offline
                          cadetC Offline
                          cadet
                          wrote on last edited by
                          #12

                          Please modify code for mrc522 spi interface
                          This hardware cheaper
                          Thank you

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          19

                          Online

                          11.7k

                          Users

                          11.2k

                          Topics

                          113.1k

                          Posts


                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • MySensors
                          • OpenHardware.io
                          • Categories
                          • Recent
                          • Tags
                          • Popular