Skip to content

Latest commit

 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Sensor Robot Project

Embedded System Badge MicroPython Badge MIT License Badge Wokwi Badge Project Status Badge


📖 Overview

This project is a sensor-driven robot built using an ESP32 and MicroPython.
It integrates distance sensing, stepper motor movement, tilt detection, and user feedback via a buzzer, LED, and OLED display.


🛠 Hardware Components

Component Pin Connections
LED D12 (Output)
Button D27 (Input, Pull-Up enabled)
Buzzer D15 (Output via Buzzer class)
Ultrasonic Sensor Trigger: D5, Echo: D18
Left Stepper STEP Pin: D13 (A4988 Driver)
Right Stepper STEP Pin: D19 (A4988 Driver)
OLED Display I2C (SCL: D22, SDA: D21)
Accelerometer I2C (SCL: D22, SDA: D21)

🧠 Project Behavior

Action Result
Startup Displays "Press button to start"
Button Press Buzzer beeps once, starts distance measurement
Measures Distance OLED displays distance and calculated steps
Drives Motors Moves robot corresponding to the measured distance
Tilt Detected While Driving Stops immediately, lights LED, beeps 3 times, displays "TILTED"
Successfully Reached Destination Buzzer beeps once, displays "REACHED"

🧩 Software Organization

File Purpose
main.py Main control logic for the robot
buzzer.py Handles buzzer beeping functions
ultrasonic.py Reads distance from ultrasonic sensor
stepper.py Controls stepper motor movement
oled.py Manages text display on the OLED screen
mpu6050.py Reads accelerometer values (AcY axis)

📦 Getting Started

How to run this project:

  1. Go to Wokwi Simulator.
  2. Create a new ESP32 project.
  3. Upload all source files (main.py, buzzer.py, ultrasonic.py, stepper.py, oled.py, mpu6050.py) into the Wokwi project.
  4. Set up the virtual components according to the Hardware Components table above.
  5. Click Start Simulation — and you're good to go!

Note:
Make sure the filenames match exactly! Wokwi depends on proper file naming for imports to work correctly.


🎥 Demo

📸 Image Preview

Sensor Robot Preview

🎮 Wokwi Simulation

🔗 Click here to view the live simulation


🔗 Useful Links


📈 Technical Details

  • Microcontroller: ESP32 Dev Module
  • Programming Language: MicroPython
  • Distance Calculation: Based on ultrasonic pulse timing
  • Step Calibration: 10 steps ≈ 1 cm
  • Tilt Detection Threshold: Accelerometer AcY axis > 12000 or < -12000
  • Buzzer Notifications:
    • 1 short beep on start
    • 3 short beeps on tilt detection
    • 1 short beep on successful movement

👨‍💻 Author

Field Details
Name Sief Ali Sayed Said
GitHub github.com/red-x-0
Email 463688431@cairo5.moe.edu.eg

📜 License

MIT License


Centemeter to Steps

You can find the additional criteria for converting Centemeter to Steps in cmToSteps.txt file

About

Simple Sensor Robot project

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages