Arduino · Einsteiger · Stufe 8 / 40
Sensor Modules and Using Libraries
Add common sensor modules with libraries, read their datasheets and handle bad readings.
Einsteiger freischalten · CHF 9.90 Stufen 1–13, einmalig, kein Abo
10 Lektionen in dieser Stufe
- Installing Libraries with the Library Manager
Search for, install, update and remove libraries in IDE 2. · Lab: Install a DHT sensor library and find where it is stored on disk. - Learning a Library from Its Examples
Open bundled examples and work out which functions a library offers. · Lab: Run a library example unchanged, then list every function it calls and what each returns. - Temperature and Humidity with DHT11 and DHT22
Read a single-wire digital sensor and respect its minimum sampling interval. · Lab: Print temperature and humidity every two seconds and compare the two sensor types. - Distance with an HC-SR04 Ultrasonic Sensor
Trigger a pulse, time the echo with pulseIn and convert it to centimetres. · Lab: Measure distances from 5 to 100 cm and compare with a ruler. - Motion Detection with a PIR Module
Use a digital-output motion sensor and adjust its sensitivity and hold time. · Lab: Switch on an LED for ten seconds after motion is detected. - Soil Moisture: Resistive and Capacitive Probes
Read moisture probes and explain why resistive ones corrode. · Lab: Record dry-air and in-water values for both probes and map them to percent. - Sound Level and Clap Detection
Detect short peaks from a microphone module. · Lab: Toggle an LED with a clap and reject continuous noise. - Comparator Modules and Their Trim Potentiometer
Understand modules with a digital threshold output and set the trip point. · Lab: Adjust an infrared obstacle module and a hall sensor module to switch at a chosen distance. - Reading a Sensor Datasheet for Range, Accuracy and Timing
Extract supply voltage, range, accuracy and timing limits from a datasheet. · Lab: Fill in a comparison sheet for the DHT11, DHT22 and HC-SR04 from their datasheets. - Validating Readings and Handling Sensor Failure
Detect impossible values, timeouts and missing sensors and react safely. · Lab: Unplug each sensor while running and make the sketch report the fault instead of nonsense.
Abschlussprojekt
A room and plant monitor that reports temperature, humidity, soil moisture, motion and distance over serial and sounds an alarm on limits.
Teile für diese Stufe
- 1 × UNO-compatible board
- 1 × USB cable matching the board
- 1 × Solderless breadboard 830 points
- 1 × Jumper wire set male-male and male-female
- 1 × DHT11 temperature and humidity module
- 1 × DHT22 temperature and humidity module
- 1 × HC-SR04 ultrasonic distance sensor
- 1 × PIR motion sensor module
- 1 × Capacitive soil moisture sensor
- 1 × Resistive soil moisture sensor
- 1 × Microphone sound sensor module
- 1 × Infrared obstacle sensor module
- 1 × Hall effect sensor module
- 1 × Passive buzzer
- 3 × LED 5 mm assorted
- 3 × Resistor 220 ohm
In jeder Lektion legst du die passenden Teile direkt in den Warenkorb. Arduino-kompatibel →
Voraussetzung: Levels 1–7: digital and analog input, serial output, functions and arrays.