Introduction to Mechatronics
Learning the basic of mechatronics.
Projects in arduino, ESP32
Using Tinkercad, Thingspeak, kicad , Dabble
Supplies
Arduino Uno
Ultrasonic sensor
ESP32
MG996R Metal Gear Servo
Jumper cables
L298N Motor Driver/L293D
Chassis of robotic car
3 Batter y pack ( 12V/9V )
7805ic
Project Title:
- Final Project - Binny: Smart Robot Dustbin
Why This Project:
- Cafeterias and public dining areas often have trash left on tables or floors due to people not wanting to walk to trash bins.
- This causes hygiene issues and ruins the dining experience.
- The project gamifies waste disposal by making the dustbin interactive and mobile, allowing users to summon and control it via their smartphones.
- Goal: Encourage better waste management habits through a fun, user-friendly approach.
Observations:
- Trash is often left on tables and the floor, even with dustbins available, highlighting the need for a smarter waste solution.
Key Features:
- Automatic Lid Operation:
- Lid opens/closes automatically using a servo motor.
- Ultrasonic sensor detects nearby trash to trigger lid opening for hands-free use.
- Mobile App Control:
- Dustbin mounted on wheels powered by DC motors.
- Movement (forward, backward, left, right) is controlled via a Bluetooth-connected app.
Additional Features (Planned):
- Battery life monitoring
- Weight measurement of trash
- Cleaning mechanism
- Seamless connection to one device at a time
Part 1: Opening & Closing of Dustbin Lid
- Tested sensors and servo using Arduino Uno.
- Initial servo was too weak to lift the lid; upgraded to a MG996R Metal Gear Servo
Final Connection Plan for the Lid:
- Verified that the servo and ultrasonic sensor connections worked.
- Attached a 5.28 cm ABS plastic lever to the servo motor to lift the lid.
- Made holes in the lid to mount the ultrasonic sensor.
- Sensor fixed securely on the lid.
Testing & Refinement:
- Initial Issue: Code was reversed—bin stayed open by default and closed when detecting objects.
- Solution: Fixed the logic, added extra seconds for the lid to remain open, and increased sensor detection range.
Final Working of Part 1:
- Successfully demonstrated the automatic lid opening and closing system using an ultrasonic sensor and servo motor.
- The trash bin now opens hands-free when an object is detected.
Part 2: Moving the Dustbin and App Control
- Designed a custom ABS plastic chassis (2 mm thick) using a DXF file and laser cutting to hold the dustbin.
- Integrated components:
- ESP32 (for wireless control and app integration)
- L298N / L293D Motor Driver
- 3 Battery Packs (12V/9V)
- 7805 Voltage Regulator IC
- Assembled the robotic car chassis with wheels and motors to enable dustbin mobility.
Using L293D Motor Driver:
- Attempted to use L293D driver for motors.
- Motors ran only briefly before stopping.
- Likely causes:
- Limited to 600 mA continuous current per channel (not enough for load).
- Voltage drop across transistors.
- Inefficient for heavier/high-current motors, leading to stalling.
- Decision: Switch to L298N for better performance.
Using L298N Motor Driver:
- Tried several fixes:
- Connected ESP32 ground to motor driver ground.
- Added 7805 voltage regulator IC, but it overheated.
- Reduced battery voltage to ~8V, but 7805 still overheated.
- Powered ESP32 directly from laptop USB to isolate issues.
- Found motor driver pin placement affected motor operation.
- Why L298N was better:
- Handles up to 2A per channel, stronger than L293D.
- Uses Darlington transistor arrays for better robustness.
- Separate motor (12V) and logic (5V) power pins improve stability.
- Widely documented for ESP32-based robotics.
Code for Running Motors with ESP32 (Bluetooth Serial):
- ESP32 set up as a Bluetooth device named My_BT_Car.
- Accepts single-character commands via Bluetooth to control movement:
- F = Forward
- B = Backward
- L = Left pivot
- R = Right pivot
- S/others = Stop
- Controls two DC motors via L298N/L293D motor driver.
- Motor direction managed through digital pins; PWM channels handle speed control.
Code for Running Motors with ESP32 (Dabble App):
- Designed for external app-based control (joysticks, button states, speed values).
- Uses structured data instead of simple one-letter commands.
- Connections:
- Motor driver ENA = GPIO 22, IN1 = GPIO 16, IN2 = GPIO 17
- ENB = GPIO 23, IN3 = GPIO 18, IN4 = GPIO 19
- App-driven approach provides more flexibility and easier control over direction and speed.
App for Robot (MIT App Inventor):
- A simple mobile app built on MIT App Inventor for single-user control.
- Provides directional buttons (Forward, Backward, Left, Right).
- Connects to the dustbin via Bluetooth.
Website for Robot (Multi-User Access):
- Allows multiple users to connect to the dustbin via a web app.
- Key Features:
- Connect via Bluetooth, control page with directional buttons & 1-minute session timer.
- Automatic disconnection after the session, making it ready for the next user.
- Optional dark mode toggle.
- Demo mode for testing (not in final version).
- Emphasis on proper backend code integration for stability.
Real-Life Implementation Phases:
- Prototype:
- Automatic dustbin lid, robot bin controlled via phone.
- Validated mechanical movement & basic control.
- Multi-User Interaction:
- QR code access for shared control.
- Single-user sessions, auto-disconnect after inactivity.
- Notifications for user actions and gamification messages.
- Practical Model:
- Rechargeable Li-ion battery with USB-C docking.
- Motors for carrying 3–5 kg trash.
- Easy inner bin removal for staff cleaning.