I very much like your schematic drawing style. Mostly keeping signal flow from left to right and voltages from top to bottom in each block makes signal flow easy to follow. I am happy you did not use the rectangles around each circuit section. Maintaining those often requires many redraws or size adjustment and they soak up a disproportional amount of time without adding anything useful. In your schematic all sections are separated by a bit of whitespace, and they have titles in big letters which makes it easy to identify the blocks.
KiCad has always been a bit "ugly" with text rendering. Make the text bold makes it easier to read when zoomed out. Making it big and bold also makes it a bit too prominent. Making it bold with a text height of around 4mm both makes it very readable when zoomed out, and saves some space on the schematic. (only 40% of space compared to 6.35mm).
You can consider replacing MMBTA06 with something similar to TDTA114Y. Such transistors have built in resistors which reduces PCB area, schematic and PCB drawing effort and PnP or hand soldering time. FET's could also be used but I have always had the perception that FET's are less robust then BJT's. Also, if a FET blows, it's easy to damage the uC too. When a BJT goes bad, there is still the base series resistor to limit the fault current into the uC.
ERC throws 999+ warnings. Many are in the form of:
Warning: Pins of type Passive and Unspecified are connected Setting pins to
Unspecified is problematic for ERC. Setting them to passive is nearly always a better option. After ignoring these, and the
Library symbol issue ERC looks pretty clean. (Except for the
PWR_FLAG You have used very big and old fashioned and also slow "freewheel" diodes for your relay coils. A faster diode is better here, and you don't need a 1A diode. Also, it's common to have two diodes in a SOT23 package. Have a look at the ubiquitous BAT54. It comes in versions:
* Single (without suffix).
* Dual with Anodes connected (A suffix)
* Dual with cathodes connected (C suffix) (This fits your application).
* Dual in Series (S suffix)
You don't need Schottky diodes, but it does not hurt either (unless leakage is important) There are probably other diodes too, It's just a common type number that is available right from my head.
R34 and R36 are 100 Ohm. Resulting in a peak current of 33mA through the encoder switches. It's good to have these resistors, but 33mA may still be a bit much for your encoder.
I had a look at the datasheet of your G6SK Relays:
https://eu.mouser.com/datasheet/2/307/K093_E1-3446793.pdfContacts are rated for 250Vac, 2A, but that means the contacts themselves are capable of handing that amount of power. It does not mean that your relays have big enough internal clearances to act as an isolation barrier between live mains voltages and things you can touch with your fingers, Mains related projects always require extra attention to be in line with safety requirements, either earthed, or double isolated. For example what happens if your relay overheats (for example because of a bad contact) and partly melts. Can this put mains voltage on the relay coil contacts? Your relays are quite small and may be inadequate here. Such safety concerns are one of the reasons many relays are much bigger. Datasheets of relays do not mention whether they are suitable for use between mains to fingers isolation. It's also not my expertise, but G2R is probably a safer bet (pun intended
). G2R is a very popular relay and for good reasons. It is also available in latching variants.
For the schematic, I prefer local labels. Although they are functionally the same for a single sheet schematic, they are simpler without the boxes around them, and they require less editing when you want to go to a hierarchical schematic later.
Schematic & routing around the Radio Tx/Rx part is not good. First, I prefer to add series resistors for off-board connectors. Even 20 Ohm resistors significantly improve the effect of TVS diodes. Putting bidirectional TVS diodes both on GND and +3V3 is a bit excessive, but it does not hurt either, and for low number of boards the costs also do not matter much.
For the routing, it is not good to directly route from the uC pin to the connector, and have a separate track to the TVS diodes. ESD events are very fast, and the inductance of the track to the TVS diode reduces it's efectiveness. It's better to route from the connector to the TVS diode, and from the TVS diode to the uC. This always forces the ESD event to go near to the TVS diode.
You have put a few footprints on the back of the PCB. This is not a big problem, but assembly is a bit easier if all footprints can be put on the same side.
You put the feedback resistors of the SMPS close to the controller. That is good, but feedback from the 3V3 wire is very long and goes around the inductor, that increments impedance and noise pickup and that is not so good. The rest of the layout around the SMPS IC looks quite good, but I have not looked deep into details.
Overall PCB layout is somewhere between not so good and mediocre. Most of it is drawn nicely, but you have completely cut up your GND plane into little pieces and this is very bad. This is very common with beginners though. Rick Hartley has made a 2 hour and 19 minute long video about GND planes and it is worth watching at least twice (with a few months in between). That is how important GND planes are. As is, your PCB will probably work, but it won't pass EMC tests.
Most of your uC pins are generic I/O pins. It is common to re-assign these in software to make routing easier. The goal here is to put them in such order that the front side of the PCB can be used for all the routing, and the back side can be a continuous GND plane.
The quality of your GND plane is also hard to analyze because you put GND on both layers and stitched together. Stitching them together is better then nothing, but it is a last resort. In your stitching you also have quite a lot of PCB areas that are not connected to anything. If you use GND stitching, then at least put extra via's in corners of such unconnected GND sections, and where signals leave or enter stitched GND area's. First goal is to have a single uninterrupted GND plane. This both has better performance, and is much easier to analyze.
Near the relays, you have some horizontal tracks both on the front and on the back. These cut the GND plane into quite a lot of sections, and there is also not very much GND stitching over there. Putting all these tracks on the same layer, so the other can be a continuous GND plane is much better. Signals there don't switch often, and this reduces EMC emitted noise, but they are still directly switched from uC pins, have fast transitions, and thus need EMC mitigation techniques. Things as simple as moving the base resistors of the BJT's close to the uC instead of close to the BJT's improve EMC performance.
After this long post, Overall impression is that this project is already much better then I would expect from a beginner with PCB design / layout. Even if only the GND plane and the big fat 1N4007 diode issues were remedied, it would become difficult to see this PCB was made by a "beginner".