Week 8 header image

WEEK 8

Week 8 - Input Devices

Introduction

This week was all about input devices. The goal was to measure something by adding a sensor to a microcontroller I designed and then read the signal. I was away in Europe for job interviews and got back on Sunday, so I had a very compact runway: Monday and Tuesday to catch up on last week and complete this assignment. Coffee levels were high, optimism too.

Individual Assignment

Board Design

Week 6 and I had a memorable time together, as I made many mistakes learned a lot of lessons. So I started over for Week 8 with a calmer, sturdier layout. The design is intentionally simple: one push button and one slide switch, a white LED, and an RGB LED. The goal is straightforward: program basic interactions between the inputs and the LEDs, without turning the copper pour into one giant short like two weeks ago. Here some adjustments I made this time:

Week 8 schematic Week 8 PCB layout

Files for milling: W8_BoardFiles.zip

Milling the Board

In Week 6 it took multiple attempts to get a usable board. This time I approached the Roland Modela with respect and a tiny bit of fear. The “lid-open” blinking saga made a cameo; the fix, learned the hard way: power cycle and move on. No one hour of existential troubleshooting this time (btw still not clear to me why this happens).

Ten quiet minutes later: crisp traces, calm heart rate.

Freshly milled PCB

Soldering

I will admit it: I was worried I would drown the board in solder. At that exact moment, providence sent me Gert.

Huge shoutout to Gert - he generously spent about an hour guiding me through good technique, joint inspection, and patience. Legend.

Here the soldered board, as well as most of Gert's feedback on my soldering.

Assembled PCB with feedback

Connecting the Board

On first plug-in, the board lit up. Then the Arduino IDE mysteriously stopped showing any serial port

haha! this is the plot twist that destiny reserved for me this week!

My troubleshooting tour, powered by curiosity and several tabs:

After more than an hour of back-and-forth, it finally reappeared. Relief was immediate and visible.

Programming

First surprise: pin naming. I assumed the D numbers were what the Arduino core expected. In reality, I had to use the P numbers in code for this setup.

Pin mapping check

Then, I pushed some code to check that the board was working properly:

I am not a coder, so I leaned on AI for a few quick snippets. For the button read, Irelied on old friend Google and wrote a minimal sketch myself:

Button Read — Minimal Sketch

const int buttonPin = 28;
bool buttonState = 0;

void setup() {
  pinMode(buttonPin, INPUT_PULLUP);
  Serial.begin(9600);
}

void loop() {
  buttonState = digitalRead(buttonPin);
  if (buttonState == LOW) {
    Serial.println("Button pressed!");
  } else {
    Serial.println("Button not pressed.");
  }
  delay(200);
}
Serial monitor showing button state

Group Assignment

This week, our group used an oscilloscope to probe a motion sensor’s analog and digital outputs. The yellow trace showed voltage rising with motion and dropping when still, while the blue trace served as a ground reference. After wiring power, ground, and output to the scope, we noted that the sensor could detect movement even inside a box and that its digital signal showed a brief one-to-two-second delay.

group

Final Project

Please note that Input Devices are a key part of my final project. It is well documented in my final project page.


Back to main page.