Day 14: Measure it: sweeping the CD4007 inverter VTC on a breadboard
Ship a measured artifact
The CD4007 is a classic CMOS array: three PMOS/NMOS transistor pairs on one chip, pins brought out so you can wire your *own* gates. Configure one pair as an inverter (PMOS source to Vdd, NMOS source to ground, gates tied as input, drains tied as output), then sweep the input and record the output — your Day 9 VTC, measured on real silicon.
const int PWM_PIN = 9; // PWM -> RC low-pass -> Vin of the inverter
const int VOUT_PIN = A0; // inverter output
const float VREF = 5.0; // measure your actual rail!
void setup() { Serial.begin(115200); Serial.println("Vin_V,Vout_V"); }
void loop() {
for (int duty = 0; duty <= 255; duty += 4) {
analogWrite(PWM_PIN, duty); // sets Vin ~ (duty/255)*VREF after RC
delay(30); // let the RC filter settle
float vin = (duty / 255.0) * VREF;
float vout = (analogRead(VOUT_PIN) / 1023.0) * VREF;
Serial.print(vin, 3); Serial.print(","); Serial.println(vout, 3);
}
while (true) {} // one sweep, then stop
}Paste the logged pairs into a plot. You should see the characteristic flat-high / steep-drop / flat-low shape. From it, read off the switching threshold `Vm` (where the curve crosses Vin = Vout) and estimate the noise margins at the unity-gain points — turning Days 9–10 from theory into numbers you measured yourself.
What a good CD4007 inverter sweep looks like (Vdd = 5 V) — annotate Vm and the unity-gain points on yours.
Measurement hygiene
Measure your actual Vdd (it's rarely exactly 5.00 V) and use it as VREF. Add the RC low-pass on the PWM pin or your 'Vin' will be a square wave, not a DC level. Sweep slowly — settle the filter before each ADC read. These habits carry straight into every lab measurement in the continuous track.
Ship: docs/stage0/inverter_vtc.png + setup photo
Commit your measured CD4007 VTC plot with Vm and the noise margins annotated, plus a photo of the breadboard setup. This is one of the three Stage 0 ship artifacts and a standout portfolio piece — very few self-taught candidates arrive with a real measured VTC.
Key terms
- CD4007
- A CMOS transistor-array IC (3 PMOS/NMOS pairs) usable to wire your own gates at the transistor level.
- PWM DAC
- A pulse-width-modulated pin plus an RC low-pass filter, used to synthesize an adjustable DC voltage.
- Unity-gain points
- The VTC points where slope = −1; they define VIL and VIH for noise-margin extraction.
Ship for Day 14
Why must you put an RC low-pass filter between the Arduino PWM pin and the inverter input?