Back to Parent

Outcome


Outcome

    • I used a button and a sensor as inputs, an LED as output. If the button is not pushed, then LED will not be turned off. If the button is pushed, LED will be turned on and light up according to the intensity of the ambient light in the surrounding.
    • If the intensity of light is strong, (e.g., in this situation, nothing covers the sensor and blocks the light), the LED will change its brightness according to the intensity of light.
    • If the intensity of light is weak, (e.g., in this situation, use something to cover, but not completely, the sensor), the LED will blink, indicating that the light is too dim now.

Show Advanced Options

Process

I first mapped 0-4095 to 0-255, but failed to feel the LED changing its brightness according to the surrounding light. Then I used cloud variable and output the reading of photoresistor, found that when I covered the sensor, the reading is around 2500, and when I didn't cover it, the reading is around 3700. Then I realized that the brightness of LED didn't fade was because the range 0-4095 is too large, no matter how the surrounding light changed, there was only a little difference after they are mapped to 0-255. Thus, I adjusted the range to 2500-4095. I also set the threshold to 3000 to indicate whether the sensor is covered or not.

Reflection

From this project, I learned that we can connect sensors with outputs to more vividly present the state of surrounding environment. We can also use other kind of input to control the output from a second dimension. When setting thresholds, we need to first carry out experiments and collect data to find a suitable value in specific surrounding.
Next step: I will make the brightness of light in verse proportion to the intensity of ambient light. Because in this way, it will be more reasonable and practical because we need brighter light under a dimmer environment.

Sensor circuit.thumb
Show Advanced Options
Show Advanced Options
Drop files here or click to select

You can upload files of up to 20MB using this form.