DIY NFC Lock UK

A few years ago,Donfire and I built a prototype NFC door lock for a standard British UPVC door. It’s been running reliably for four years, but now we’re looking to refine the design.

It’s a pancake stepper motor coupled to the thumb-turn axle of a euro cylinder lock barrel. It rotates upon receiving the correct UID via a PN532 or RC522 NFC reader, and can be used conventionally with a key.

While the system works perfectly, the prototype is made of stacked modules, which makes it look janky. our goal is to redesign it by combining the modules into a single PCB that directly fits onto the motor. Reduces the overall footprint and simplifies installation for a cleaner, more professional looking result.

The code is complete and functioning as intended for the new hardware. All modules and ICs have been dissected from the datasheets and incorporated into a single schematic.

  • Each module/IC is linked below the schematic for reference.
  • Components have been sourced (though they may need verification).
  • The PCB layout is done, with components placed and traces routed.

  • The motor mount and NFC reader enclosure have been designed and 3D printed.

Its at this point i tell you that I’d classify myself as an amateur who’s learned through YouTube tutorials, and the amazingly patient community here, i have no background in this industry and am doing this for my own personal benefit, so before I send the design to China for production, I’d love for more experienced eyes to review it for any mistakes or potential improvements. Specifically:

  1. Schematic Check: Are there any issues with the way I’ve incorporated the modules?
  2. Component Verification: Do the selected components match my use case, or are there better alternatives?
  3. PCB Layout Review: Is the trace routing and component placement optimal?

I’m incredibly grateful for the help and support I’ve received so far from the community. If you’re willing to take a look at the project, I’d greatly appreciate your feedback!

Thank you so much for your time, and feel free to ask if you need additional details or files, here is a Project link - Invite - EasyEDA - Online PCB design & circuit simulator

Chimpo

10 Likes

Hey,

I’m also a YouTube graduate for PCB design.

I use kicad for all my designs however the concept is the same.

I’m seeing a lot of Via’s with no traces leading to them. I’m assuming these are going to a ground plane? Where do the other side of these components go?

1 Like

C12 is the internal 5v stablising/decoupling cap. R11. Is a pull down. R13 is a sensing resistor. And c16 is a cap for the 12v line. All tied to gnd

Right, but if you look, there is no trace running from the pad to the ground via.

3 Likes

Oh shit yeh. well spotted!

1 Like

My apologies. Both the arse end of the components and the via join via the ground plain.(currently set to invisible )

1 Like

That may be just me not being familiar with Easyeda’s software it was just something i noticed.

So those Via’s that are near those components. what are their function? are they connecting components from the back layer to ground?

1 Like

Correct. Tried to make the loop to gnd short as possible

2 Likes

Gotcha.

See in Kicad you have to run each pad to the via directly using a trace. So looking at it and not seeing that trace going to the via to the groundplane kinda made me worry since i see a lot like that. like almost every component. Because i see the via there, i just see nothing connecting to it from either the front copper or the back copper.

1 Like

Ill post and image of top and bottom with ground plains visable when i get home.


as requested…

2 Likes

Okay this makes a lot of sense.

THAT IS ALOT OF COPPER. and as a result you are creating a lot of “parasitic capacetence”

I can see using a full ground plane but in your current setup your entire top and bottom unused areas are full ground planes. I guess i wasnt realizing how basically all of the board is copper. I guess this will work but you likely will have 2-3nf of capacetence if not more added to each component that hits your ground plane.

Note that i am by no means an EE and someone with that knowledge could chime in. Just with my amature knowledge i feel like you should have one layer dedicated to be your ground plane and keep the amount of copper limited to it.

3 Likes

Cool project!

Here are a few things I would check, note: I have some experience with PCB design but I’m not really a professional… and also some of those are more “good practice”, your board will work without them but it’s just not ideal:

  • Buzzer directly connected to ATTiny1616. The datasheet for the buzzer specifies a maximum current of 110mA which is a lot. The ATTiny1616’s absolute maximum I/O pin sink/source current rating is 40mA. The solution is simple, just use a transistor or mosfet :slight_smile:

  • Below R14 and R13 you have some ground fill not connected to anything. In the case of something like this it’s not really a big issue but a good practice is to either put a via at the end or just remove the ground plane there, to prevent it from acting like an antenna… Same on the top left corner of the board.

  • those are some really beefy motor traces! Not really an issue, just somewhat overkill when the 12V input trace is narrower :wink:

  • Stray little ground “trace” that’s actually a fill on pin 3 of the motor driver.

  • Right hand side of the board could use some vias to connect the top and bottom ground planes together.

  • Placement of the 3.3V regulator and the ATtiny is not great. The 3.3V rail runs across the entire board, and to make things worse, runs below one of the traces for the motor. Easy fix: run the trace across the other side of the cutout, better fix: move the ATTiny and regulator closer if possible.

  • Control signals to the motor driver also run under motor traces, again not great.

  • Try moving the inductor for the regulator (U21) to the right and minimize the loop. Even better, check the datasheet, and try following the recommended layout on page 19. Your layout is probably going to work since there’s not a huge load on it but it’s nice to do things right. Here’s a video about this… it’s in japanese but has english subtitles. Here’s an english one too https://www.youtube.com/watch?v=6AEUxY9QipI

Last question: just curious why an attiny?

5 Likes

some amazing feed back there, i really appreciate the time you have taken so far to look over the pcb, i will implement your recommendations, as for the attiny1616… it was cheap and and small .The pcb was alot more populated in its infancy. we toyed with a few ideas then when i saw the manufacturing costs, it got alot simpler, now we have a bit more space.

3 Likes

‘‘i feel like you should have one layer dedicated to be your ground plane and keep the amount of copper limited to it.’’ (Removed top pour)

‘‘Below R14 and R13 you have some ground fill not connected to anything’’ ,‘‘Same on the top left corner of the board.’’ (removed)

  • Stray little ground “trace” that’s actually a fill on pin 3 of the motor driver.(removed)

‘‘those are some really beefy motor traces!’’ (made smaller)

also added test points

not moved any parts yet :slight_smile:

1 Like

I feel like this was a mistake :slight_smile: high power devices like motors always deserve the beef.

4 Likes

removed buzzer , it will now be mounted in the reader providing feedback where it is needed.

moved non crucial pins about to remove any potential crosses.
moved most bottom traces to the top.

1 Like