Kurse › Raspberry Pi › Stufe 8
Raspberry Pi · Einsteiger · Stufe 8 / 40
Beginner Sensors and Data Logging
Connect common sensor modules safely, turn their signals into numbers and record them over time.
Einsteiger freischalten · CHF 9.90 Stufen 1–13, einmalig, kein Abo
10 Lektionen in dieser Stufe
- Digital Versus Analog Signals and Why the Pi Has No Analog Input
Tell the two signal types apart and know which sensors need extra hardware. · Lab: Sort the modules in a sensor kit into digital, analog and bus-based by reading their pins. - Level Shifting 5 V Signals with a Voltage Divider
Reduce a 5 V output to a safe 3.3 V input with two resistors. · Lab: Build a 1 k / 2 k divider, feed it 5 V and confirm about 3.3 V with a multimeter before connecting a pin. - Measuring Distance with an Ultrasonic Sensor
Time an echo pulse and convert it into distance with DistanceSensor. · Lab: Wire an HC-SR04 through a divider and print the distance to a moving book. - Reading Temperature from a DS18B20 on the 1-Wire Bus
Enable the 1-Wire interface and read a sensor from its system file. · Lab: Turn on 1-Wire in raspi-config, wire the probe with a 4.7 k pull-up and read the temperature in Python. - Estimating Light Level with an LDR and a Capacitor
Measure an analog quantity by timing how fast a capacitor charges. · Lab: Build the LDR-capacitor circuit and read relative brightness with LightSensor. - Tilt, Vibration and Flame Modules from a Sensor Kit
Use comparator-based modules that give a simple digital output. · Lab: Wire three kit modules as digital inputs and set each threshold trimmer. - Timestamps and Sampling Intervals
Sample at a steady rate and label each reading with reliable time. · Lab: Take a reading every five seconds for two minutes and check the spacing does not drift. - Logging Sensor Readings to CSV
Write structured rows with headers that a spreadsheet can open. · Lab: Log three sensors to one CSV file and open it on your laptop. - Smoothing Noisy Readings with Averages and Medians
Reduce jitter and reject outliers without hiding real changes. · Lab: Apply a moving average and a median filter to ultrasonic data and compare the results. - Plotting Logged Data with matplotlib
Turn a CSV log into a labelled chart saved as an image. · Lab: Plot a day of temperature and light with two y-axes and save it as PNG.
Abschlussprojekt
A room logger that records temperature, light level and distance every minute to CSV and produces a daily chart as an image file.
Teile für diese Stufe
- 1 × Raspberry Pi 5 or Pi 4 set from Level 1
- 1 × Breadboard and jumper wire set from Level 6
- 1 × Ultrasonic distance sensor HC-SR04
- 1 × DS18B20 temperature sensor (waterproof probe)
- 1 × Resistor kit including 1 k, 2 k and 4.7 k ohm
- 2 × Photoresistor (LDR)
- 2 × Ceramic capacitor 1 uF
- 1 × Sensor module kit with tilt, vibration and flame modules
In jeder Lektion legst du die passenden Teile direkt in den Warenkorb. Raspberry Pi →
Voraussetzung: Level 7: gpiozero inputs and events, plus Python file handling from Level 5.