
Macrolev
heiso/macrolev
Macrolev is an open source analog keyboard powered by Hall Effect switches

This document describes the hardware design and validation of the SPIN Oscilloscope Shield project. The shield is used in a validation bench to observe real electrical signals generated by a SPIN board under test…
SPIN Oscilloscope Shield is an open-source printed circuit board by EdamAbdelhedi, from the EdamAbdelhedi/SPOC_Hardware repository on GitHub. It is a 4-layer board of 100 × 110.5 mm with 77 parts on 142 nets, routed with 3,143 tracks and 1,074 vias.
It is built around the CD74HC4067SM96. Its parts include 16 capacitors, 12 resistors, 12 ICs and 3 connectors. It belongs with the sensors and measurement boards of this library.
This document describes the hardware design and validation of the SPIN Oscilloscope Shield project.
The shield is used in a validation bench to observe real electrical signals generated by a SPIN board under test, called the CUT SPIN.
The computer controls the test sequence, the CUT SPIN generates the signals, the MUX SPIN selects which pins are observed, and the SPOC shield routes the selected signals to the oscilloscope BNC inputs.
The SPOC hardware is an oscilloscope shield used to validate the pins and signals generated by the CUT SPIN.
It allows up to four selected signals from the 45 available SPIN GPIO pins to be visualized at the same time on a standard 4-channel oscilloscope.
The main objective is to route selected GPIO signals from the CUT SPIN to four oscilloscope inputs through an analog multiplexer network.
Each oscilloscope channel independently displays one selected I/O, which makes it possible to test the complete board and confirm that the pins behave correctly.
Main requirements:
CUT SPIN GPIO to the BNC outputSPIN GPIO coverage:
| Port group | Pins | Count |
|---|---|---|
PA | PA0 to PA10, PA13 to PA15 | 14 |
PB | PB0 to PB15 | 16 |
PC | PC0 to PC13 | 14 |
PD | PD2 | 1 |
| Total | 45 |
The validation bench connected to the SPOC shield is built around four external elements.
| Element | Role |
|---|---|
| Computer | Controls the test sequence, configures the boards, and collects oscilloscope measurements |
| CUT SPIN | Board under test; generates the electrical signals to validate |
| MUX SPIN | Selects which CUT SPIN pins are routed to the shield |
| Oscilloscope | Measures the physical signals on the BNC outputs |
During a test, the computer configures the CUT SPIN, selects the required route through the mux system, and reads the oscilloscope measurement. The SPOC shield is the hardware interface between these elements: it routes the selected GPIO signal to the correct oscilloscope channel.
The shield schematic was designed in KiCad.
The schematic shows the complete board organization: one SPIN board for pin visualization (CUT SPIN), one SPIN board for mux addressing (MUX SPIN), and four repeated mux-channel blocks connected to the oscilloscope outputs.
Each repeated mux-channel block has two groups of inputs:
MUX SPINCUT SPINEach mux-channel block contains three 16:1 analog multiplexers.
The three muxes share the same BNC output path, but only one mux is enabled at a time.
The schematic also includes local test points, the BNC connector path, decoupling capacitors, and the output network used for measurement.
Before the BNC connector, the selected signal is available on a local test point.
The BNC output network is inspired by the principle of a passive 10x oscilloscope probe.
A standard oscilloscope input usually presents a high input impedance, typically equivalent to 1 Mohm to ground.
This high impedance limits the current drawn from the circuit under test, but the coaxial cable and oscilloscope input also add capacitance.
Without compensation, this capacitance can distort fast waveforms: for example, a square wave can appear rounded, overshot, or no longer square on the screen.
To reduce this effect, the SPOC output uses an attenuation and compensation network.
After the local test point, the signal passes through three 3 Mohm resistors in series, giving a total series resistance of 9 Mohm.
Together with the oscilloscope 1 Mohm input, this creates a 10:1 voltage divider:
Vscope = Vsignal x 1 Mohm / (9 Mohm + 1 Mohm)
Vscope = Vsignal / 10This means the oscilloscope measures one tenth of the real signal amplitude.
For example, a 1 V signal at the shield output is measured as about 100 mV at the oscilloscope input, unless the oscilloscope is configured to display the corrected 10x value.
The variable capacitor placed in parallel with the 9 Mohm resistor chain is used for compensation.
Its role is to balance the effect of the cable and input capacitance so that fast signal edges are preserved more correctly.
If the compensation is not adjusted correctly, the output network can behave like a low-pass or high-pass filter and distort the measured waveform.
The compensation can be checked with a calibrated square-wave signal and adjusted until the displayed waveform remains square.
The shield uses CD74HC4067SM96 analog multiplexers.
Each oscilloscope channel is built from three 16:1 muxes, one shared output path, one local test point, and one BNC output.
The selected mux type is analog, so the shield can route both digital levels and practical analog waveforms.
The CD74HC4067SM96 is a 16:1 analog multiplexer with 16 inputs and one output.
The complete board uses:
| Hardware item | Quantity |
|---|---|
16:1 analog muxes | 12 total, 3 per channel |
| Mux address lines | 16 GPIO controls, S0..S3 for each channel |
| Mux enable lines | 12 GPIO controls, one enable per mux |
| BNC outputs | 4, one per oscilloscope channel |
CH1 is used as the reference channel because CH2, CH3, and CH4 repeat the same structure.
For CH1, the MUX SPIN control pins are:
| Signal | MUX SPIN pin |
|---|---|
S0 | PA0 |
S1 | PA1 |
S2 | PA2 |
S3 | PA3 |
EN_MUX1 | PC0 |
EN_MUX2 | PC1 |
EN_MUX3 | PC2 |
The selection logic is:
S0..S3 select the input address inside the active muxEN_MUX1, EN_MUX2, or EN_MUX3 chooses which mux group is connected to the channel outputThe CD74HC4067 enable input is active low.
This means a mux is enabled when its EN_MUXx signal is driven low, and disabled when the enable signal is high.
For each channel, the MUX SPIN must therefore keep only the selected mux enable line low and keep the other mux enable lines high.
Each channel uses the same input-family organization:
| Mux | CUT GPIO family | Address range |
|---|---|---|
MUX1 | PA0 to PA10, PA13 to PA15 | 0 to 13 |
MUX2 | PB0 to PB15 | 0 to 15 |
MUX3 | PC0 to PC13, PD2 | 0 to 14 |
Example: to display PB6 from the CUT SPIN on CH1, the signal belongs to the MUX2 group.
MUX2 is enabled and the selected address is 6, or 0110 on S0..S3.
Because the mux enable input is active low, the enable states are EN_MUX1 = 1, EN_MUX2 = 0, and EN_MUX3 = 1.
The same logic is repeated independently for CH1, CH2, CH3, and CH4.
The four channels use the same mux principle.
Only the control pins and the physical channel area change.
The mux input families remain the same: MUX1 for the PA family, MUX2 for the PB family, and MUX3 for the PC/PD2 family.
| Cabling | Mux area |
|---|---|
| Cabling | Mux area |
|---|---|
| Cabling | Mux area |
|---|---|
The table below shows which MUX SPIN pins control each oscilloscope channel.
| Channel | S0 | S1 | S2 | S3 | EN_MUX1 | EN_MUX2 | EN_MUX3 |
|---|---|---|---|---|---|---|---|
CH1 | PA0 | PA1 | PA2 | PA3 | PC0 | PC1 | PC2 |
CH2 | PA4 | PA5 | PA6 | PA7 | PC3 | PC4 | PC5 |
CH3 | PB0 | PB1 | PB2 | PB3 | PC6 | PC7 | PC8 |
CH4 | PB4 | PB5 | PB6 | PB7 | PC9 | PC10 | PC11 |
The table below shows the shared CUT GPIO -> mux input -> address mapping used during hardware verification.
| Address | MUX1 input / CUT GPIO | MUX2 input / CUT GPIO | MUX3 input / CUT GPIO |
|---|---|---|---|
0 | I0 / PA0 | I0 / PB0 | I0 / PC0 |
1 | I1 / PA1 | I1 / PB1 | I1 / PC1 |
2 | I2 / PA2 | I2 / PB2 | I2 / PC2 |
3 | I3 / PA3 | I3 / PB3 | I3 / PC3 |
4 | I4 / PA4 | I4 / PB4 | I4 / PC4 |
5 | I5 / PA5 | I5 / PB5 | I5 / PC5 |
6 | I6 / PA6 | I6 / PB6 | I6 / PC6 |
7 | I7 / PA7 | I7 / PB7 | I7 / PC7 |
8 | I8 / PA8 | I8 / PB8 | I8 / PC8 |
9 | I9 / PA9 | I9 / PB9 | I9 / PC9 |
10 | I10 / PA10 | I10 / PB10 | I10 / PC10 |
11 | I11 / PA13 | I11 / PB11 | I11 / PC11 |
12 | I12 / PA14 | I12 / PB12 | I12 / PC12 |
13 | I13 / PA15 | I13 / PB13 | I13 / PC13 |
14 | - | I14 / PB14 | I14 / PD2 |
15 | - | I15 / PB15 | - |
The SPOC shield PCB was routed as a 4-layer board.
The external layers are used for signal routing, while the internal layers are used as GND reference planes for current return paths.
| Layer | Main role | Routing direction / use |
|---|---|---|
F.Cu | Signal routing | Mostly horizontal signal traces, shown in red |
In1.Cu | Ground plane | Internal GND layer for return current |
In2.Cu | Ground plane | Internal GND layer for return current |
B.Cu | Signal routing | Mostly vertical signal traces, shown in blue |
The internal GND planes give the signal traces a close reference plane.
This improves the return-current path, reduces loop area, and helps keep the oscilloscope signals cleaner during switching.
The routing widths are:
| Net type | Track width |
|---|---|
| Signal traces | 0.2 mm |
| Power supply traces | 0.5 mm |
| PCB view | Description |
|---|---|
F.Cu layer with red horizontal signal routing | |
In1.Cu internal ground plane for return current | |
In2.Cu internal ground plane for return current | |
B.Cu layer with blue vertical signal routing |
A VIN jumper was added to control the power link between the two SPIN boards.
The jumper avoids unintentionally connecting the two VIN lines through the USB cable.
When the jumper is soldered, both SPIN boards can be powered from a single USB cable.
| VIN jumper schematic | VIN jumper on PCB |
|---|---|
This section groups the physical board checks performed after assembly: power verification, routing validation, and output calibration observations.
Before functional testing, the board was checked for shorts and correct supply rails.
The important hardware checks passed: VIN, 3.3V, GND, BNC shield ground, and mux supply continuity.
| Rail | Measured value | Result |
|---|---|---|
VIN | 4.743 V | PASS |
3.3V | 3.286 V | PASS |
No abnormal heating was observed during first power-up.
The selected signal was checked from the CUT SPIN GPIO through the mux network to the test point and BNC output.
The hardware validation confirmed:
An early issue was found on some MUX1 / CH1 routes.
After resoldering the interior CUT SPIN pins, the failing routes worked correctly.
After correction, all 180 tested routes passed successfully, with 0 failed routes.
After observing an output offset on the BNC outputs during measurement, and after identifying the same behavior in simulation, a calibration stage was added after the functional hardware verification.
The purpose of this step is to better characterize the offset behavior and apply the required correction for improved measurement accuracy.
Offset without output:
The DC calibration setup compares three points at the same time:
VCUT: signal directly from the CUT SPIN, measured on oscilloscope CH2VTEST: signal at the local test point, measured on oscilloscope CH3VBNC: signal at the BNC output, measured on oscilloscope CH1This setup makes it possible to compare the generated source signal, the local routed signal on the shield, and the final BNC output.
| Node | Measured value |
|---|---|
VCUT | 3.409 V |
VTEST | 3.364 V |
VBNC | 3.479 V |
From these values:
VCUT to VTEST shows a drop of about 45 mVVTEST to VBNC shows an increase of about 115 mVBNC output and is the main point requiring calibrationTo investigate this effect, the equivalent resistance formed by the three 3 Mohm resistors was checked.
9 Mohm8.8 Mohm2.22%3 Mohm +/-5%With the measured resistor network, the divider is not exactly 10x:
Rosc / (Rosc + 3R) = 1 / (1 + 8.8) = 0.102Therefore, the practical correction factor is closer to 9.8 than exactly 10.
For more accurate measurements, the oscilloscope scaling should use this corrected factor instead of assuming an ideal 10x divider.
This correction is used only for precision voltage measurements; it does not affect the routing validation result.
The SPOC hardware is functionally validated for the tested routing use case.
The shield correctly routes selected CUT SPIN GPIOs through the mux network to the expected oscilloscope channel outputs.
All four channels, all three mux groups, and all mapped routes tested by the automatic sweep passed successfully.
The only remaining hardware point is the BNC output offset of about 80 mV to 120 mV.
This does not block the functional routing validation, but it should be corrected or taken into account before using the board for precision voltage measurements.
For the next PCB fabrication, the 3 Mohm divider resistors should be replaced with lower-tolerance resistors.
In this version, 5% tolerance resistors were used, which explains why the measured divider resistance was about 8.8 Mohm instead of the expected 9 Mohm.
Using lower-tolerance resistors would make the total resistance closer to 9 Mohm, so the 10x attenuation would be more accurate.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 12 | 100nF | Capacitor_SMD:C_0805_2012Metric | C1, C2, C3, C5, C6, C7, C9, C10, C11, C13, C14, C15 |
| 12 | 3M | Resistor_SMD:R_0402_1005Metric | R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12 |
| 12 | CD74HC4067SM | Package_SO:SSOP-24_5.3x8.2mm_P0.65mm | U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11, U12 |
| 8 | TestPoint | Footprints:TestPoint_THTPad_D1.5mm_Drill0.7mm | TP1, TP2, TP3, TP4, TP5, TP6, TP7, TP8 |
| 4 | C_Variable | Footprints:CAP-SMD_L4.5-W3.2_STC3MD20-T1 | C4, C8, C12, C16 |
| 4 | Conn_Coaxial | Footprints:BNC-TH_L12.0-W12.0 | BNC1, BNC2, BNC3, BNC4 |
| 4 | G*** | kibuzzard-69C2B1B5 | kibuzzard-69C2B1B5, kibuzzard-69C2B1B5, kibuzzard-69C2B1B5, kibuzzard-69C2B1B5 |
| 4 | MountingHole_Pad | MountingHole:MountingHole_2.5mm_Pad_Via | H5, H6, H7, H8 |
| 2 | OwnTech_SPIN | Footprints:OwnTech_SPINTHT | J1, J2 |
| 1 | Conn_01x02_Pin | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MPT-0,5-2-2.54_1x02_P2.54mm_Horizontal | J3 |
| 1 | G*** | kibuzzard-69C2FCCB | kibuzzard-69C2FCCB |
| 1 | G*** | kibuzzard-69C2FDF9 | kibuzzard-69C2FDF9 |
| 1 | G*** | kibuzzard-69C66E4E | kibuzzard-69C66E4E |
| 1 | G*** | kibuzzard-69C660C3 | kibuzzard-69C660C3 |
| 1 | G*** | kibuzzard-69C2FC5B | kibuzzard-69C2FC5B |
| 1 | G*** | kibuzzard-69C66127 | kibuzzard-69C66127 |
| 1 | G*** | kibuzzard-69C2FDE2 | kibuzzard-69C2FDE2 |
| 1 | G*** | kibuzzard-69C2B294 | kibuzzard-69C2B294 |
| 1 | G*** | kibuzzard-69C2FDEE | kibuzzard-69C2FDEE |
| 1 | G*** | kibuzzard-69C2B2AC | kibuzzard-69C2B2AC |
| 1 | G*** | kibuzzard-69C2B27D | kibuzzard-69C2B27D |
| 1 | G*** | kibuzzard-69C2B196 | kibuzzard-69C2B196 |
| 1 | G*** | kibuzzard-69C2A2EA | kibuzzard-69C2A2EA |
| 1 | SolderJumper_2_Open | Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm | JP1 |

heiso/macrolev
Macrolev is an open source analog keyboard powered by Hall Effect switches




Bad-Dog-Designs/ESP32-S3-Synthesizer
Source code and KiCad Files for the build of an ESP32 S3 Based synthesizer. CAN bus is used extensively to collect all the pots and switch data and send to the ESP32 engine

FlightDeckDIY/G1000-NXi-Mega
Welcome to the G1000 NXi Mega project! This repository contains the schematic and PCB design files for a custom-built G1000 avionics panel, designed specifically for use with flight simulators like Microsoft Flight…

vuckale/takt11800
Replacement PCB for Cherry G80 11800/Compaq MX 11800 keyboard using QMK firmware and VIA

Alejojoa/Triatlon-Alita
Repositorio dedicado al desarollo de un robot triatlon.
It measures 100 × 110.5 mm and has 4 copper layers, 1.6 mm thick.
77 parts, built around the CD74HC4067SM96. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the EdamAbdelhedi/SPOC_Hardware repository on GitHub, at the commit this page was made from: the board is KiCad/SPIN Oscilloscope Shield.kicad_pcb and its schematic KiCad/SPIN Oscilloscope Shield.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask EdamAbdelhedi before reusing the design.