9. Input Devices

This week focused on input devices: sensors and modules that read information from the physical world and send it to a microcontroller. My assignment was to use an input device, measure and display data from it. I chose a DS3231 Real-Time Clock (RTC) module, which keeps precise track of date and time even when the main circuit is powered off. To connect it to my custom PCB (which I made in week 8), I also had to design and fabricate a small I2C adapter board, since my base PCB didn't include the pull-up resistors that I2C communication requires.

The general workflow this week was:

To know more about different input devices and the I2C protocol, check out the group assignment.

Group Assignment

Key Concepts

What is an Input Device?

In electronics, devices can be divided into two categories: inputs and outputs. An input device is any sensor or module that gathers data from the physical world and sends it to a microcontroller. Examples include: temperature sensors, buttons, microphones, cameras, light sensors, and clocks. The microcontroller reads that data and decides what to do with it, like turning on a fan when temperature is too high or displaying the current time on a screen.

This is the opposite of an output device (like a motor or LED), which receives a command from the microcontroller and does something in the physical world. A complete project usually has both: inputs that read data, and outputs that react to it.

I2C Adapter PCB

Since my base PCB from week 8 did not include I2C pull-up resistors, I designed a small adapter board in KiCad. This board adds the two 4.7 kΩ resistors on the SDA and SCL lines and breaks out the I2C connector so the DS3231 module can plug directly in. The design and fabrication process followed the same workflow as week 8: KiCad, Gerber2PNG, Mods Project, milling, and soldering.

I2C Adapter Design in KiCad

Programming

With the adapter board built, the next step was to write code for the XIAO microcontroller to read the time from the DS3231 and print it to the serial monitor. This required setting up Arduino IDE with the right board definition and library, then troubleshooting several communication issues.

Setting Up Arduino IDE

Learning Outcomes

This week pushed me to understand not just how to follow a process, but why each step matters and what happens when something goes wrong at a component level.

The sensor is partially working and I will continue troubleshooting the stable communication issue. The I2C adapter board is functional and the infrastructure is in place — it is a wiring or timing issue that remains to be resolved.

Files

KiCad Files Gerbers RML Files Code