Skip to main content

Posts

Showing posts from August, 2025

Controlling Servo Motor With MPU6050 Gyro Sensor Using ESP32 Beginners Projects

  Controlling Servo With MPU6050 Gyro Sensor Using ESP32 - Servo Control Using ESP32 MPU6050 measures accelerometer + gyroscope. Code calculates pitch from accelerometer (X tilt). The pitch (range -90° to +90°) is mapped to servo angles (0°–180°). The servo on GPIO 13 moves according to tilt. 📌 Wiring:- MPU6050 → ESP32 VCC → 3.3V GND → GND SDA → GPIO 21 (default I²C SDA on ESP32) SCL → GPIO 22 (default I²C SCL on ESP32) Servo → ESP32 Signal (orange/yellow) → GPIO 13 VCC (red) → 5V (use external supply if possible, not directly from ESP32) GND (black/brown) → GND (common ground with ESP32 & MPU6050) ⚠️ Important: Servos draw a lot of current → use an external 5V supply for the servo, not just the ESP32’s 5V pin. Full Code:-  #include <Wire.h> #include <Adafruit_MPU6050.h> #include <Adafruit_Sensor.h> #include <ESP32Servo.h> Adafruit_MPU6050 mpu; Servo myServo; int servoPin = 13;  // PWM pin for servo void setup() {   Serial.begin(1152...

DIY ORTOMI ROBOT FACE USING ESP32 CONNECTION DIAGRAM

  0.96” I2C   28x64 SSD1306 OLED Display Wiring :- VCC – 3.3V GND – GND SCL(OLED) – GPIO 22 ( ESP32 ) SDA(OLED) – GPIO 21 ( ESP32 )   TTP223 Touch Sensor Wiring :- VCC – 3.3V {Add 10R resistor with this pin} (ESP32) GND – GND (ESP32) I / O   – GPIO 14 (ESP32)   Speaker OR Buzzer :-   + POSITIVE –   GPIO 25 (ESP32) - NEGETIVE - GND (ESP32)   Required Libraries to Install:- Adafruit_GFX Adafruit_SSD1306 Wire     Note:- Download Emotions.h and SoundFX.h file for link below and paste in same folder where code.uno file save.     Full Code:- RobotFace.ino #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> //#include "Emotions.h" #include "Emotions_CLEAN.h" #include "SoundFX.h"   #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_RESET     -1 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_H...