element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
NFC/RFID
  • Challenges & Projects
  • Project14
  • NFC/RFID
  • More
  • Cancel
NFC/RFID
Blog LockNFC - firmware
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join NFC/RFID to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Fred27
  • Date Created: 16 May 2019 7:37 PM Date Created
  • Views 936 views
  • Likes 9 likes
  • Comments 3 comments
  • nfcrfidch
  • rfid
  • msp430fr2633
  • nfc
  • msp430
  • trf7970a
Related
Recommended

LockNFC - firmware

Fred27
Fred27
16 May 2019

Microcontroller-based hardware is just a PCB until you have some firmware running on it. Time to get it doing something. I'd already protyped both the capacitive touch keypad and the NFC reader firmware on a development board and I check that they ran together on my PCB when it came back from the fab. There was a lot of tidying up left to do.

 

I decide that I'd make the device battery powered. The MSP430 is designed to be low power and the locations I intended to use it weren't ideal for running mains power. I spent a lot of time making sure that the NFC reader wasn't wasting battery polling for a tag all the time. The keypad has a combination proximity sensor and guard channel - a concept I took from TI's guide. It mostly worked well, but I meant that I had to sweep by back of my hand over the key pad to be sure that it was trying to read my NFC implant. I wasn't entirely happy with this and it turned out that the TRF7970A in particular is fussy about power. I ran the device from 2 x AA batteries and found that whilst this was fine for the microcontroller (and the keypad) the NFC reader was unreliable. Maybe it wasn't in a powered down state as much as I thought it was? I poked around with the code. I switch 3 x 1.2V NiMH AAs to give 3.6V and still it seemed OK when tested but unreliable long term. I've parked the power saving for now and the NFC reader currently polls constantly. I get much better results and as you'll see in a later post, I solved the power problem a different way.

 

I decided to get my kids involved in the project. If you read the earlier blog posts you may remember that the keypad is for their benefit. They decided that they each wanted their own secret code. One wouldn't do. In order to make it easier to compare two variable-length passcodes with the last few key presses. it seemed easier to store and compare them from the end of the code. If I got to the start of any of the valid codes then I'd open the door. As they were reversed and zero-terminated, that's if I find a zero.

 

Whilst I intended to make my front door the first door to have this fitted, I decided that the garage door would be the simplest. All I had to do was simulate a button press. I've actually got two garage doors next to each other. I told the kids that there would be one code for one door and another code for another. My youngest the suggested that after a code is entered you could get a green light and then chose 1 or 2 for what door to open. I was more than happy to code this for them and they were pleased to see the result of the decision. My 5-year old then came up with the idea that as 1+2=3 maybe pressing 3 should operate both doors at the same time. OK - this is nothing groundbreaking. However, the joy of seeing his idea turned into code and then turned into action was just great for a dad. He's invested in the project and owns a part of it. This is how it begins! A blog post just talking about code is a little dry, so here's a video of me scanning my implant and then pressing "1" to open the door.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

There may be more code changes to come. I plan to allow new codes to be entered without having to take it off the wall and reflash it. I'm going with the agile philosophy though. Get the Minimum Viable Product out there and improve as and when you need to. As yet - nobody has wanted to change a code. Maybe I'll get round to it. Maybe not.

 

There's little else to do that publish the code (excluding the file with the secret codes in!). You're welcome to take a look.

https://github.com/FredMurphy/LockNFC.git

 

Next post - garage door >>

  • Sign in to reply

Top Comments

  • Fred27
    Fred27 over 6 years ago in reply to shabaz +3
    Sometimes he'll open the wrong door "by mistake" just so he can then trigger both and see one opening as the other closes. It's great to get him involved in a small way. He's now taking an interest in…
  • shabaz
    shabaz over 6 years ago +2
    Fantastic project. Also that feature to open both at the same time is both a logical conclusion and cool : ) Doesn't matter if only one door needed opening : ) I bet it puts a smile on his face every time…
  • luislabmo
    luislabmo over 6 years ago +1
    Gread project!. The Keypad/NFC reader has a very professional look. Luis
Parents
  • shabaz
    shabaz over 6 years ago

    Fantastic project. Also that feature to open both at the same time is both a logical conclusion and cool : ) Doesn't matter if only one door needed opening : )

    I bet it puts a smile on his face every time he sees it.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Fred27
    Fred27 over 6 years ago in reply to shabaz

    Sometimes he'll open the wrong door "by mistake" just so he can then trigger both and see one opening as the other closes. It's great to get him involved in a small way. He's now taking an interest in the micro:bit and I'm sure this had something to do with it.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Fred27
    Fred27 over 6 years ago in reply to shabaz

    Sometimes he'll open the wrong door "by mistake" just so he can then trigger both and see one opening as the other closes. It's great to get him involved in a small way. He's now taking an interest in the micro:bit and I'm sure this had something to do with it.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube