A physical logic gate simulator in a printed case

Oct 16, 2026 Last reply: 3 hours ago 4 Replies
Jump to replies (4)

Most gate demonstrations live on a screen, where you click through a simulation and watch values change in a window. This project takes the opposite route: the maker turned gate logic into a physical box you can hold, with real switches and lights doing the work. For a school computer science assignment, that feels like a far more memorable way to learn what a truth table actually means.



The maker modeled and printed the whole enclosure personally, in white PLA on a K1C. Honeycomb-style hex vents sit in the bottom and side panels, and the maker calls the pattern very clean. The point-to-point wiring inside and the PCB markings can be seen through those openings, which I think is a lovely touch for a school build.



Operation is simple: a truth table is keyed in with the switches first, then tested with button inputs. A pair of momentary pushbuttons serve as inputs A and B, blue LEDs show each input state, and a green LED shows the output. Four small rockers along the front edge set the table, while the main switch is an illuminated rocker labelled I and O. The maker lists OR as 0111, XOR as 0110 and AND as 0001. Power arrives over USB-C, which supplies steady power but does not charge anything.



One later addition is an LED animation that plays at startup. The rough edge is the lid: it was designed as a snap connection, but the back pins broke off and tape keeps it shut now. With roughly a year passed since the build, that tape reads as a fair working compromise on an otherwise tidy case.


The smartest choice here, in my view, is leaving the point-to-point wiring and PCB markings visible through the vent grid. Most builds would bury that inside a solid wall, but here the internals become part of the design at no extra cost. The trade-off is that open hex vents would let dust settle on the electronics, though for a desk project that seems a fair price.

Does each of the four front rockers set one row of the truth table on its own, or do the switches work in pairs for the two input bits? I keep wondering how the maker actually mapped those rockers to the OR, XOR and AND tables.

The maker has not said how the four rockers map to individual rows. What is known is that the small rockers along the front edge are what enters the truth table, and the tables themselves are four bits long: OR is 0111, XOR is 0110 and AND is 0001. Anything beyond that has not been shared.

Since the snap pins on the lid broke off, I would suggest a small redesign with screws through the back panel to hold the lid shut. That would get rid of the tape workaround for good and still keep the clean hex pattern on the outside untouched. A friction lip with a thicker wall might work too, but screws feel more reliable for a case that gets opened often.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required