Introduction: Logic Gates Demonstration Kit
Update (3/24/2021): now offering for sale on Tindie!
When teaching a Math Circle, I was discussing with the students various logic operations and logic gates. We went from basic AND and OR gates to constructing flip-flop circuit and full adder - using software simulation. I wanted to show them real electronics gates, so I started looking for a demonstration kit which would be
- functional: enough pieces to build something interesting such as flip-flop or adder
- easy to use
- clean-looking - breadboard with a rat's nest of wires doesn't make a good demonstration kit
- large enough so that it can be shown to a group of several students
- not too expensive: under $50 for the whole kit
I couldn't find such a kit; the closest I found was this one from Sparkfun, but is still fails on several counts. So I decided to make my own, which meets all the requirements above and more. Here are some features of my kit:
- It uses custom black PCBs; to make it look nicer, I used surface-mounted components placing most components on the back
- contains 5 types of gates (AND, OR, XOR, NAND, NOT) plus a separate 3-bit input board
- is powered through USB-C connector
- each board is relatively large - 48x72mm - only slightly smaller than a credit card, with high contrast white on black marking and bright blue LED to indicate states
- boards are connected by a common 3-wire connectors, commonly used for servos and widely available
- boards have stick-on magnets on the back, allowing one to place them on a magnetic whiteboard or blackboard or any other magnetic surface - even refrigerator door!
Using surface mounted components makes it more difficult to solder, but in this case, the components are few and not too small, so this makes a nice first SMD soldering kit for those wishing to learn SMD soldering. Unlike many other kits, it also serves a useful purpose!
Full list of necessary pars is listed in Step 1 below. With delivery to US, it will cost you about $90, but will give you enough materials for 10 gates of each kind. If we take the basic kit to have 2 boards of each kind, plus one 3-bit input, you will have enough for 5 kits.
You will also need a decent soldering iron, a hot air reflow station (basically, temperature controlled heatgun), solder paste (I used this low-temperature one), tweezers, flush cutters and other basic tools.
Step 1: Getting the Parts
You will need the following parts:
- PCBs. There are 6 kinds of PCBs (5 types of gates and input). The design files (Eagle's schematics and board files and Gerber files) are available from my github repository under open source license; feel free to use them. I ordered my boards from JLCPCB, which I highly recommend. I selected black soldermask (in JLCPCB, black soldermask is matte, which looks better than glossy). Ordering 10 board of each kind cost me $35+ shipping - altogether, about $60.
- Electronic components. I ordered mine from lcsc.com; full bill of materials (BOM) can be found in github repository. Feel free to replace passive components (resistors, capacitors) by other brands as long as the value and package match. I had opted for higher quality parts (e.g., using 1% tolerance for resistors), even though it is completely unnecessary for this project - but since the passives cost so little, it makes sense to order them in multiples of 100 and use leftovers for other projects, where you might need higher precision.
- Other components:
- Breakaway male headers. To make the board look nicer, I used surface-mounted headers, which are not common. I found mine on Aliexpress (we need the single-row ones) and had to wait 3 weeks for delivery. You will have to break the strips into 3-pin pieces, using flush cutters.
- Connectors: I used 3-pin servo male-to-male cables from Amazon. I recommend getting at least four 10-cm cables and two 20cm cables for each kit. Amazon sells them in packs of 10.
- Magnets. I used 18-mm diameter, 3mm thick ceramic magnets from Amazon.
Step 2: Assembling the Boards-1
Once you have all the components ready, the next step is assembling the boards. We begin by assembling the back side of the board (where most electronics is).There are hundreds of tutorials on SMD assembly, so I will be brief.
- arrange the boards, back side up (not more than 2-3 at a time) on silicone mat or other heatproof material
- use the syringe to place small beads of solder paste on each pad (except the long ones for headers). DO not place too much - this is the most common mistake. If you put too much paste, do not try to remove the excess with toothpick or tweezers - instead, wipe this pad (and nearby pads if necessary) clean, using a paper towel and rubbing alcohol, and then start anew.
- use tweezers to place components
- set the reflow station heat gun temperature to 180C (for low-temperature solder paste) or to 220C (for regular lead-based solder paste). Hold the heat gun vertical (angling it makes it easy to blow small components away). Heat each component from the distance of 1-2 cm; the solder paste first liquefies, then starts bubbling, then becomes molten metal; at this moment, move to next component.
If you had too much paste, the excess will probably be balled up somewhere around your components. Use a toothpick to remove it.
Inspect the logic chip to make sure there are no solder bridges between pins. If there are, remove them using a soldering iron and braided wick.
Step 3: Assembling the Boards-2
After soldering the electronics, add the headers. I had chosen to solder them using the regular solder and soldering iron, instead of paste and heatgun - it gives a stronger connection; also, the plastic of the headers can be melted by the heatgun. I used small chisel (D-type) soldering tip, with the temperature set to 370C (using regular lead-based solder)
- use flush cutters to divide long strips of headers into 3-pin pieces
- use soldering iron to tin middle pad of each group of 3 pads for a header
- put the header on the pad; holding the header with one hand, solder the middle pin to the pre-tinned pad. Make sure to press the pin firmly to the pad
- one the middle solder joint solidifies (it takes a couple of seconds once you remove the iron), solder the remaining pins, using solder and iron
After soldering the headers, turn the board over and solder the LEDs to the front side of the boards. If you - like me - have difficulty remembering which side of LED is cathode (negative), here is a nice reference sheet: https://lighthouseleds.com/blog/polarity-guide-of-...
For the LEDs in my BOM, the cathode is marked by green markings on both sides, as in this image: https://lighthouseleds.com/wp/wp-content/uploads/w...
Finally, attach the two magnets to the back side of the board, in positions marked by circles. Try to keep polarity of magnets on all boards the same - it will make it easier to pack your boards in a box.
Step 4: Using the Boards
Usage is pretty obvious: arrange you boards on a horizontal or vertical (magnetic) surface and connect them to create circuits, then use USB-C cable to power it. Here are some tips:
- Each connection header provides 3 pins: ground, 5V (middle pin), signal. This matches the usual servo connectors we use; typically in these connectors, ground is black, 5v is red, and signal, white or yellow. When plugging the cables, make sure to plug it in correct orientation. To make it easier for you, there are small labels on the boards' face over the headers: S stands for signal, G for ground.
- Each board provides two output headers - in case you want to split output; this allows you to avoid using additional cable splitters. Both outputs are connected to the same signal.
- When placing the boards on a metal surface (such as your refrigerator), be careful that the unused headers do not touch the surface - otherwise, you can short 5V and ground. It is recommended that you place a sheet of paper between the boards and metal surfaces (magnets are strong enough to hold the boards through regular paper).
Step 5: Further Plans
I plan to expand the kit, adding several more boards:
- "Mystery board": a 3-input board containing two elementary gates - leaving it to students to figure what is inside
- D-latch
- 1-bit adder with carry - connecting several such together, students would be able to create adder circuits
Any other suggestions would be appreciated!
I also plan to sell these as a kit through my Tindie store: tindie.com/stores/irobotics/, with tentative price of about $30-35 for a kit (3-bit input gate and 2 of each of 5 kinds of gates, plus the connector cables and magnets). If you are interested, please leave the comment below and I will let you know once it happens! Needless to say, leaving a comment doesn't put you under any obligation.