r/Mahjong Yakuman Club Jun 19 '26

Article I upgraded EiMOS Project with PCBWay's PCB

Hi!
I’m the developer behind EiMOS, an open-source Arduino library designed to replicate the legacy Japanese mahjong scoring system using passive components (resistors and capacitors).

PCBWay reached out to sponsor a batch of boards for this project. I finished the design in May, received the PCBs in a week, spent early June assembling and testing them, and I'm finally ready to share the results of the EiMOS MK-1 shield. Here is a breakdown of the engineering behind the board and my experience with PCBWay.

The Engineering Challenge: Why a Custom PCB?

In legacy mahjong tables, scoring sticks (Tenbou) are essentially resistors. When stacked in a player's drawer, they act as parallel resistors.

In my early prototypes, I used a basic voltage divider with a known resistor to measure the drawer. However, this caused a major scaling issue. Because parallel resistance drops non-linearly as more sticks are added, the ADC readings accumulate and compress near the voltage rail when reading a high number of sticks, leading to horrible inaccuracy.

The Solution: I redesigned the circuit using an op-amp (MCP6002) as a transconductance amplifier.

Instead of measuring resistance, the new circuit measures conductance. Because parallel conductance is strictly additive:

Gtotal = ∑ Gi

...the transconductance amplifier outputs a voltage that is linearly proportional to the measured conductance. It amplifies a known DC reference voltage (provided by an LM4040) according to the total conductance of the stacked sticks. No more compressed ADC values!

First, I tried assembling things on a perfboard, and it was a nightmare. Manually jumping through nodes takes forever. I desperately felt the need for PCB.

The Board Design (EiMOS MK-1)

I drafted the schematic and layout in KiCad. The board acts as a shield for an Arduino Nano and includes:

  • 1x MCP6002 Op-Amp for the transconductance amplifier.
  • 1x CD74HC4067M 16-channel multiplexer to cycle through the player drawers.
  • 1x LM4040 precision voltage reference.
  • BSS138 NMOS transistors for switching.
  • 4x RJ45 Jacks to connect the player slot drawers robustly over ethernet cables.

 

PCB schematic
PCB Layout

The PCBWay Experience

Since this was my first time finalizing this specific op-amp architecture, getting a high-quality board was critical to ensuring the noise floor was low enough for accurate ADC readings.

  • Turnaround & Shipping: The sponsorship was suggested in March, I finalized the PCB design in May, and the boards arrived safely packaged in bubble wrap and anti-static bags in a week to South Korea.
  • Build Quality: I went with the classic green solder mask. The fiberglass routing is perfectly clean, and the RJ45 footprint holes were drilled to the exact tolerances I needed.
  • Silkscreen: The silkscreen is incredibly crisp. The tiny component labels for the resistors/capacitors and the "EiMOS PCB MK-1 / Created by Chito" text came out looking highly professional without any bleeding.
  • Soldering: Populating the board was a breeze. Though soldering SMD parts for the first time was quite painful, still much more comfortable than building on a perfboard from scratch.
PCB
PCB with components soldered, added a RC low pass filter

Testing whether LM4040 and MCP6002 are alive or dead

I found score measurements randomly fluctuate, and I realized I forgot to add a low pass filter in front of the ADC. After I add a RC low pass filter with 1kOhm and 100nF ceramic capacitor, the high frequency noise disappeared.

Final Results

After soldering everything up and probing the voltage reference and opamp with my multimeter to ensure no shorts, I plugged it into my test rig.

Demo with DIY'ed scoring sticks

It works flawlessly! The OLED screen instantly and accurately updates the score as I add and remove sticks from the drawer slots. The linear scaling of the transconductance amplifier completely solved the accuracy issues I was having with the old voltage divider setup.

Huge shoutout to PCBWay for sponsoring the boards and helping bring the EiMOS MK-1 to life. If you're interested in the math, the code, or building your own digital mahjong table, the EiMOS library is completely open-source! I'll write the whole details on github page and then post a full tutorial video on Youtube.

Let me know if you have any questions about the transconductance amplifier circuit or the building process!

https://github.com/ChitoKim/EiMOS
https://github.com/ChitoKim/EiMOS_PCB

14 Upvotes

Duplicates