Skills Dev II: Working with Inputs and Sensors - Nicole Korber

Made by Nicole Korber ·

Skills Development II

Created: December 4th, 2022

0

Outcome

Utilizing a sensor, I worked with inputs for the first time.

0
0
0
int photoCellPin = A0;
int photoCellReading = 0;
int ledPin = D2;
int ledBrightness = 0;


void setup() {
    pinMode(ledPin, OUTPUT);
    
    Particle.variable("light", &photoCellReading, INT);
}

void loop() {
    photoCellReading = analogRead(photoCellPin);
    
    ledBrightness = map(photoCellReading, 0, 4095, 0, 255);
    
    analogWrite(ledPin, ledBrightness);
    
    delay(100);

}
Click to Expand
0

Process

This process was fairly straight forward. I did run into one issue where I was using the wrong resistor, but I replaced it.  It is a bit difficult to see the dimming of the LED, but is easier to see in low light.  At first I was not sure it was working, but I was able to check the input values on the particle console to confirm it worked.

0

Reflection

I gained a basic understanding of input values from this lab.  Prior to working on this, I was unsure how many IoT devices read their environment and created actions based on the information they gathered.  However, this lab helped me understand the code and circuitry behind how sensors enable these features for IoT devices.  I did not consider how many different types of sensors their are in everyday objects.  This lab enabled me to understand how they function, and potentially most importantly, when each sensor would be useful when designing products.

0

Next Steps

Moving forward, I would like to practice with a larger variety of sensors creating different outputs.  I want to gain a better understanding of how each sensor functions to know when it would be helpful to incorporate them going forward.  In addition, I would like to work on adding more complex outputs.  I feel understanding how to manipulate outputs opens up far more design possibilities.

x
Share this Project

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


Courses

About

Skills Development II