First, you'll need to learn how this circuitry works.
Try helping the woman in the Oratory. When you do, you'll have that knowledge (or at least Spock will).
Next, you'll need a couple of parts from a somewhat obscure location. Read on for an answer if you don't already have what Spock needs.