week 09 Input Devices

Objectives

Group assignment: probe an input device's analog levels and digital signals

Individual assignment: measure something: add a sensor to a microcontroller board that you have designed and read it

Group assignment

In group assignment, we focused on analyzing input devices by probing their analog and digital signals using an oscilloscope. We tested the INMP441 MEMS microphone, which produces a digital signal, and the PS2 joystick module, which outputs an analog signal. The oscilloscope was used to measure and visualize voltage variations from both sensors.

Input Devices

Sensors

Sensors are devices that detect and measure changes in their surrounding environment and convert them into electrical signals. These changes can be in the form of light, temperature, pressure, motion, humidity, sound, chemical composition, or other physical properties. Sensors play a crucial role in modern technology by enabling automated systems, data collection, and real-time monitoring.

DS18B20 – Digital Temperature Sensor

The DS18B20 is a digital thermometer that provides 9 to 12-bit Celsius temperature measurements and communicates over a 1-Wire bus, requiring only one data line (and ground) to connect to a central microprocessor. It is highly versatile due to its unique 64-bit serial code, which allows multiple sensors to function on the same bus, and its ability to derive power directly from the data line

ATtiny1624

ATtiny1624 is a compact and powerful 8-bit microcontroller from Microchip’s tinyAVR 2-series, designed for embedded systems and sensor-based projects.

Key Features

  • 16 KB Flash memory → enough for medium-size programs
  • 2 KB SRAM → supports more variables and buffers
  • 20 MHz clock → fast processing
  • Multiple GPIO pins → connect sensors, LEDs, displays
  • Why It’s Good for my Project

  • Easily reads sensors like temperature, light, etc.
  • Supports serial output (for monitoring data)
  • Enough memory and pins for future upgrades
  • Resistor: 4.7kΩ (pull-up resistor for DS18B20)

    The 4.7kΩ resistor helps the DS18B20 communicate correctly and reliably with the microcontroller.

    CAPACITIVE SENSING

    Capacitive sensors detect objects by measuring changes in capacitance, which occurs when an object enters the sensor's electrostatic field, without needing physical contact

    Making the circuit

    After learning and understanding how the sensor works, I determined the number of pins required for the sensor and the LED. Based on this, I selected the ATtiny1624 microcontroller, as it provides sufficient I/O pins and better flexibility for the project.

    Data sheet.

    After understanding how the sensor works, I designed the circuit in KiCad. I selected the ATtiny1624 microcontroller because it has enough pins to connect the sensor, LED, and serial communication, making it suitable for this project.

    To check the connection use Ruleschecker tool

    Open the schematic editor. We need to specify the design rules

    First, draw a rectangle using the square tool in KiCad PCB Editor to make a pad.

    Double-click the rectangle, then select the ‘Filled Shape’ option

    To trace route use the shortcut X or use the route tracks tool in the right panel. Click on edgecuts and using rectangle in tools option draw the outline. Rightclick on the outline and use shape modification option for reshaping outline. You can add text using text tool.

    Check the traces using rules checker tool. from file -> Fabrication outputs -> gerbers , we get the gerber format. the gerber files are uploaded in gerber2PNG software to convert it to png format.

    This PNG contains only the PCB traces (copper paths).

    This PNG shows all drill holes.

    This PNG contains the PCB board outline.

    Milling the PCB

    Engraving the trace

    Open Mods CE. Upload the trace layer. I used 0.2mm 60 deg V bit. Millling was done in Modela MDX-20 3D Milling Machine. I set origin as x:6 and y:4. Set the zero position (X, Y, and Z-axis) manually. Adjust milling parameters like spindle speed, feed rate, and depth of cut based on the material and tool specifications.

    we can view the trace toolpath

    We only have a large PCB available, so we used the remaining space. The other side can be milled by others. This image is for reference on how to apply double-sided Nippo tape for fixing

    Click send file option in mods to start engraving the trace

    Cutting Outline

    After engraving the trace, we have to cut the outline. The outline layer is oploaded in mods CE.We use 1/32" bit.

    The toolpath is shown below.

    Using send file option initiate the cutting process.

    Use a vaccumcleaner to remove dust and debris. Use a scraper to lift the board.And here is the final result.

    Assembling the PCB

    Interactive HTML BOM is generated in KiCad and the components were taken from inventory.

    This is the list of components created by FabTash.

    The components are soldered into the PCB

    I used a digital microscope to check that all components are soldered properly and there are no shorts.

    Programming

    I connected my PCB to a programmer to connect it to my laptop and ran a simple blink test to check if its working. I referred to Revishanker's documentation to setup the board in arduino IDE.

    Open Arduino IDE → Preferences and add the MegaTinyCore URL: http://drazzy.com/package_drazzy.com_index.json

    Then go to Boards Manager, search for MegaTinyCore, and install it.

    Go to Tools → Board → megaTinyCore, select ATtiny3224/1624 series, and choose ATtiny1624.