RFID Lock Sensor/Actuator (1.4)


  • Admin

    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



  • @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.



  • 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.



  • @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.


  • Admin

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



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



  • 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 .



  • 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.



  • 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...



  • 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.



  • 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.



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


Log in to reply
 

Suggested Topics

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts