Overview
PhysisLab uses various sensors for physics measurements including IR sensors for free fall detection, ultrasonic sensors for distance measurement, and laser-based ToF sensors for high-precision ranging.IR Sensors (Free Fall Detection)
Overview
Infrared (IR) break-beam sensors are used in the free fall experiment to detect when an object passes through specific points, enabling precise time-of-flight measurements.Specifications
- Type: Reflective or break-beam IR sensor
- Operating Voltage: 3.3V - 5V
- Output: Digital (HIGH when blocked, LOW when clear)
- Response Time: < 1 ms
- Detection Range: 2-30 cm (depending on model)
Wiring Configuration
FromfreeFall3Sensores.ino:3-5:
Setup Code (Arduino)
FromfreeFall3Sensores.ino:78-103:
Interrupt Handling
FromfreeFall3Sensores.ino:30-48:
Typical Values
- Separation Distance (S1): 0.68 m (start to intermediate)
- Separation Distance (S2): 1.75 m (start to final)
- Time Resolution: 1 ms (using Timer1)
- Expected Fall Time: ~370 ms for 0.68 m drop
VL53L0X Laser Distance Sensor
Overview
The VL53L0X is a Time-of-Flight (ToF) laser-ranging sensor that provides accurate distance measurements from 30mm to 2000mm.Specifications
- Range: 30 mm - 2000 mm
- Accuracy: ±3% typical
- Field of View: 25°
- Measurement Rate: Up to 50 Hz
- Interface: I2C (400 kHz)
- Operating Voltage: 2.6V - 3.5V
- I2C Address: 0x29 (default)
Pin Connections
FromVL53_filtros.ino:100:
Initialization Code
FromVL53_filtros.ino:98-116:
Reading Distance
FromVL53_filtros.ino:126-141:
Signal Filtering
The VL53L0X readings are filtered using three different methods:1. Exponential Moving Average (EMA)
FromVL53_filtros.ino:33-36, 146-151:
2. Butterworth Low-Pass Filter (2nd Order)
FromVL53_filtros.ino:40-50, 78-95:
3. Alpha-Beta (α-β) Filter
FromVL53_filtros.ino:53-59, 161-170:
HC-SR04 Ultrasonic Sensor
Overview
The HC-SR04 is an ultrasonic distance sensor that uses sonar to determine distance to an object (2cm to 400cm).Specifications
- Range: 2 cm - 400 cm
- Accuracy: ±3 mm
- Measuring Angle: 15°
- Ultrasonic Frequency: 40 kHz
- Operating Voltage: 5V
- Trigger Pulse: 10 μs (minimum)
Pin Connections
Pin Definitions
FromultraSonido_filtros.ino:4-7:
Initialization
FromultraSonido_filtros.ino:109-121:
Measurement Process
Trigger Signal
FromultraSonido_filtros.ino:81-85:
Echo Detection
FromultraSonido_filtros.ino:69-76:
Distance Calculation
FromultraSonido_filtros.ino:24, 143:
Signal Filtering
The ultrasonic sensor uses the same three filtering methods as the VL53L0X:- EMA (α = 0.3)
- Butterworth (fs=10Hz, fc≈1Hz)
- α-β Filter (α = 0.85, β = 0.05)
ultraSonido_filtros.ino:40-64:
Sample Output
FromultraSonido_filtros.ino:186-197:
Sensor Calibration
VL53L0X Calibration
- High Accuracy Mode: Use
VL53L0X_SENSE_HIGH_ACCURACYfor best precision - Sampling Rate: 5 Hz (200 ms intervals) for stable readings
- Filter Tuning: Adjust α values based on motion speed
Ultrasonic Sensor Calibration
- Minimum Range: Keep objects at least 5 cm away
- Sampling Rate: 10 Hz (100 ms intervals) recommended
- Temperature Compensation: Sound speed varies with temperature (~0.6 m/s per °C)
IR Sensor Calibration
- Alignment: Ensure sensors are perpendicular to falling object path
- Height Measurement: Measure actual distance between sensors precisely
- Threshold Adjustment: Tune detection sensitivity to avoid false triggers
Troubleshooting
VL53L0X Issues
Problem: Sensor not detected (begin() fails)- Check I2C wiring (SDA/SCL)
- Verify 3.3V power supply
- Try different I2C speed:
Wire.setClock(100000)for 100 kHz
- Increase sampling interval (reduce rate)
- Use Butterworth filter for smoothing
- Avoid reflective or transparent surfaces
HC-SR04 Issues
Problem: Reading 0 or timeout- Check TRIG pulse is at least 10 μs
- Verify ECHO pin voltage level (should be 3.3V after level shifter)
- Ensure object is within 2-400 cm range
- Add validation: ignore readings < 2 cm or > 400 cm
- Use median filter for outlier rejection
- Check for acoustic interference
IR Sensor Issues
Problem: Missed detections- Increase pull-up resistor to 10kΩ
- Add debouncing (10-50 ms delay)
- Check alignment and focus
- Shield from ambient IR sources (sunlight, incandescent bulbs)
- Add hysteresis to detection logic
- Use interrupt-driven detection
Best Practices
- Power Supply: Use stable, low-noise 3.3V/5V supply
- Filtering: Always filter sensor data for physics measurements
- Sampling Rate: Match to expected motion speed (faster motion = higher rate)
- Validation: Implement range checks to reject invalid readings
- Calibration: Measure and verify physical distances with ruler/caliper