ECE NTUA | 8th Semester | Sensors Course
This repository contains Arduino code for various sensor experiments and projects completed during the Sensors course at the School of Electrical and Computer Engineering (ECE) of the National Technical University of Athens (NTUA).
The laboratory exercises explore different types of sensors, their characteristics, calibration methods, and practical applications in embedded systems.
Directory: distance_sensor/
- Sensor Type: HC-SR04 Ultrasonic Sensor + DHT11 Temperature/Humidity Sensor
- Features:
- Temperature-compensated distance measurement
- Sound speed calculation based on environmental conditions
- Buzzer alert for objects closer than 20cm
- Range: 2-400 cm
- Key Components:
- Ultrasonic sensor (HC-SR04)
- DHT11 temperature/humidity sensor
- Buzzer for proximity alerts
Directory: hall_sensor/
- Sensor Type: Hall Effect Magnetic Field Sensor
- Features:
- Magnetic field strength measurement in mT (milliTesla)
- LED brightness control based on field intensity
- Real-time magnetic field visualization
- Offset calibration
- Applications:
- Magnetic field detection
- Position sensing
- Current measurement (indirect)
Directory: light_sensor/
- Sensor Type: Light Dependent Resistor (LDR)
- Features:
- Dual operation modes (Analog/Digital)
- Serial command interface ('A' for analog, 'D' for digital)
- Frequency-based audio feedback
- Threshold-based digital output
- Applications:
- Ambient light monitoring
- Automatic lighting control
- Day/night detection
Directory: temp_sensor/
- Sensor Type: LM35 Temperature Sensor
- Features:
- Temperature measurement in Celsius
- Multi-level LED indicator system:
- 🟢 Green: ≤ 25°C
- 🟠 Green + Orange: 25-35°C
- 🔴 All LEDs: > 35°C
- Applications:
- Environmental monitoring
- Temperature control systems
- HVAC applications
Directory: flux_gate_project/
- Sensor Type: Flux Gate Magnetometer
- Features:
- Peak-to-peak voltage measurement
- High-frequency sampling (~100 kHz)
- Statistical signal analysis
- Precise magnetic field detection
- Applications:
- Geomagnetic field measurement
- Navigation systems
- Scientific research
- Arduino Uno/Nano
- Breadboard and jumper wires
- USB cable for programming
| Experiment | Required Components |
|---|---|
| Distance Sensor | HC-SR04, DHT11, Buzzer, Resistors |
| Hall Sensor | Hall effect sensor, LED, Resistors |
| Light Sensor | LDR, Speaker/Buzzer, Resistors |
| Temperature Sensor | LM35, 3x LEDs (Green, Orange, Red), Resistors |
| Flux Gate | Flux gate sensor, Signal conditioning circuit |
- Arduino IDE (v1.8.0 or later)
- Libraries:
dht.h(for DHT11 sensor)- Standard Arduino libraries
-
Clone the repository:
git clone https://github.com/AntonisAk/Sensors_Arduino_Labs.git cd Sensors_Arduino_Labs -
Install required libraries:
- Download and install the DHT library for the distance sensor project
- Extract
DHTLib.zipin the distance_sensor folder
-
Upload to Arduino:
- Open the desired
.inofile in Arduino IDE - Select your board and port
- Upload the code
- Open the desired
-
Connect hardware:
- Follow the pin configurations defined in each sketch
- Refer to comments in the code for wiring details
- Trigger Pin: 9
- Echo Pin: 10
- DHT11: Pin 2
- Buzzer: Pin 4
- Analog Input: A0
- LED Output: Pin 3
- LDR Input: A0
- Speaker Output: Pin 11
- LM35 Input: A0
- Green LED: Pin 2
- Orange LED: Pin 3
- Red LED: Pin 4
- Analog Input: A0
- Understanding different sensor technologies and their principles
- Sensor calibration and signal conditioning techniques
- Real-time data acquisition and processing
- Environmental compensation methods
- Digital signal processing basics
- Embedded system design principles
- Institution: National Technical University of Athens (NTUA)
- School: Electrical and Computer Engineering (ECE)
- Semester: 8th
- Course: Sensors and Measurement Systems