Input Devices

This week we focus on the the wonderful field of input devices.

The assignment was:

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

For this assignment we visited the Fab Lab of the Cientifica del Sur University.

The sensor we used for the tests was the FC-28 soil moisture sensor

You can see the complete documentation on the group's web page

What did I learn?

The moisture sensor can read the amount of moisture present in the surrounding soil.

The sensor uses two probes to pass current through the ground.

The values obtained are low when there is water in the soil and high when the soil is dry.

Sensor values range from 0 to 1023.

Individual assignment

A few weeks ago I made my first custom PCB board called crisduino (hahaha...) you can see the full documentation in week 8

For this assignment we will connect the KY-038 sensor microphone module

The ky-038 sound sensor is a very basic sound level detector module which features an electric condenser microphone.

This is the basic connection of Ky-038 module to xiao rp2040 microcontroller:

1. analog signal, we will use the yellow jumper wire.

2. GND, we will use the orange jumper wire.

3. 5V, we will use the red jumper wire.

On my "crisduino" PCB board we connect:

1. A0, on the analog pin with the yellow jumper wire.

2. GND. on the gnd pin with the orange jumper wire.

3. 5V, on the power pin with the red jumper wire.

On my "crisduino" PCB board we connect:

1. A0, on the analog pin with the yellow jumper wire.

2. GND. on the gnd pin with the orange jumper wire.

3. 5V, on the power pin with the red jumper wire.

To program the sensor input reading we will use Arduino IDE.

This is the programming code.

            #include <Arduino.h>

            // Define the pin to which the KY-038 sensor is connected
            const int sensorPin = A0;
            
            void setup() {
            
            // Start serial communication at 9600 baud
            Serial.begin(9600);
            }
            
            void loop() {
            // Read sound sensor value
            int sensorValue = analogRead(sensorPin);
            
            // Send the sensor value to the serial port
            Serial.println(sensorValue);
            
            // Wait a short period before taking another reading
            delay(100);
            }
            

First test with ambient audio.

1. lines of code.

2. reading on the serial monitor.

3. graphic reading.

First test with ambient audio.

First test with ambient audio.Fortunately, I have not had any problems or inconveniences in viewing the communication.

final test with the System Of A Down - Toxicity

Download files

Here we can find and download the design original files