A simple LED project (48675-A2; Designing for the Internet of Things)

Made by Sohyun Jin ·

Create my first real internet appliance: a connected light with an Argon kit.

Created: October 26th, 2023

0

The document below demonstrates the execution of LED function using the Argon IoT starter kit. Initially it was difficult to understand how connection with the school internet works, but it didn't require any further processing once I linked to CMU-DEVICE with the allocated ID.  

The concept of Ground(GND) is intriguing to me. It is important to ensure that all the inputs, sensors, outputs are well connected to GND. I was wondering about whether this GND form applies to every electronic circuit board or if there are alternative ways to facilitate electron flow. 

0

Exercise 1 :  Modify the program to Blink on and off every 3 seconds.

As my first IoT attempt,  I connected a red LED to D2 pin wired with a 1kΩ register and named this D2-led pin as led1. The led 1 blinks every second. (1000 milliseconds) The demonstration is shown below. 

0
int led1 = D2;

void setup() {
    
    pinMode(led1, OUTPUT);
    
}

void loop() {
    

    digitalWrite(led1, HIGH);
    delay(1000);
    digitalWrite(led1, LOW);
    delay(1000);

}
Click to Expand
0
0

From the initial demonstration above, I extend the blink interval to three seconds. 

0
int led1 = D2;

void setup() {
    
    pinMode(led1, OUTPUT);
    
}

void loop() {
    

    digitalWrite(led1, HIGH);
    delay(3000);
    digitalWrite(led1, LOW);
    delay(3000);

}
Click to Expand
0
0

Exercise 2 : 

Following the first exercise, I made it paused between the five times of blinks. I use a for loop for Java as below. 

0
int led1 = D2;

void setup() {
    
    pinMode(led1, OUTPUT);
    
}

void loop() {
    
    for (int i = 0; i < 5; i++){
        digitalWrite(led1, HIGH);
        delay(500);
        digitalWrite(led1, LOW);
        delay(500);
    }
    digitalWrite(led1, LOW);
    delay(3000);

}
Click to Expand
0
0

Exercise 3: 

I added a blue LED as a second one at D3 and named it as led2. This one also wired to the ground. 

The red LED is off(LOW) while the blue one is on (HIGH) as follows.


0
int led1 = D2;
int led2 = D3;

void setup() {
    
    pinMode(led1, OUTPUT);
    pinMode(led2, OUTPUT);
    
}

void loop() {
    

    digitalWrite(led1, HIGH);
    digitalWrite(led2, LOW);
    delay(1000);
    digitalWrite(led1, LOW);
    digitalWrite(led2, HIGH);
    delay(1000);

    

}
Click to Expand
0
x
Share this Project

This project is only accessible by signed in users. Be considerate and think twice before sharing.


Courses

48-675 Designing for the Internet of Things 24

· 11 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


Focused on
About

Create my first real internet appliance: a connected light with an Argon kit.