Third Step
WEEK_3
WEEK_3
DAY_5
In this task , I designed a 3D model of a cup the cup body was modeled using the Loft function, which allowed me to create a smooth and curved surface by connecting two different profile circle .
the handle of the cup was created using the Sweep function, where I drew a circular profile and swept it along a custom path Then connect the two shapes together to form cup.
Thinking about dimensions.😵
The sketch shows the dimensions of each part of the cube.(50mm) the full width/height of each face, (3mm) tabs fingers and Opens (holes) are drawn to interlock.
When designing the fingers I added (10 mm+0.25mm) to ensure tight fit after laser cutting ,and For the opens I subtracted (10 mm - 0.25mm) to prevent looseness.
I started transferring the manual sketch to Fusion using the Center Rectangle and determining the dimensions precisely as in the manual sketch and Added fingers and opens manually, then used Circular Pattern to repeat them evenly along the edges.
After sketching, I used Extrude (3mm) on three unique face These faces represent all possible fingers and opens combinations needed.
Duplicated the 3 extruded faces to make a full 6-face cube.
Used the Joint tool to align and connect the pieces, This forms a full cube with interlocking finger joints on all edges.
Before printing, I had to export my sketches as DXF files which are compatible with the laser cutter.
_Used the Project tool (shortcut: P) to select the shapes we need from the 3D model into the sketch (this tool make new sketch for shapes selected).
_right-click the new sketch in the Sketches section and choose: "Save as DXF".
_import the file to software using File → Import.
_Duplicating the cube faces using “Matrix tool".
_Fixing overlapping lines This is important to avoid double cuts or burning the wood.
_I added my name to one of the faces of the cube.🫣
_The faces of the cube are chosen as "cut" while my name is chosen as "Scan"
_Download to Machine.
_Selecting the file From File Button.
_Make the machine frame the wood using the frame button.
_Starting the laser job .
Once all the pieces were cut, I assembled the 6 wooden faces together to form cube.🥳
DAY_7
In this task, I designed a cube box using finger joints, with a movable lid that opens and closes and used Fusion Joint feature with Motion type .
each cube face was created on a separate sketch , The back face was made slightly higher than the rest to act as a hinge support and opening limit for the lid.
The lid includes a tongue piece on both sides, with a square end that fits into a circular cut on the two side faces This allows the lid to rotate smoothly using the Revolute Joint in Fusion.
-> Problem :
while designing the lid’s pivot mechanism, the movable part was smaller than the circular hole in the fixed part, which caused the lid to be unstable and loose when rotating.
Design Measurements:
Square part width: 3 mm.
Circle hole diameter: 4.5 mm.
Result: The square part could wobble inside the hole due to extra space.
to fix the instability:
Increased the square section size from 3 mm to 4 mm for a tighter fit.
Kept the circle hole diameter at 4.5 mm to ensure smooth rotation.
DAY_5
I connected a Soil Moisture Sensor to an analog pin (A5) on the Arduino board .
Using analogRead() for monitored the sensor values via the Serial Monitor.
-> Lowest Value = 0.
-> Highest Value = 876.
I connected a potentiometer Sensor to an analog pin (A5) on the Arduino board .
Using analogRead() for monitored the sensor values via the Serial Monitor.
-> Lowest Value = 0.
-> Highest Value = 1023.
In this task, I used a potentiometer connected to an analog pin on the Arduino to control three LEDs depending on the value potentiometer sent.
*Connections:🔌
_The middle leg of the potentiometer was connected to analog pin A5 on the Arduino.
_The two side legs were connected to 5V and GND.
_The cathodes of the three LEDs were all connected to GND and The anodes of the LEDs were connected to digital pins (2 , 3 , 4) each through a resistor.
**How the Code Works 💻:
_First, I defined one variable for the potentiometer pin and three variables for the LEDs using int.
_In the void setup() function:
-> used Serial.begin(9600) to monitor the analog values from the potentiometer.
-> used pinMode() to set the LED pins as OUTPUT and the sensor pin as INPUT.
_In the void loop() function:
-> Reads the analog value from potentiometer using analogRead() and stores it in variable (Sensorvalue)
-> Displays the value on the Serial Monitor using Serial.println().
-> Use if and else if to divide the potentiometer range (0–1023) into 3 levels:
If value Between (0 : 341) → LED 3 lights up.
If value Between (341 :682) → LED 3 & LED 2 light up.
If value Between (682 :1023) → all three LEDs light up.
If none of the conditions are met → all LEDs turn off.
in this task, I used a potentiometer to control a 7-segment display connected to the Arduino. The displayed number changes depending on the value potentiometer sent.
*Connections:🔌
_The middle leg of the potentiometer was connected to analog pin A5 on the Arduino.
_The two side legs were connected to 5V and GND.
_the 7-segment display has 8 pins for segments (a, b, c, d, e, f, g, dp) each connected to digital pins 2 to 9 on the Arduino.
**How the Code Works 💻:
_First, the code reads the analog value from the potentiometer using analogRead() and stores it in the variable sensorvalue.
_The code divides range (0 : 1023) into 7 positions, and based on the value, it displays a number on the 7-segment display.
-> If the value = 0 → Display 0 .
-> If the value is between 1 and 170 → Display 1 .
-> If the value is between 171 and 340 → Display 2 .
-> If the value is between 341 and 510 → Display 3.
-> If the value is between 511 and 680 → Display 4.
-> If the value is between 681 and 850 → Display 5.
-> If the value is between 851 and 1023 → Display 6.
Each number is shown by turning ON or OFF specific segments using digitalWrite().
In this task, I used a TMP36 temperature sensor and an RGB LED to visualize the temperature levels.
*Connections:🔌
_The middle leg (Vout) of the TMP36 was connected to analog pin A5 on the Arduino.
_The two side legs (power & GND) were connected to 5V and GND.
_each anode of the RGB LED is connected to different digital pin on the Arduino.
_cathode is connected TO GND on the Arduino.
**How the Code Works 💻:
_First, the code reads the analog value from the TMP36 using analogRead() and stores it in the variable tempvalue.
_converted the analog value to voltage using the formula:
(voltage = tempvalue * 5 / 1024)
_calculated the temperature in Celsius using:
(tempcelsius = (voltage - 0.5) * 100)
_Use if and else if to divide the TMP36 range (-40:125) into 3 levels:
If temperature is less than 15°C → turn on Blue LED
If temperature Between (15°C : 70°C) → turn on Green LED.
If temperature Between(70°C : 125°C) → turn on Red LED.
This videos was helpful for me in this task Link1,Link2.
*Connections:🔌
used an H-Bridge motor driver to control a DC motor with Arduino.
_Input1 on the H-Bridge → (pin 2)
_Input2 on the H-Bridge → (pin 3)
_ Enable pin on the H-Bridge → (pin 5)
_The motor is connected between output1 and output2 on the H-Bridge
_The H-Bridge is powered by an external power source (Buttery) and 5V (Arduino)
_Arduino GND is connected to the H-Bridge GND
**How the Code Works 💻:
control direction by changing which pin is HIGH/LOW.
_The motor runs REVERSE for 1 second.
_Then it is turned OFF for 1 second.
_Then it runs FORWARD for 1 second.
_OFF again for 1 second.
***Note:
"The enable pin (motor1enablepin) is the main switch that allows current to flow to the motor If it is LOW, the motor stays OFF, even if the direction pins are set to HIGH so To make the motor run, the enable pin must be set to HIGH "
**How the Code Works 💻:
in Arduino, some digital pins (like 3) support PWM, and use analogWrite() on them to output variable voltage levels , This is how we can control motor speed using a digital PWM pin as if it's an analog output.
-> Lowest Value = 0.
-> Highest Value = 255.
_The motor runs continuously in forward direction at full speed(255)
**How the Code Works 💻:
The main part of the code is a for loop that gradually increases the motor's speed
_starts with speed = 0 (motor OFF)
_Increases the speed variable by 5 every time.
_Ends when speed = 255 (motor at full speed)
*Connections:🔌
using the same H-Bridge motor driver (L293D) to control two DC motors.
_The H-Bridge is powered by an external power source (Buttery) and 5V (Arduino).
_Arduino GND is connected to the H-Bridge GND.
-> MOTOR_1 :
_Input1 on the H-Bridge → (pin 2)
_Input2 on the H-Bridge → (pin 3)
_ Enable pin on the H-Bridge → (pin 5)
_The motor is connected between output1 and output2 on the H-Bridge
-> MOTOR_2 :
_Input1 on the H-Bridge → (pin 12)
_Input2 on the H-Bridge → (pin 13)
_ Enable pin on the H-Bridge → (pin 6)
_The motor is connected between output3 and output4 on the H-Bridge
**How the Code Works 💻:
_First, defined six variables using (int) to represent the control pins for two DC motors connected through an H-Bridge Motor Driver.
_Used pinMode() to set all six motor pins as OUTPUT.
first, Motor_1 starts moving forward:
_enables Motor_1 (motor1enablepin) is set to HIGH ,(motor1forwardpin) is set to HIGH and (motor1reversepin) to LOW .
_Runs for (1 second) using delay(1000).
Then, Motor_1 stops:
_All its pins are set to LOW to stop motion completely and Short delay(50) between motors.
Motor_2 starts moving forward:
_enables Motor_2 (motor1enablepin) is set to HIGH ,(motor1forwardpin) is set to HIGH and (motor1reversepin) to LOW .
_Runs for (1 second) using delay(1000).
Then, Motor_2 stops:
_All its pins are set to LOW to stop motion completely and Short delay(50) between motors.
*Connections:🔌
_The middle leg of the potentiometer was connected to analog pin A0 on the Arduino.
_The two side legs were connected to 5V and GND.
_Anode led connected to pin 3 (PWM pin) on Arduino.
_Cathode led connected to GND on breadboard.
**How the Code Works 💻:
_First, defined four variables using (int) to represent the control pins for led ,potentiometer, analog reading from the potentiometer and (lightintensity) converted value used to control the LED brightness.
_used pinMode() to set the LED pin as OUTPUT and the potentiometer pin as INPUT.
_potvalue = analogRead(potpin) This returns a value between 0 and 1023, based on the rotation of the potentiometer.
_Convert Potentiometer Value Using map() It scales the potentiometer value from its original range (0–1023) to a new range (0–255).
When potentiometer reads 0 -> lightintensity = 0 -> LED is OFF.
When the potentiometer reads 1023 -> lightintensity = 255 -> LED is at full brightness.
"the brightness of the LED based on light intensity Value."
*Connections:🔌
_each anode of the RGB LED is connected to different (PWM pin) on the Arduino.
_cathode is connected TO GND on the Arduino.
_each potentiometer (middle leg) is connected to a analog pin.
_One side of each potentiometer goes to 5V, the other side connects to the GND through Breadboard.
**How the Code Works 💻:
_defined Three variables using (int) to represent the control pins for RGB ,defined Three variables to represent the control pins for each potentiometer and defined variables to store the analog readings and calculated brightness levels for each led .
_used pinMode() to set the RGB pins as OUTPUT and the potentiometers pins as INPUT.
_The analog value from each potentiometer is read using analogRead().
_Convert Potentiometers Values Using map() It scales the potentiometer value from its original range (0–1023) to a new range (0–255).
_the mapped value is sent to LED using analogWrite() to control the brightness of each LED.
*Connections:🔌
_Servo Motor Signal connects to pin 7.
_Servo VCC connects to pin 5V.
_Servo GND connects to pin GND.
**How the Code Works 💻:
_ #include <Servo.h> : the Servo library, which allows easy control of servo motor.
_Servo mymotor : creates a servo Variable to control of servo motor.
_In the setup() mymotor.attach(7) connects the servo motor’s signal wire to pin 7.
_ in the loop , mymotor.write(90): moves the servo to 90° .
_delay(1000) : stop for 1 second.
_ then mymotor.write(0): moves the servo to 0° .
_delay(1000) : stop for 1 second again.
*Connections:🔌
_Servo Motor Signal connects to pin 7.
_Servo VCC connects to pin 5V.
_Servo GND connects to pin GND.
_The middle leg of the potentiometer was connected to analog pin A5 on the Arduino.
_The two side legs were connected to 5V and GND.
**How the Code Works 💻:
_First, defined one variable for the potentiometer value.
_ #include <Servo.h> : the Servo library, which allows easy control of servo motor.
_Servo mymotor : creates a servo Variable to control of servo motor.
_In the setup() mymotor.attach(7) connects the servo motor’s signal wire to pin 7.
_used pinMode() to set the potentiometer pin as INPUT.
_analogRead(potpin) : reads the analog signal from the potentiometer.
_map(potvalue, 0, 1023, 0, 179) : Convert Potentiometers Values Using map() It scales analog range of the potentiometer (0–1023) to the servo’s range of motion (0–179).
_mymotor.write(motorvalue) : rotates the servo to the mapped angle.
in this task, we are building a temperature-controlled system using a temperature sensor, a DC motor with a driver, a switch, and an RGB LED.
The system has two operating modes based on the switch:
_When the switch is ON, the motor runs with a speed proportional to the temperature.
_When the switch is OFF, the motor is stopped, and the RGB LED indicates the temperature level using different colors (blue, green, red) depending on the temperature range.
*Connections:🔌
_The middle leg (Vout) of the TMP36 was connected to analog pin A5 on the Arduino andThe two side legs (power & GND) were connected to 5V and GND.
_each anode of the RGB LED is connected to different digital pin on the Arduino and cathode is connected TO GND on the Arduino.
_Input3 on the H-Bridge connected to (pin 3) , Input4 on the H-Bridge → (pin 2) , Enable pin on the H-Bridge → (pin 5) ,The motor is connected between output3 and output4 on the H-Bridge ,The H-Bridge is powered by an external power source (Buttery) and 5V (Arduino) and Arduino GND is connected to the H-Bridge GND.
_Switch (Common Leg) is connected to a pin(4). One side of each Switch goes to 5V, the other side connects to the GND through Breadboard.
**How the Code Works 💻:
_First, the code reads the analog value from the TMP36 using analogRead() and stores it in the variable tempsensorvalue.
_converted the analog value to voltage using the formula:
(voltage = tempsensorvalue * 5 / 1024)
_calculated the temperature in Celsius using:
(tempcelsius = (voltage - 0.5) * 100)
_Convert Temperature Values Using map() It scales analog range of the TMP36 (-40 –125) to the new range(0–255).
_If the switch is ON (switchvalue == 1):
-> The motor is activated .
-> Motor direction reverse pin = HIGH, forward pin = LOW.
-> All RGB LEDs are OFF.
_If the switch is OFF (switchvalue == 0):
-> The motor is OFF.
->The RGB LED is controlled based on temperature:
_Blue → if temp < 15°C
_Green → if 15°C ≤ temp < 70°C
_Red → if 70°C ≤ temp ≤ 125°C
while writing the code, I forgot to include a complete condition in the if statements for the temperature sensor. For example, in the first condition, I only wrote temperature < 70 without specifying that it should also be greater than 15. This caused both LEDs to turn on at the same time when the temperature was very low.
Similarly, in the second condition for temperature > 125, I didn’t specify the upper and lower range correctly, This caused all LEDs to turn on at the same time.
I later fixed it by defining the full range in each condition :
-> temperature >= 15 && temperature < 70
-> temperature >= 70 && temperature <= 125
to ensure the LEDs work independently.
Before fixing the code, I felt that the LEDs looked like this🤣: