iButton lock with PIC12F

An iButton I had on stock for many years. This will act as the key to the door/box/closet/whatever you're planning to lock.
This is going to be a re-make of my instructables project, because the Eagle files i used to make the PCB for the old project was simply lost. With that being said, this description is going to be even better - I got better at this since I first published my instructable in 2013.
I will be using Altium Designer for this project, and will stick to a PIC12 series controller, but not necessarily PIC12F683. I will use what I have in stock and has the required hardware peripherals packed inside. I still consider my old instructable descriptions valid, so in hope that I wont get flagged as a plagiarist I will copy many segments from the instructable page.
A list of what you will need:
• PIC12F683 or similar controller (must have EEPROM)
• iButton (DS1990) and iButton socket
• Resistors, capacitors, transistors and diodes
• Soldering iron and consumables for assembly
• PCB and tools for manufacturing it (you can also order these from NextPCB)
• A PicKit or ICD for programming the controller
• MPLAB X and XC8 compiler
Well, let's get right to it. The first step is to figure out what we actually want to build. In this case, we want to surround a microcontroller with electronics to accomplish a simple thing - lock stuff. Electromagnetic latches are common, so if we provide a relayed output, audible and visible feedback and buttons to record or delete keys, we're good. The very simple schematic I came up seven years ago doesn't include a relay, so I will make a completely new design directly in Altium Designer. We also need an LDO regulator in order to have some flexibility with the input power supply voltage rating.
The basic schematic can be seen on the below image. The LDO is 26V/0.5A rated which is more than enough for this circuit - it's something I had left from another project a the time of revisiting this project. This time around the thing also powers the relay itself, it's not just a low-side driver as it was in the previous iteration. There weren't any other significant changes made in comparison to the old project - the same parts were used. To provide more information about the exact part numbers, I will publish a bill of materials towards the end of this article.

Once the schematic is complete, we can move to PCB design. This project is rather simple, routing the PCB takes an hour, maybe two. I began by placing the connectors on the edges and everything else inside a small-as-possible rectangle. The size of this rectangle was about 30 x 65 mm. After a bit of arrangement I came up with the final component placement, this is the one you can see on the image below.
I didn't add a PIC programming header onto the board, I already have the code written and compiled into a HEX file. I will just solder some wires to the programming pins or snap a SO8 adapter clip onto the chip and flash from MPLAB X. One less component we need to worry about.



At this point you have quite a few options. You can either chose to buy a kit, buy the production files, click on quick links to buy the PCB from NextPCB (you will have to source the components yourself) or you can just make yourself a PCB. For the sake of those who never made a PCB I will describe the toner transfer method in a couple of steps - it's very easy and you only need a lase printer and stuff you have around the house.
For the CNC fanboys I will describe a carving method to get PCBs, but that project is still on the queue, I got everything ready to begin experimenting. I will publish that in the 3D Print & CNC Carving section of my website.
The next step is to buy the parts and assemble the circuit. I recommend soldering the SMT parts first, beginning with the shortest. I began with the passives, then soldered the transistors, then the PIC controller. As for the THT components, the procedure is much the same, but since they are about the same size
This isn't a super-complicated project in terms of software, but since the timings of one-wire are kind of fast, it might help to have a logic analyzer or an oscilloscope around just in case.
To make the thing look sexier, one can design and 3D print a nice enclosure for this device. I made one using TinkerCAD - it has positioning pegs to secure the board into place, cooling grids and holes for the LEDs.