This is a text-only version of the following page on https://raymii.org:
---
Title : My First PCB: Relay AND gate
Author : Remy van Elst
Date : 20-01-2025 03:59
URL : https://raymii.org/s/blog/My_First_PCB_relay_AND_gate.html
Format : Markdown/HTML
---
This is the result of my first attempt at learning KiCad during the Christmas break. I love the sound of a relay, so trying out [these relay logic gates](https://www.youtube.com/watch?v=_nXc439NTYk) from the Usagi video and the information [here on the MERCIA relay computer](https://web.archive.org/web/20250104211313/https://relaiscomputer.nl/index.php/elements) on a breadboard was fun, but a bit messy. No transistors or modern components, just relays, push buttons, resistors and LED's to show output. I've always wanted to make my own PCB. These simple relay logic gates are perfect to try out KiCad and actual PCB design, having never done that before. This short post shows you my first PCB, with all the beginner mistakes included.
[Here is a PCBWay referral link for USD 5 credit](https://pcbway.com/g/e7yQRg).
Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below:
I'm developing an open source monitoring app called Leaf Node Monitoring, for windows, linux & android. Go check it out!
Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.
You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $200 credit for 60 days. Spend $25 after your credit expires and I'll get $25!
![the finished PCB](/s/inc/img/9df758db114145429cd9d55bc63b55fd.png)
> The finished PCB including soldered components. Screwdriver for scale
Please note that I'm not an expert at PCB design and this is my first time
trying out KiCad. But oh boy did I have some fun learning. Receiving the
first PCB in the mail was fun, soldering the components and then having it
working the first time right way was even better.
Is it me, or, does everyone have this? When you've just finished the checkout
process, you think of a few more changes that would have been nice to
include?
### Relay AND gate
This is a logic gate that should give a HIGH output when both inputs are HIGH.
This design is before I learned about net classes, ground planes, design
constraints, minimum trace sizes, custom footprints for a board with mounting
holes and such. I also had the wrong symbol / footprint combo for the relay,
so all my pins are manually coupled, no net names or automatically generated.
Almost hand wired.
![schema](/s/inc/img/f055b14bd059454a8585d2859e038b78.png)
![pcb view](/s/inc/img/e6e9dd0d53c24ad4b24e4c7462378271.png)
![kicad render](/s/inc/img/4d032a3131ba4002a9f56e0cb6ffabf7.png)
[This is the relay](https://www.tinytronics.nl/en/switches/relays/relay-5v-250vac-10a) I'm using.
It's a 5V one, because that is what my Arduino UNO
can provide power for, and more important, because I had a few of those lying
around from earlier projects. They are a bit hard to use on breadboards, but
with careful bending they do work.
![Songle SRD-05VDC-SL-C](/s/inc/img/094d9439f07245d1b5634bfae869e26f.png)
The finished result is shown in the picture at the top of this page.
### Relay NAND gate
A few attempts and a second relay later resulted in an extra output on the
breadboard, the NAND (inverse of the AND). This PCB includes a ground plane,
better design constraints, net classes and the correct symbol for the relay.
I've also made a few custom components for the base board with mounting
holes, the logo's and divided the board up into sections. The relays have a
set position as well, so in total with this layout it should fit 8 or 9.
This PCB is bigger because I want to use it as a base for the other logic
gates. It still fits in the 100x100mm size for PCBWay to get the cheapest
price tier (USD 5 as of writing this article).
![nand schema](/s/inc/img/5c9568c5991241fc8f876ca0a2439f96.png)
![nand pcb](/s/inc/img/30ef8f5c378d41a383f9113625bd1167.png)
![nand render](/s/inc/img/3733525a3f604830becf9df5bdff09b3.png)
---
License:
All the text on this website is free as in freedom unless stated otherwise.
This means you can use it in any way you want, you can copy it, change it
the way you like and republish it, as long as you release the (modified)
content under the same license to give others the same freedoms you've got
and place my name and a link to this site with the article as source.
This site uses Google Analytics for statistics and Google Adwords for
advertisements. You are tracked and Google knows everything about you.
Use an adblocker like ublock-origin if you don't want it.
All the code on this website is licensed under the GNU GPL v3 license
unless already licensed under a license which does not allows this form
of licensing or if another license is stated on that page / in that software:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Just to be clear, the information on this website is for meant for educational
purposes and you use it at your own risk. I do not take responsibility if you
screw something up. Use common sense, do not 'rm -rf /' as root for example.
If you have any questions then do not hesitate to contact me.
See https://raymii.org/s/static/About.html for details.