An automated robotic arm for industrial use that performs quality checks and sorting via machine vision. Includes manual hand-tracking mode. Won 1st place in Egypt at the International Codeavour Competition.
This repository contains code for Arduino and Python projects that control a robotic arm, perform color detection and object sorting, and monitor environmental sensors. It also includes a Pictoblox .sb3 file required by the Codeavour 6.0 competition.
Note: The
.sb3files in this repository are Pictoblox project files, included as required by Codeavour 6.0.
- Python automation script using OpenCV, NumPy, PyFirmata, and threading.
- Connects to an Arduino board on
COM9and controls a stepper motor plus servo motors for a robotic arm. - Uses live camera capture to detect blue, red, and green objects using HSV color filtering.
- Stops the stepper motor when a blue or red object is centered in the frame, then executes a pick-and-place motion sequence.
- Moves the shoulder, elbow, base, and gripper servos to pick up and deposit detected objects.
- Includes a sleep countdown feature that can stop the program and release the board after a timeout.
- Python gesture control script using OpenCV, NumPy, PyFirmata, and the
cvzoneHandDetector. - Captures video from a second camera (
VideoCapture(1)) and tracks a single hand. - Uses finger state detection to control the robotic arm:
- Certain gestures close or open the gripper.
- X/Y coordinates of a hand landmark are mapped to servo positions for shoulder and elbow.
- A potentiometer connected to analog pin A0 is mapped to base rotation.
- Provides on-screen feedback with rectangles and text showing current servo angles.
- Runs until the user presses the
ckey.
- Arduino sketch for environmental monitoring and SMS/call alerts.
- Uses a DHT11 temperature and humidity sensor on pin
5. - Reads a gas sensor on pin
9and a flame sensor on pin10. - Uses a SIM800L GSM module on
SoftwareSerial(3, 2)to send SMS messages and make calls. - Activates a buzzer on pin
11when a gas leak or fire is detected. - Sends an initial check message during setup and sends alerts when hazardous conditions are found.
- Arduino sketch that extends the sensor system with ultrasonic object detection.
- Uses two ultrasonic sensors:
trigPin/echoPinon pins6/7.trigPin2/echoPin2on pins11/12.
- Reads DHT11 temperature and humidity values, plus gas and flame sensors.
- Tracks object counts and skipped objects based on distance thresholds.
- Sends SMS/call alerts via SIM800L for gas or fire events, and prints sensor and object data to Serial.
- Arduino prototype sketch for a robotic arm and ultrasonic distance sensing.
- Configures four servos on pins
9,10,11, and12. - Sets up an ultrasonic rangefinder on pins
4and5. - Defines a distance-reading helper function, but the
loop()function is currently unfinished.
- Pictoblox project file included for visual programming.
- This file is included to satisfy the Codeavour 6.0 competition requirement for
.sb3assets.
pyfirmataopencv-pythonnumpycvzone(for hand tracking invision arm hand.py)
DHT.hlibrary for DHT11 temperature/humidity sensor support.SoftwareSerial.hfor SIM800L communication.Servo.hfor servo control inSustainability/Sustainability.ino.
- The Python files assume the Arduino board is available on
COM9. - The camera indexes (
0forautoMultiColor.pyand1forvision arm hand.py) may need to be adjusted for your system. - Update the phone number in the SIM800L code sections before using the SMS/call features.
autoMultiColor.pyuses threaded camera and stepper control loops to run detection and mechanical motion concurrently.
/autoMultiColor.py— color-based robotic arm automation and stepper control./vision arm hand.py— gesture-based control of the arm using hand tracking./Sensors/Sensors.ino— DHT, gas, flame, buzzer, and SIM800L alert system./Sensors_Ultrasonic/Sensors_Ultrasonic.ino— sensor system with added ultrasonic object counting./Sustainability/Sustainability.ino— basic servo and ultrasonic distance reading prototype./Sensors.sb3— Pictoblox project file required by Codeavour 6.0.