Problem
If you go to the toy market you will not find something related to us or our culture , how will the younger generation learn about us and be proud if they play with a toy that not related to us
Inspiration
I want to make a toy that reflects our culture because we have a rich history, so I choose tahteeb. Tahteeb (stick fighting) is an ancient Egyptian martial art that involves using long wooden sticks for combat or performance. It is both a traditional sport and a cultural dance practiced in Egypt, often during festivals and celebrations.
sketching the idea
Before drawing any sketch or starting a new component on Fusion, I started to create some sketches manually; to allow me to think of the next step in a clear way.
The used software
I used Fusion 360 in creating my Construction.
and grabcad for the free CAD designs for many electronic components.
Overview
Base
I created the sketch and projected all the nuts for the sides
Front
i try to make pattern
and make hole for the in-off switch
Side (right)
i made it and cpoy it (4)copies
Side2&3 (right)
i try to make hole for the manual mechanism then copy it
Back
make space for lcd
Top
take copy from the base and insert the bottom and make project
make two holes for the movement mechanism
Figure
i make a profile then revolve the head
make a sketch for the arm
Extrude it then make fillet
for the body after make the extrude i made a chamfer
After Extrude each part 3mm we will combine them by joints
make sure to bring the part you want to move first
Tahteeb 3d modeling
Components Mounting
To mount the servo hole i put in the place i want to cut it from
sketch taking the dimensions by Project tool from STEP servo file
then make offset to make clearness
To mount the joystick hole i put in the place i want to cut it from
sketch taking the dimensions by Project tool from STEP button file
make sure it fits
make sure the gear mechanism in its place and project the holes
Cura
Fusion 360
Laser work
Prusa
PLA
Laser-Cut Machine (El Malky laser cutter )
Plywood 3mm
First Laser
1-Export as dxf file in the sketch or use the plugin
2-open it on RD works v8
3- import the file
4- Ensure cut lines and engraving lines are properly set
- Parameters:
Black for cutting: power = 45, speed = 40
blue for speed cut: power = 25, speed = 250
3D printing
1- save the body as mesh
2- import it into cura
3-support
4-Rotate to find the best way to print
4-profile 0.2 - infill 20
5- After setting the parameters it took only 1hr and 10 grams then exported the file into g.code.
Resistores
5V Stepper Motor 28BYJ-48
With Drive Test Module Board ULN2003 5 Line 4 Phase
joystick
push button
power source 5 v
on-off switch
LED
Buzzer
Jumper wires
Wiring Details
Stepper Motor
IN1 → Arduino Pin 11
IN2 → Arduino Pin 10
IN3 → Arduino Pin 9
IN4 → Arduino Pin 8
Servo Motors
Servo 1 → Arduino Pin 3
Servo 2 → Arduino Pin 5
Buttons
Swing Button 1 → Arduino Pin 2
Swing Button 2 → Arduino Pin 4
Player 1 Increment Button → Arduino Pin 6
Player 2 Increment Button → Arduino Pin 7
Joystick
Joystick Analog Output → Arduino Pin A0
LCD (I2C)
SDA → Arduino SDA (A4 on Uno)
SCL → Arduino SCL (A5 on Uno)
I2C Address → 0x27
LEDs
Player 1 LED → Arduino Pin 12
Player 2 LED → Arduino Pin 13
Status LED → Arduino Pin A3
Buzzer
Buzzer → Arduino Pin A1
On-Off Switch
On-Off Switch → Arduino Pin A2
Inputs
Joystick (Analog Input)
Connected to A0.
Used to control the direction and speed of the stepper motor.
Buttons (Digital Inputs)
Swing Button 1 (Pin 2): Controls the movement of Servo 1.
Swing Button 2 (Pin 4): Controls the movement of Servo 2.
Player 1 Increment Button (Pin 6): Increments Player 1's score.
Player 2 Increment Button (Pin 7): Increments Player 2's score.
On-Off Switch (Pin A2): Turns the system on or off.
Outputs
Stepper Motor
Controlled by pins 8, 9, 10, 11.
Moves based on the joystick input.
Servo Motors
Servo 1 (Pin 3): Moves between 10° and 175° based on Swing Button 1.
Servo 2 (Pin 5): Moves between 10° and 175° based on Swing Button 2.
LCD Display (I2C)
Displays the opening message, scores, and winner message.
LEDs
Player 1 LED (Pin 12): Lights up when Player 1 scores.
Player 2 LED (Pin 13): Lights up when Player 2 scores.
Status LED (Pin A3): Indicates system status (on/off).
Buzzer
Connected to A1.
Plays sounds for start, win, and score increment events.
The Power Source I needed was a 5-volt power supply to power up the Arduino board and the components connected with it.
A 5V power source is used in this code because it is the standard operating voltage for most of the components, including the Arduino, servos, LCD, LEDs, and buzzer. Using 5V ensures compatibility, prevents damage to components, and simplifies the circuit design
Power Requirements for Components
Arduino Uno
5V (logic level)
Operates at 5V logic level
Stepper Motor
5V (control signals)
Control signals (IN1, IN2, IN3, IN4) are 5V. Motor power may be higher.
Servo Motors
5V (control signals)
PWM control signals are 5V. Motor power may vary (e.g., 4.8V–6V).
I2C LCD
5V
Requires 5V for power and logic levels.
LEDs
5V
Typically operate at 5V with current-limiting resistors.
Buzzer
5V
Typically operates at 5V.
Joystick
5V
Requires 5V for power and analog output.
Buttons
5V
Use 5V logic levels.
I chose to split the circuit into two circuits, which I would eventually merge.
Circuit 1
Circuit 1
Servo Motor Control:
If swing1 button is pressed (digitalRead(swing1) == HIGH), the servo motor Myservo1 moves to 175 degrees.
If swing1 button is not pressed, the servo motor Myservo1 moves to 10 degrees.
Similarly, Myservo2 is controlled by the swing2 button.
Joystick Control for Stepper Motor:
The analog value from the joystick (analogRead(joystick)) is read and stored in val.
If val >= 600, the stepper motor moves one step in the forward direction (stepper.step(STEPS)).
If val <= 450, the stepper motor moves one step in the reverse direction (stepper.step(-STEPS)).
If val is between 450 and 600, the stepper motor stops by setting all control pins (IN1, IN2, IN3, IN4) to LOW.
<Stepper.h>:
Used to control the stepper motor.
Provides functions to set the speed and move the motor in steps.
<Servo.h>:
Used to control the servo motors.
Provides functions to set the angle of the servo motors.
Circuit 2
checkout this video it helps me a lot
circuit 2 allows two players to increment their scores using buttons, and when a player reaches a score of 10, they are declared the winner.
Circuit 2
LCD Initialization:
lcd.init() initializes the LCD.
lcd.backlight() turns on the LCD backlight.
Serial Communication:
Serial.begin(9600) initializes serial communication for debugging.
Button Pin Modes:
Pins 6 and 7 are set as inputs with internal pull-up resistors.
LED and Buzzer Pin Modes:
Pins 12, 13, and A1 are set as outputs.
Opening Message:
displayOpeningMessage() displays a welcome message on the LCD.
playStartSound() plays a start sound on the buzzer.
The message is displayed for 3 seconds, after which the LCD is cleared.
<Wire.h>:
Used for I2C communication between the Arduino and the LCD.
<LiquidCrystal_I2C.h>:
Used to control the I2C LCD display.
Final Code
Attach Servos:
Myservo1.attach(servo1): Attaches Servo 1 to Pin 3.
Myservo2.attach(servo2): Attaches Servo 2 to Pin 5.
Set Button Pins as Inputs:
pinMode(swing1, INPUT_PULLUP): Sets Swing Button 1 as input with internal pull-up resistor.
pinMode(swing2, INPUT_PULLUP): Sets Swing Button 2 as input with internal pull-up resistor.
Initialize Stepper Motor:
stepper.setSpeed(rpm): Sets the stepper motor speed to 120 RPM.
Initialize LCD:
lcd.init(): Initializes the LCD.
lcd.backlight(): Turns on the LCD backlight.
Set Pin Modes for LEDs and Buzzer:
pinMode(ledPlayer1, OUTPUT): Sets Player 1 LED as output.
pinMode(ledPlayer2, OUTPUT): Sets Player 2 LED as output.
pinMode(buzzerPin, OUTPUT): Sets buzzer pin as output.
Set Pin Mode for Power Switch:
pinMode(powerSwitchPin, INPUT_PULLUP): Sets the power switch pin as input with internal pull-up resistor.
Set Pin Mode for Status LED:
pinMode(statusLedPin, OUTPUT): Sets the status LED pin as output.
Power Switch Check:
If the power switch is off (LOW), turn off all components (stepper motor, servos, LCD backlight, LEDs, buzzer).
If the power switch is on (HIGH), reattach servos, turn on the LCD backlight, and display the opening message if not already displayed.
Servo Control:
If Swing Button 1 is pressed (LOW), move Servo 1 to 175°; otherwise, move it to 10°.
If Swing Button 2 is pressed (LOW), move Servo 2 to 175°; otherwise, move it to 10°.
Joystick Control:
Read the joystick value from A0.
If the joystick is in the middle (450–550), stop the stepper motor.
If the joystick is moved to one side (>550), move the stepper motor clockwise.
If the joystick is moved to the other side (<450), move the stepper motor counterclockwise.
Score Tracking:
If Player 1 Increment Button (Pin 6) is pressed, increment Player 1's score, light up the Player 1 LED, and play a beep sound.
If Player 2 Increment Button (Pin 7) is pressed, increment Player 2's score, light up the Player 2 LED, and play a beep sound.
If either player reaches a score of 10, set gameOver to true, display the winner message, and play the win sound.
Display Scores on LCD:
Display the scores of Player 1 and Player 2 on the LCD in the format XX YY.
Game Over:
If gameOver is true, reset the game after a 3-second delay.
Test the functionality of the circuit before assembling
Buttons Assemble
first test if the buttons fits and assemble them
3d printing finishing
Finishing a 3D print after removing supports is key to a polished look. i start by carefully removing supports with pliers or a knife. Sand the model with coarse-grit sandpaper, then i try smoothing techniques like heat These steps turn my 3D print into a clean, professional piece!
Assemble the servo with arm
Base Assemble
steeper motor mechanism
I got in trouble with stepper motor coding; it was not working at all, and the code was complicated, so Ahmed helped me a lot with this.
The servo didn't fit the arm, and I got lost with trying to solve this. Abdelrahman helped me to solve this.
I had a problem that the wiring is too much and the wiring is complicated in some areas and tangled, and I can't assemble the upper, so Fairda, Mayar, and my sister help me to sort out the wiring.
Fabrication
the servo didn't fit the arm ,so we use driller to make a hole in the arm and integrate the servo with screw
The support is too much and made my figure ugly. I solved this with sand and heating
The joints don't fit.
the joy stick didn't fit
Assembly
I had a problem that the wiring is too much and the wiring is complicated in some areas and tangled, and I can't assemble the upper, so Fairda, Mayar, and my sister help me to sort out the wiring.
I assembled the LCD in the wrong way, so I have to repeat the process.
The x slot is too thin, so it breaks when I assemble it.
When I assemble, I figure out that the rail is too long, and if they try to hit the head, it is impossible, so I solve this by making two rails for each player.
Coding
I use while to code the steeper and joystick. Because of that, the code stuck with it, so we changed it to if condition.
When we code the stepper, we have to make sure the inputs start with even the odd; in the final code, I miss this, so we think the stepper doesn't work and change it, but it is because of that!
I want to speed up the stepper motor, but it doesn't work. First, I try steps per revolution, but the speed is too slow. I try the accel, but it's the same. Finally, I get that if I reduce the speed and make the steps per revolution max, it will speed up, but when I integrate this with my code, it doesn't work, so I go back to steps per revolution = 200, and the rpm = 120.
When I was coding the counter score, I had two problems. I want the score to repeat when the game is ended, so I use the true/false method.
The functions were too much, and the code was too long and stuck with each other, so I used the void function method and put the buzzer and counting in the void function
In the next time, I will integrate the pins, and what should I use for this amount?
I want to make a trigger point by sensor, but the pins are full.
If I have more time, I will add details to the figure to make it more traditional, make patterns inspired by our culture, and make a small message to make the children learn about the game.