Skills Dev 4

Made by Tianyi He · HIDDEN

Created: December 18th, 2023

This project is unlisted and only folks with the link can see it. Be considerate and think twice before sharing.

0

Intention

This innovative device serves as an intuitive alert system, signaling changes in ambient light within a room. Its primary function is to act as a light-dark indicator, subtly conveying the time of day or changes in lighting conditions through the movement of a servo motor. This is especially useful in environments where natural light varies significantly throughout the day or in spaces where immediate awareness of lighting changes is beneficial.

The project is mainly the integration of a photoresistor and a servo motor. The photoresistor, a type of light-sensitive component, continuously monitors the intensity of light in the environment. As the light levels change, the photoresistor detects these variations and transmits this data to the argon. The argon then processes this information and translates it into a corresponding movement in the servo motor.

Overall, this light-detecting device with its innovative use of a photoresistor and servo motor offers a straightforward yet effective solution for monitoring and indicating light changes, making it a valuable addition to any space where light levels are of interest or concern.

0

Process

The process was relatively smooth, despite some minor setbacks such as the servo motor not moving enough. This problem was then solved by changing the photocell reading and make the motor move bigger and more noticable.

0

Outcome

0
0
int pinServo = A3;
Servo servoMotor;
int positionServo = 0;

int pinLightSensor = A0;
int lightSensorValue = 0;

void setup() {
    servoMotor.attach(pinServo);
    Particle.function("servoAdjust", adjustServo);
    Particle.variable("servoPosition", &positionServo, INT);
}

void loop() {
    lightSensorValue = analogRead(pinLightSensor);
    positionServo = calculateServoPosition(lightSensorValue);
    servoMotor.write(positionServo);
}

int adjustServo(String command) {
    int newPosition = command.toInt();
    if (newPosition == -1) {
        positionServo = calculateServoPosition(lightSensorValue);
        servoMotor.write(positionServo);
    } else {
        positionServo = constrain(newPosition, 0, 180);
        servoMotor.write(positionServo);
    }
    return 1;
}

int calculateServoPosition(int sensorValue) {
    return map(sensorValue, 2000, 4095, 0, 180);
}
Click to Expand
0

Reflection:

This particular skill dev has opened my eyes to the simplicity and effectiveness of using motors as indicators for data representation, which can significantly enhance the convenience and functionality of our daily lives. Through this experience, I've gained a more profound comprehension of the principles and complexities of IoT devices.

This project has not only introduced me to the practical aspects of motor utilization in signaling information but also broadened my perspective on the versatility and potential of IoT devices. The ability to translate data into physical motion with motors is a powerful tool, allowing for a more intuitive understanding and interaction with the data we encounter. It demonstrates how seemingly complex information can be made accessible and user-friendly through creative applications of technology.

x
Share this Project

This project is unlisted and only folks with the link can see it. 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.


About

~