During this week, I focused on understanding how microcontrollers perceive the physical surroundings through input devices.
Also, the main objective of the assignment was to integrate a sensor to the Seeed Xiao RP2350 in the PCB I designed and read its
data. To fulfill this, I will be using a PIR (Passive Infrared) motion sensor, an electronic device that detects movement based on changes in infrared radiation.
Also, for this week I will be consulting our Group Assignment.
◆ What is an Input Device?
An input device is a component that allows a microcontroller to receive information from its surroundings. It converts physical phenomena into electrical signals that can be read and processed. Besides, depending on the sensor’s architecture, this communication occurs through two types of signals.
Signal
Description
Analog
Continuous values that vary over time, such as temperature or light intensity.
Digital
Discrete values represented as HIGH or LOW, such as a button press or motion detection.
I2C Communication
Digital communication protocol that allows multiple devices to send data using two lines (SDA AND SCL).
✦ PIR Motion Sensor
The PIR (Passive Infrared) sensor detects motion by measuring changes in infrared radiation emitted by objects, such as the human body. When a person crosses its field of view, the sensor registers this thermal variation and outputs a digital signal.
The PIR sensor communicates via a digital signal, operating on a binary state. When the sensor detects movement through thermal variations, it triggers a HIGH output. Conversely, when the environment remains static, the output defaults to a LOW state.
◆ Components
✦ What I will be using?
1.Seeed XIAO RP2035
2.PIR Motion Sensor
3.Jumper wires
◆ Circuit Connections
The PIR sensor typically has three pins:
1. VCC → 3.3V
2. GND → GND
3. OUT → Digital pin
✦ Sensor Callibration
Adjustment controls of the PIR motion sensor. The module includes two potentiometers: one for time delay and another for sensitivity. Rotating clockwise increases the delay time (up to 5 minutes) and decreases sensitivity (down to 3 meters), while rotating counterclockwise reduces the delay (down to 3 seconds) and increases the sensitivity (up to 7 meters).
✦ Programming
The following code is programmed so that when the sensor detects nearby movement, the LED lights on the PCB will illuminate, remaining on for a few seconds, and then turn off when no nearby presence is detected.
To read the data from the sensor, the program was uploades to the microcontroller using Arduino IDE
01. CONNECT THE BOARD
Connect the Seeed XIAO RP2350 to the computer using a C cable.
02. INSTALL ARDUINO IDE
Launch the Arduino IDE Software. Then go to Arduino IDE → Settings → Additional boards manager URLs → Paste the URL: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json → OK.
03. SELECT THE BOARD
Go to Tools → Board → Select Seeed XIAO RP2350
04. INSTALL LIBRARIES
Go to Tools → Board: "Seeed XIAO RP2350" → Boards Manager → Search: Raspberry Pi Pico/RP2040/RP2350 → Install.
05. SELECT THE PORT
Go to Tools → Port → Choose the correct serial port where the board is connected.
06. WRITE THE CODE
Copy and paste the code into Arduino IDE.
07. UPLOAD THE CODE
Click the upload (→) button to send the code to the microcontroller.
Throughout this week, I encountered some difficulties as I had to delve deeper into the world of electronics. Therefore, I can say there was a lot of trial and error when programming the Arduino code, as it was my first time using it. However, I was able to achieve the assignment goal, and I'm surprised by what I was able to accomplish during the week of inputs.
✦ Download Here!
In this section, you can find the downloadable source files developed during this week.