All submissions

Solving Approach

How do you plan to solve it?

 The solving approach for this LED blinking task involves two main parts: a hardware circuit setup and a software program.

 

Circuit & Resistor Calculation

 

  1. Components: You will need a microcontroller (like an Arduino), an LED, and a current-limiting resistor.

  2. Wiring: Connect one of the microcontroller's digital pins to one end of the resistor. Connect the other end of the resistor to the anode (long leg) of the LED. Finally, connect the cathode (short leg) of the LED to the microcontroller's GND (Ground) pin.

  3. Resistor Value: To ensure about 10 mA of current flows through the LED, you must use a specific resistor value. This is calculated using Ohm's Law:

    R=(Vsource​−VLED​)/ILED​

    • Assuming a 5V source (Vsource​) and a typical 2V voltage drop across the LED (VLED​):

    • R=(5V−2V)/0.010A=3V/0.010A=300Ω

      Since 300 Ω is not a standard resistor value, a 330 Ω resistor is the closest and most common choice.

 

Code & Logic

 

  1. Setup: In the code's setup() function, you must configure the chosen digital pin as an OUTPUT using the pinMode() function. This tells the microcontroller to send a voltage signal from this pin.

  2. Loop: In the loop() function, which runs continuously, implement the blinking logic:

    • Turn the LED ON by setting the pin to HIGH using digitalWrite().

    • Pause for 500 milliseconds using delay().

    • Turn the LED OFF by setting the pin to LOW using digitalWrite().

    • Pause for 1000 milliseconds using delay().

      The code will then loop back to the beginning, repeating this cycle indefinitely.
       

 

 

 

Code


const int ledPin = 13; 
void setup() {
  pinMode(ledPin, OUTPUT);
}

void loop() {
  digitalWrite(ledPin, HIGH);
  delay(500);

  digitalWrite(ledPin, LOW);
  delay(1000);
}

 

 

 

Output

Video

Add video of the output (know more)

 

 

Photo of Output

Add a photo of your hardware showing the output.

 

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!