- Python 100%
| 20260619_153235.jpg | ||
| boot.py | ||
| DEMO.mp4 | ||
| GRIPPER-12jun.20260618-171350.FCBak | ||
| README.md | ||
| RobotArmParts.FCBak | ||
SG90 Robotic Arm
A simple robotic arm powered by an ESP32 and SG90 servos. The arm is controlled over Bluetooth Low Energy (BLE) using hex or letters.
Demo video:
Hardware Required
- ESP32
- 5× SG90 servos
- 3D printed arm parts
- Hot glue
- power supply / usb cable
Important: If you encounter a
Brownout detector was triggerederror, your servos are drawing more current than the ESP32 can supply. You can connect a second power supply but that can cause bugs if not propperly grounded. You could also try connecting capacitors across the power rails.
3D Printing & assembly
Export the FreeCAD models and slice them for your printer.
Note Print Arm segment and Gripper attachments 2 times.
After printing:
- Insert the SG90 servos into the servo mounting holes and screw them in via the lips. Note on the gripper the servo is inserted from the top.
- Glue the horns in the horn cut-outs using hot glue.
- Screw the servo's to the horns. later during calibration remount them at the correct angle.
Wiring
Connect the servos to the ESP32:
| Servo | GPIO |
|---|---|
| Shoulder | 15 |
| Elbow | 16 |
| Base | 2 |
| Wrist | 5 |
| Gripper | 4 |
Or read in code:
shoulder_servo = Servo(pin=15, def_ang=90)
elbow_servo = Servo(pin=16, def_ang=90)
base_servo = Servo(pin=2, def_ang=90)
wrist_servo = Servo(pin=5, def_ang=90)
grip_servo = Servo(pin=4, def_ang=90)
Flashing the Firmware
Upload the Python firmware to the ESP32.
When the code is run, the serial monitor should display:
Activating BLE...
BLE ready.
Ready.
Connecting
Install any Bluetooth Serial / BLE UART app on your phone.
I use Serial Bluetooth Terminal (Android). But any will work.
Connect to the ESP32 device.
You can send letters or hex to the esp.
Controls
Arm Movement
| Key | Hex | Action |
|---|---|---|
| h | FF | Home position |
| a | 01 | Move left |
| d | 02 | Move right |
| w | 03 | Move up |
| s | 04 | Move down |
Base Rotation
| Key | Hex | Action |
|---|---|---|
| q | 05 | Rotate base left |
| e | 06 | Rotate base right |
Wrist
| Key | Hex | Action |
|---|---|---|
| u | 07 | Wrist up |
| j | 08 | Wrist down |
Gripper
| Key | Hex | Action |
|---|---|---|
| c | 10 | Close |
| m | 20 | Half open |
| o | 30 | Open |
Gripper Calibration
| Key | Hex | Action |
|---|---|---|
| z | 40 | Decrease angle |
| x | 41 | Increase angle |
| p | 42 | Print current angle |
Servo Calibration
| Key | Hex | Action |
|---|---|---|
| k | FE | Run servo calibration routine |
The calibration guides you through alignment of the servo's to make shure mounting is correct.
Pre-programmed Actions
| Key | Hex | Action |
|---|---|---|
| 1 | AA | Wave |
| 2 | BB | Nod |
| 3 | CC | Circle |
| 4 | DD | Pick and place |
Issues
The sg90 servo's are not powerfull enough to cary this much load. especialy the shoulder servo can get pretty hot after longer usage.
Another problem is that the gripper arm design is pretty bad but the fix is to just make the first part of the arm longer so when closed the grippy parts are more paralel. I just did not yet take the time to fix this.