MPU6050 Accelerometer and Gyro with Arduino: Tilt Angle
Wire an MPU6050 (GY-521) to Arduino over I2C, read raw accelerometer and gyro data, calculate tilt angle with atan2 and smooth it with a complementar…
Wire an MPU6050 (GY-521) to Arduino over I2C, read raw accelerometer and gyro data, calculate tilt angle with atan2 and smooth it with a complementar…
Measure a 12 V or 7.4 V battery with Arduino A0 using a voltage divider. Formula, wiring table, calibration, low-battery alarm code and fixes.
Learn to use a 5V relay module with Arduino to switch a 12V DC lamp or fan. Pinout, COM/NO/NC, active-LOW logic, code and safety rules.
Build a learning gas and smoke alarm with the MQ-2 sensor, Arduino Uno and buzzer. Wiring, warm-up, calibration, code and safety notes.
Build a motion alarm with an HC-SR501 PIR sensor, Arduino Uno, LED and buzzer. Pin table, commented code, sensor tuning and troubleshooting.
Build an Arduino distance meter with the HC-SR04 ultrasonic sensor and a 16x2 I2C LCD. Wiring table, full code, calibration and fixes.
Upload your first Arduino Uno program. Install Arduino IDE, fix COM port and CH340 driver issues, and blink the built-in and an external LED.