Week 09 Input devices

Exploring output devices this week showed me how important feedback is in user experience. Whether it's lights, sounds, or displays, output devices bring the system to life by communicating information clearly and effectively.

Learning Objectives

👥 Group Assignment

We used a multimeter to detect the digital signal of the Hall sensor. (The connection method and code for controlling the LED with the Hall sensor are detailed below.) We tested the voltage difference transmitted to the development board when the Hall sensor was exposed to a magnet and when no magnet was present.

1

Set the multimeter to DC voltage mode.

Voltage Variation

No magnet nearby: Most modules output High level ≈ 4.436V on DO

1

Magnet nearby: DO outputs Low level ≈ 0.367V

1

1 Digital Hall Sensor

A Digital Hall Sensor is a magnetic field sensor based on the Hall effect. It can detect the presence or absence of a magnetic field and outputs a digital signal (HIGH or LOW). It is commonly used for position detection, speed measurement, and switch control.

1

1.1 Basic Principle

1.2 Wiring

ComponentArduino Pin
WS2812B DataD2
WS2812B VCC5V
WS2812B GNDGND
Hall Sensor OUTD3
Hall Sensor VCC5V
Hall Sensor GNDGND
1

1.3 Code

1
Code01 for this week

1.4 Video

2 Final Project:Digital Hall Sensor

When a student puts their apple near the Hall sensor, the LED lights up and a happy “Great job!” plays.

Connection layout

1

code

1

Test

3 Sound Sensor

A sound sensor is a component that receives sound waves and converts them into electrical signals. It works like a microphone to detect the sound intensity in the surrounding environment. It has various applications, such as noise monitoring, voice control, and security alarms.

1 1

Component

1

3.1 Sound Sensor Pins

1
Pin Function
A0 Analog Output (Range 0~1023)
VCC Power Input (5V)
G Ground
1

3.2 Buzzer

A buzzer is an audio signaling device that can be controlled by electrical signals to produce sounds of different frequencies and intensities. It is commonly used for alarms, notifications, and sound feedback applications.

1 1

Passive Buzzer Pins

Pin Function
VCC Power Inpuy (5V)
I\O Connected to D9 via tone() control
GND Ground

Active Buzzer & Passive Buzzer

Feature Active Buzzer Passive Buzzer
Internal Oscillator ✅ Built-in Oscillator ❌ Requires PWM
Control Method Simply turn on/off with HIGH/LOW signal Requires PWM signal for sound generation. Requires tone()
Sound Types Fixed frequency Can produce multiple tones and melodies
Sound Modulation ❌ Fixed Frequency ✅ Can Play Melodies
Wiring Directly Connect to Arduino Requires PWM Control
Common Uses Alarms, simple notifications Music tones, sound effects

3.3 Component Introduction

Main Hardware

Component Function
Arduino UNO Controls the entire system
Sound Sensor Detects sound intensity in the environment
Passive Buzzer Generates alarm sounds
Jumper Wires Connects components
Breadboard Used for circuit assembly

3.4 Circuit Connections

3.1 Connecting the Sound Sensor

Sound Sensor Arduino
A0 A0
VCC 5V
G GND
1

3.5 Connecting the Passive Buzzer

Passive Buzzer Arduino
VCC 5V
I/O D9
GND GND
1

3.6 Arduino Code

1

3.7 Compilation & Testing

Upload the code and test it by monitoring sound intensity in the Serial Monitor.

1 1
Code02 for this week