Input

This week, we tested some input electronic components. That means I used a sensor that provides us with information. I wanted to test a pulse sensor with the Serial Plotter to see how my pulse reacts during this stressful Fab Academy time.

Here is the list of what you need for this experiment:

  • Pulse sensor
  • Xiao ESP32-C6
  • Cables in different colors (Red, Black, White)
  • Bent Pin Headers
  • A CNC board (I used the design from last week – click here for Week 8 )
  • USB-C cable
  • Soldering equipment
  • Arduino IDE software

Soldering

At first, I wanted to use the CO₂ sensor for my final project, but things didn’t go as planned. I used the wrong voltage for the CO₂ sensor. It requires 5V, but my board design was based on 3.3V. Additionally, I found out that the CO₂ sensor needs 24 hours of preheating before it works properly.

datasheetMQ135

change sensor

So, I changed my plan again and decided to use the pulse sensor for my input week.

pulsesensor

This is a pulse sensor from pulsesensor.com

Steps:

  1. Start by soldering the bent pin headers onto my board.

bent pin header with board

  1. Solder the Xiao ESP32-C6 onto the CNC board.

boardwith pinheader and xiao

My advice: I used flux to improve heat transfer and make soldering easier. After each soldering step, I tested the connections with a multimeter.

worktools

Here you can see my “beautiful” mistake:

desolderingpump

There was an unintended connection between GND and the 5V pin, which prevented the board from working correctly. I used a desoldering pump to remove excess solder. I think this helpful tool will be my best friend for a long time.

You can also use desoldering braid, but in my case, it didn’t work very well.

Once all the connections are correct (and please check them frequently!), you can connect the cables and plug the USB-C cable into your laptop.

connectionof all components

Programming

You can find more information about the pulse sensor here on the official website.
The datasheet for the sensor can be downloaded here.

A simple way to check if the sensor is working is to start by establishing communication between the sensor and the Serial Monitor.

Here is the code I used:


const int KY_031 = D0;  // Analog-Pin for the KY_031

void setup() {
    Serial.begin(115200);  // serial communication start
    pinMode(KY_031, INPUT);
}

void loop() {
    int sensorValue = digitalRead(KY_031);  // sensor Value reading
    Serial.println(sensorValue);
    delay(50);
}

sensorworking

No files in this week:

  • You can copy the code if you want to use it. This is easier to use a text document file
  • You can use the board files from week8 click here for Week 8

Group assignment

This week, we analyzed the analog levels and digital signals of input devices. We used the Rigol DS1054Z oscilloscope and connected vibration sensors to measure and evaluate their output. I learned how to use an oscilloscope, as I was previously only familiar with a multimeter. I really appreciate how the oscilloscope provides a visual representation of the sensor’s behavior, making it much easier to understand how it works. Check out the details of our group assignment here: Click here