For this assignment, I have documented my learning experiences with input devices, including their types, working principles, and how to connect them to various microcontroller boards, including the one I built this week. I have detailed my use of my custom board with both input and output devices relevant to my final project. This week, I successfully troubleshooted and programmed my board. I connected sensors for temperature, humidity, and methane gas detection. Additionally, I have recorded what went well, what didn't, how I would approach things differently in future assignments, and my learning outcomes.
An input device is a hardware component used to provide data and control signals to a computer or other electronic system. These devices allow users to interact with and control the system by inputting information, commands, or actions. Examples of input devices include keyboards, mice, sensors, touchscreens, and microphones. Input devices can capture various types of data, such as text, images, sound, temperature, and motion, enabling the system to process and respond to the user's inputs.
The purpose of input devices is to facilitate interaction between the user and a computer or electronic system. They serve several key functions:
An ultrasonic sensor is a device that measures distance by using ultrasonic waves. It works by emitting a high-frequency sound wave (ultrasound) and then measuring the time it takes for the echo of the sound wave to return after bouncing off an object. This time delay is used to calculate the distance between the sensor and the object.
The ultrasonic sensor typically consists of two main components: a transmitter and a receiver. The transmitter emits the ultrasonic sound waves, while the receiver detects the reflected waves. The basic working steps are as follows:
Ultrasonic sensors are used in a variety of applications, including:
The pinout diagram for an ultrasonic sensor typically includes connections for power, ground, and signal pins for both transmitting and receiving ultrasonic waves.
Commonly found pins in an ultrasonic sensor pinout diagram may include:
The pinout diagram provides a visual representation of these connections, aiding in the integration of the ultrasonic sensor into electronic projects or systems.
Serial.begin(9600);
initializes serial communication at a baud rate of 9600.
pinMode(trigPin, OUTPUT);
sets the trigger pin (pin 7) as an output.
pinMode(echoPin, INPUT);
sets the echo pin (pin 6) as an input.
Clears the trigger pin.
Sets the trigger pin high for 10 microseconds to send out an ultrasonic pulse.
Reads the duration of the pulse reflected back to the echo pin.
Calculates the distance based on the duration.
Prints the distance to the Serial Monitor.
An IR (Infrared) sensor is a device that detects infrared radiation in order to sense its surroundings. These sensors can be used to measure the heat emitted by objects and to detect motion. They work by emitting infrared light and then measuring the reflection or absorption of this light by objects in their vicinity.
An IR sensor typically consists of two main components: an infrared LED (Light Emitting Diode) and an IR photodiode or phototransistor. The basic working steps are as follows:
IR sensors are used in a variety of applications, including:
The pinout diagram for an IR sensor typically includes connections for power, ground, and signal pins for both the IR LED and the photodiode or phototransistor.
Commonly found pins in an IR sensor pinout diagram may include:
The pinout diagram provides a visual representation of these connections, aiding in the integration of the IR sensor into electronic projects or systems.
Serial.begin(9600);
initializes serial communication at a baud rate of 9600.
pinMode(irPin, INPUT);
sets the IR sensor signal pin (GPIO 21) as an input.
Reads the value from the IR sensor.
Checks if the sensor is detecting an obstacle.
Prints "Obstacle detected"
if an obstacle is detected (when the IR sensor signal pin reads HIGH).
Prints "No obstacle"
if no obstacle is detected (when the IR sensor signal pin reads LOW).
Waits for 100 milliseconds before taking the next reading.