0% found this document useful (0 votes)
2 views5 pages

Robotic and Electronic Systems

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 5

Robotic and Electronic Systems

Stage 1, Specialized Skills Task 1


For my Fusion 360 project, I designed a cube torch measuring 90mm across and 80mm high.
I started with a new component, drew in a rectangle length and width of 90mm to form the
base, and extrapolated it to a height of 80mm. I further made a new sketch on the lower
surface and added some 10mm diameter holes for wiring and battery placement. On one
side, I drew a circle with a radius of 30 mm, then extruded it outward by 40 mm to create a
recess for the torch's light. To complete this design, on one side, I did a cut-out in the form
of a rectangle, 10 mm by 18 mm, for a switch button that would turn on the LED light at the
user's will. The design guarantees functionality and aesthetic value, featuring chamfered
edges and dimension accuracy to form a cube-shaped efficient torch.

Description: https://www.tinkercad.com/things/44yD7gIMfv8-leds-torch-/editel
Description of the Arduino LED Button Toggle Circuit
Components Used:
Arduino Uno
Breadboard
3 LEDs
Resistors (typically 220 ohms for the LED and 10k ohm for the pull-down resistor)
Jumper Wires
Circuit Connections:

Circuit Connections:

1. Arduino to Breadboard:
oConnect the 5V pin of the Arduino to the positive power rail (red rail) on the
breadboard.
o Connect the GND pin of the Arduino to the negative power rail (black rail) on
the breadboard.
2. LED Connections:
o Red LED:
 Connect the anode (longer leg) of the red LED to the built-in LED pin
on the Arduino (usually digital pin 13) through a 220-ohm resistor.
 Connect the cathode (shorter leg) of the red LED to the GND rail.
o Yellow LED:
 Connect the anode (longer leg) of the yellow LED to digital pin 12 on
the Arduino through a 220-ohm resistor.
 Connect the cathode (shorter leg) of the yellow LED to the GND rail.
o Green LED:
 Connect the anode (longer leg) of the green LED to digital pin 11 on
the Arduino through a 220-ohm resistor.
 Connect the cathode (shorter leg) of the green LED to the GND rail.

Code Explanation:
The code uploaded to the Arduino simulates a traffic light sequence, cycling through green,
yellow, and red lights.
code
// C++ code
//
int animationSpeed = 0;

void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
}

void loop()
{
animationSpeed = 1000;
digitalWrite(LED_BUILTIN, HIGH);
delay(animationSpeed); // Wait for animationSpeed millisecond(s)
digitalWrite(LED_BUILTIN, LOW);
delay(animationSpeed); // Wait for animationSpeed millisecond(s)
digitalWrite(12, HIGH);
delay(animationSpeed); // Wait for animationSpeed millisecond(s)
digitalWrite(12, LOW);
delay(animationSpeed); // Wait for animationSpeed millisecond(s)
digitalWrite(11, HIGH);
delay(animationSpeed); // Wait for animationSpeed millisecond(s)
digitalWrite(11, LOW);
delay(animationSpeed); // Wait for animationSpeed millisecond(s)
}

Code Functionality Explanation


The provided C++ code is designed to control an Arduino to cycle through three LEDs
connected to different pins. The LEDs are turned on and off in sequence, simulating a simple
lighting pattern. Here’s a detailed explanation of the code's functionality:

Variable Definition:

 animationSpeed: An integer variable that determines the delay duration between


LED transitions.

Setup Function:

 pinMode(LED_BUILTIN, OUTPUT);: Sets the built-in LED pin (usually pin 13) as an output.
 pinMode(12, OUTPUT);: Sets digital pin 12 as an output.
 pinMode(11, OUTPUT);: Sets digital pin 11 as an output.

Loop Function:

Detailed Explanation:

Setting the Delay:

 animationSpeed = 1000;: Sets the delay duration to 1000 milliseconds (1 second).

Built-in LED (Red Light) Phase:

 digitalWrite(LED_BUILTIN, HIGH);: Turns on the built-in LED.


 delay(animationSpeed);: Waits for 1 second.
 digitalWrite(LED_BUILTIN, LOW);: Turns off the built-in LED.
 delay(animationSpeed);: Waits for another second.

LED on Pin 12 (Yellow Light) Phase:

 digitalWrite(12, HIGH);: Turns on the LED connected to pin 12.


 delay(animationSpeed);: Waits for 1 second.
 digitalWrite(12, LOW);: Turns off the LED connected to pin 12.
 delay(animationSpeed);: Waits for another second.

LED on Pin 11 (Green Light) Phase:


 digitalWrite(11, HIGH);: Turns on the LED connected to pin 11.
 delay(animationSpeed);: Waits for 1 second.
 digitalWrite(11, LOW);: Turns off the LED connected to pin 11.
 delay(animationSpeed);: Waits for another second.

Overall Functionality:

This, therefore, is a simple light-up sequence of each LED—the inbuilt LED, the LED at pin 12, and the LED at pin
11—lighting up singly for one second each and then turning off. It shall repeat itself in a cycle. The end result will
thus be a continuous pattern of LEDs lighting up and then switching off in sequence. These delays set a period for
how long each light should be on to create a clear and distinct-looking sequence.

Evaluation
In the development of the cube torch light, there were a few problems I encountered, which
served as valuable learning curves and greatly improved how I approach project work. It
turned out that even though one could book in advance on the 3D printer, there were
frequent interruptions to its work. All this taught me planning and scheduling printing
sessions with greater efficiency. Another challenge was not having any previous experience
with coding, but I was able to pick up the basics from classmates and online tutorials, and
those really improved my coding. Another key thing learned is adapting to a microboard
from an oversized board that I chose initially, which taught me adaptability and planning.
This project has really shown me that peers and online resources, together with study
groups, are very instrumental in sharing knowledge and troubleshooting. I have also learnt
that revising and making changes to the different components of the project is key to
delivering the best results. I realized that consulting for help from friends or through online
tutorials was a major factor in surmounting some of the obstacles and proceeding with this
project. In the future, I will put these lessons into practice by designing a better system—
structured in a manner that will ensure smoother execution of tasks and delivery of better
results.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy