Building the CV Touch Keyboard

 


Notes:

  • Diode labelled 1n4007 is an M7 rectifier diode (they’re the same, only called different things depending on the package.)

Schematic:

Click for full-size.
Click for full-size.

BOM:

Qty
Value
Device
Package
Parts
Description
Source
1100nCapacitorC805C1
7100nCapacitorC603C2, C3, C4, C5, C6, C8, C100603 PACKAGE!
110uCapacitorC805C7
11uCapacitorC805C9
2CAP1188CAP1188QFN24_4X4CAP1188-1, CAP1188-2Capacitive Touch Controllerhttps://www.digikey.ca/product-detail/en/microchip-technology/CAP1188-1-CP-TR/CAP1188-1-CP-TRCT-ND/4147176
23.5mm JackTHONKICONNCV, GATE3.5mm socket for Eurorack modular synthshttps://shop.erthenvar.com/collections/accessories/products/3-5mm-inline-jacks
21n4007DIODE-DO214ACDO214ACD1, D2M7 (1n4007) RECTIFIER DIODE
1B54SBAT54SSOT23D3Schottky Diodeshttps://www.digikey.ca/product-detail/en/on-semiconductor/BAT54SLT1G/BAT54SLT1GOSCT-ND/917811
13Z3 300mW3.3 Zener DiodeSOD-123D4Zener Diode SOD-323https://www.digikey.ca/product-detail/en/on-semiconductor/MM3Z3V3T1G/MM3Z3V3T1GOSCT-ND/2623467
1LM4040LM4040A-5SOT23-3IC1LM4040/1 compatible shunt reference. 5V.https://www.digikey.ca/product-detail/en/texas-instruments/LM4040AIM3-5.0-NOPB/LM4040AIM3-5.0-NOPBCT-ND/182331
1LM317317TO-226AAIC2Positive VOLTAGE REGULATOR
1Eurorack Power HeaderJP1Eurorack Power Header 5x2 Shielded
2PINHD-1X41X04JP2, JP3PIN HEADER
2PINHD-1X21X02JP4, JP5PIN HEADER
7LED1206LED1, LED2, LED3, LED4, LED5, LED6, LED7LED, reverse mounted
91kResistorR0805R1, R3, R5, R6, R7, R9, R11, R13, R14
1220R .25WResistorR1206R100805 works too.
12kResistorR0805R12
410kResistorR0805R15, R16, R20, R21
2100 0 ohmResistorR0805R17, R18
1100kResistorR0805R19
1220ResistorR0805R2
1680ResistorR0805R4
1Tiny85-20ATTINY85-20DIPU2Atmel 8-pin 2/4/8kB flash uC
1MCP4726MCP4726A0SOT23-6U3Microchip 12-bit I2C DAC, ADDRESS A0https://www.digikey.ca/product-detail/en/microchip-technology/MCP4726A0T-E-CH/MCP4726A0T-E-CHCT-ND/2713266
1MCP6021MCP6291T-E/OTSOT23-5U5Rail to rail OpAmp with 10MHz GBPhttps://www.digikey.ca/product-detail/en/microchip-technology/MCP6021T-E-OT/MCP6021T-E-OTCT-ND/1979836
1DIP8 SOCKET8 pin DIP socket with FLAT LEADS

Building:

Inspect the PCBs for damage. There should the three PCBs, the protection covers, and optionally the preprogrammed IC.

Trim the “mouse bites” (if any) and file flush to edge, careful not to go to far or nick the edge.

Check that the LEDs fit the holes. They are mounted upside down so the lens protrudes through the hole. Some LEDs fit perfectly, some are a wee tad too large. The routing operation left the edges slightly rounded which can interfere with the fit. Square the inside edges with a sharp utility knife or tiny hobby file. Be very careful to not remove too much material, cut a trace, remove material from the front side of the board, or slice into a finger.

Clean the fibreglas dust from the PCB and workspace — it’s very abrasive and may scratch the panel.

Clean the PCB with isopropyl alcohol.

All of the components go on the back of the PCB. To protect the front work on a clean soft surface like an antistatic mat.


The DIP adapter is simply a DIP socket with the leads bent outwards. Use the cheapest type of socket with flat leads. The one with pins or machined pins are brittle and snap easily.

Make the DIP adapter by trimming the edge of the pins just above the point. It should easily fit on the PCB traces with some wiggle room.

They’re soldered to the PCB by first tinning the pad, then placing the adapter on the pad and touching each lead with an iron. The solder on the pad will remelt and flow over the pin.

Why a DIP IC on an SMD PCB? Because programming an SMD microcontroller is a big pain, and not everyone has the equipment to do it. Troubleshooting is also a lot easier if the microcontroller can be removed. If the worst comes to worst, the IC can easily be pulled and a new one put in without any skills or equipment.

 


(This is an older design that doesn’t have the opamp on the output.)

Using solder-paste/hot air is recommended. Some parts are very closely packed (particularly around the DAC), and the CAP1188s are very fine pitched.

Check that the LEDs fit before adding the solder paste — if one doesn’t fit it’s a lot easier to fix when there isn’t paste on the PCB.

Add all the parts. Order doesn’t matter. I find it easier going from left to right.

Make sure the LEDs, diode, and ICs are oriented properly. The indicators on the IC and PCB are very small. The LEDs “point” towards the polarity indicator (a tiny dot).

The LED should sit flush while upside-down. It’s okay if it’s a little bit not flush — it won’t be noticeable from the other side (but you will know, an it will haunt you. Or won’t.) Be careful not to use too much force pressing down on the LED or it will break.


The CAP1188s are very small and a bit tricky to solder. Don’t use too much solder, especially underneath, or it will float on the flux. The right amount and the legs will get pulled to the pads.  Use a magnifier to make sure the pins are aligned.

Replace the 100 ohm resistors or 0 ohm resistors (labelled in yellow on the diagram in Schematics). These are to reduce noise on the I2C lines but aren’t necessary.

The 3.3V Zener may be a bit small for the pads, but it should still fit. I tried to use a pad size that will accommodate almost any package.

The 220 ohm 1/4W 1206 resistor can possibly be a 1/10W 0805 resistor. I’ve done this on a couple prototypes with no problems even though the math says to use a 1/4W resistor.


(This is an older design that doesn’t have the opamp on the output.)

Now that everything on the main PCB is soldered…

 

Check the solder joints, and use copper braid to wick away solder that’s shorting pins. The CAP1188s will almost certainly need the braid.

Remove any tiny solder balls so they don’t shake loose and short something later.

Clean the PCB with alcohol/tissue to remove flux.


The power and CV/Gate connectors are attached to the main PCB with the


Add the components to the two interface PCBs in this order: SMDs, power regulator, jacks, power header, pin headers.

Leave the regulator leads a bit long so it can be bent out of the way.

Before connecting the panels together permanently, test that it outputs between 5.02 to 5.13 V. The resistor values are selected to make 5.1V. Why 5.1V? The DAC uses a 5.0V shunt reference.

Finally solder the wires between the interface PCB and the main PCB. The pads are highlighted in green in the graphic in the SCHEMATIC section. Trim the leads that connect to the pads short and orient them so they won’t short. Keep the wires long enough that the interface PCB can be detached if necessary.


Testing:

Double check soldering one last time, then attach the panels together.

Check for shorts to ground on the points labelled in purple in the Schematic diagram above (IC power connectors.) If there’s a short find and fix it before continuing.

Apply power and check those same points for ~5.1 and ~3.3V.  Feel the CAP1188 ICs, 3V3 diode, and regulator. If they get very hot disconnect the power and double-check component values and shorts.

Add the programmed microcontroller and apply power. The module should blink once almost immediately, then have the center Octave LED lit.

Check that all buttons work, and CV and Gate are working. The Gate should be 5V, and the CV should be roughly in tune.


Code:

Code is here: https://bitbucket.org/thx2112/cv-touch-keyboard/src

Burn bootloader as AtTiny85 16MHz internal clock.


Tuning:

The module uses multipoint tuning which tunes to each octave and then interpolates the tuning for all notes between those octaves.

But because the lowest and highest limits are right at the end of the opamp/DAC limits we tune the lowest and highest to the closest tunable notes, which are C#0 and B#4. The lowest/highest values are then interpolated so tuning is accurate even if it runs beyond the rails (except for the highest and lowest notes).

  • Connect the module to a known-accurate oscillator or oscillator/multimeter.
  • Simultaneously touch LATCH, UP, and DOWN to enter tuning mode.
  • LEDs will flash, then LATCH LED will “breathe” when in tuning mode.
    • Octave display shows which octave is currently being tuned.
    • Press F note (center key) to advance through octaves.
    • Press Octave UP and DOWN to tune. Hold for large changes.
    • Tune 1st position to .083V or C#0
    • 1st – 1V or C1
    • 2nd – 2V or C2
    • 3rd – 3V or C3
    • 4th – 4V or C4
    • 5th  (OCTAVE LIGHT WILL GO OUT) – 4.9167V or B#4
    • Cycle starts over.
    • Simultaneously touch LATCH, UP, and DOWN to reset to defaults (roughly tuned) while in tuning mode.
  • Press LATCH to save to EEPROM and exit. Settings will be restored upon each powerup.