Input Devices Overview
This week focused on exploring input devices and their integration into microcontroller-based systems. The objective was to use multiple sensors as input sources for data collection and processing.
Group assigment
Probe an input device(s)'s analog levels and digital signals
Document your work on the group work page and reflect on your individual page what you learned
Link to group assignment: Link
Key Learnings from Sensor Signal Analysis Tool Selection
- Digital Oscilloscope: Essential for visualizing time-dependent signal changes and analyzing dynamic behavior.
- Multimeter: Useful for quick, static voltage readings but limited in capturing real-time signal variation.
- Capacitive Soil Moisture Sensor: Outputs analog signals requiring continuous monitoring to assess response time, sensitivity, and noise.
- Water Flow Sensor: Outputs high-frequency digital pulses reflecting flow rate; requires high-speed measurement tools.
- Analog sensors require appropriate Analog-to-Digital Converter sampling rates to capture meaningful variations.
- Digital sensors require interrupt-driven counting or timing mechanisms to calculate flow rate accurately.
- Oscilloscopes are vital during prototyping and debugging to understand sensor behavior in real-time.
- Choosing the right tool improves both hardware design, ensuring reliable data acquisition.
For this individual assignment which is to Measure something: add a sensor to a microcontroller board that you have designed and read it.
I built the circuit board that was fabricated during Week 8. The board includes a Seeed XIAO RP2040 microcontroller and supports both analog and digital communication protocols.
Soil Moisture and Rain Sensor Monitoring
The objective is to use soil moisture sensor and raindrop sensor as analog input.
Communication Protocols Used:
- I2C: Used to communicate with the 1602 LCD display.
- UART (Serial1): Used for serial communication between nodes or modules.
- Analog Input: Used to read values from both the soil moisture and rain sensors.
Components Used
- Soil Moisture Sensor – Connected to analog pin
A0
. - Rain Sensor – Connected to analog pin
A1
. - Seeed XIAO RP2040 – Microcontroller managing the sensors and display.
Understanding the Sensor Readings
Soil Moisture Sensor:
- High Analog Values: Indicates that the sensor is in a wet environment or submerged in water.
- Low Analog Values: Indicates that the soil is dry.
- To verify sensor accuracy, it was tested under controlled wet and dry conditions:
- Dry Condition: Sensor left in open air or inserted in dry soil.
- Wet Condition: Sensor submerged in a glass of water or inserted in moist soil.
Rain Sensor:
- Provides analog readings based on moisture detected on its surface.
- Used to detect the presence of rain or surface water droplets.
- Can also trigger actions when rainfall is detected.
System Behavior and Output
- Sensor readings are continuously processed by the microcontroller.
- Results are displayed on the Serial.
Moisture sensor value: Low (e.g, below 500).
Rain sensor value: Low or zero.
Serial displays "Soil: Dry"
Moisture sensor value: High (e.g, above 500).
Rain sensor value: High (analog value depending on intensity).
Serial shows "Rain Detected!."
Test results
Rain



Moisture



Code file to test
Soil moisture
Raindrop sensor