Objective:
To learn how to build basic electrical circuits using Tinkercad and explore how to control them using an Arduino board.

Part 1: Basic Circuit Building

We began by learning how to create simple electrical circuits in Tinkercad. Using basic components such as LED bulbs, resistors, wires, and a breadboard, we practiced connecting them correctly to form a working circuit.

Part 2: Circuit 1 - Sequential Light Bulbs (5 LEDs in Parallel)

  • Setup: Five LEDs were connected in parallel, each with its own series resistor to prevent excessive current. Each LED-resistor pair was connected to a separate digital output pin on the Arduino.

  • Programming: We wrote a simple Arduino sketch that turned the LEDs on one by one in sequence.

    • The code used the digitalWrite() function to control each LED.

    • The delay() function was used between each LED activation to make the sequence visible.

  • Observation: When we ran the simulation, the LEDs lit up in order, one after the other, even though they were wired in parallel. This demonstrated how the Arduino can control multiple outputs individually.

  • Code: 

    void setup() {// set digital pins 2 to 6 as outputspinMode(2, OUTPUT); // RED LEDpinMode(3, OUTPUT); // yellow LEDpinMode(4, OUTPUT); // GREEN LEDpinMode(5, OUTPUT); // blue LEDpinMode(6, OUTPUT); // white LED}
    void loop() {// turn RED ON, others OFFdigitalWrite(2, LOW);digitalWrite(3, LOW);digitalWrite(4, HIGH);digitalWrite(5, LOW);digitalWrite(6, LOW);delay(1000);
    // turn yellow ON, others OFFdigitalWrite(2, LOW);digitalWrite(3, HIGH);digitalWrite(4, LOW);digitalWrite(5, LOW);digitalWrite(6, LOW);delay(1000);
    // turn GREEN ON, others OFFdigitalWrite(2, HIGH);digitalWrite(3, LOW);digitalWrite(4, LOW);digitalWrite(5, LOW);digitalWrite(6, LOW);delay(1000);
    // turn blue ON, others OFFdigitalWrite(2, LOW);digitalWrite(3, LOW);digitalWrite(4, LOW);digitalWrite(5, HIGH);digitalWrite(6, LOW);delay(1000);
    // turn white ON, others OFFdigitalWrite(2, LOW);digitalWrite(3, LOW);digitalWrite(4, LOW);digitalWrite(5, LOW);digitalWrite(6, HIGH);delay(1000);}

    Part 3: Circuit - Button-Controlled LED

    • Setup: One LED was connected to a digital pin through a resistor, and a pushbutton was connected to another digital input pin. 

    • Programming: The Arduino code was written so that:

      • When the button is pressed, the LED turns on.

      • When the button is released, the LED turns off.

      • The code used pinMode() to set the pin modes, digitalRead() to detect button state, and digitalWrite() to control the LED.

    • Observation: Pressing the button in the simulation caused the LED to light up, confirming that the Arduino can read input from a button and control an output based on that input.

    • Code: 

      int var=2; //to store on or off valuevoid setup() {pinMode(7, INPUT);pinMode(8, OUTPUT);}void loop() {var=digitalRead(7);if(var==0){digitalWrite(8, HIGH);}else{digitalWrite(8, LOW);}}

Learning Outcomes:

  • Learned to design circuits in Tinkercad and simulate them before physically building them.

  • Understood how to connect LEDs in parallel with individual resistors to an Arduino board.

  • Gained experience in writing Arduino sketches to control outputs sequentially and in response to input.

  • Observed the interaction between hardware (LEDs, buttons) and software (Arduino code) in a controlled environment.


Group Members:

Nama Almarzouqi

Dana Thabet

Jawaher Khalid