Using the photosensor, the light level is detected to determine if all of the lights are off in a given space. This is done by finding a setting where the photosensor is below a specific ambient light level determined through testing (about 2000 in my testing). If the light levels are below a specific point, then the user is able to adjust the brightness of the LED using the potentiometer to create a custom light brightness.
I went through a few different iterations before landing on this setup. Originally I was going to use the RGB LED to change the hue of the light with the potentiometer, but I could not get the RGB LED to set up properly following the instructions, so I will attempt that for next time. Next, I was going to use the temperature sensor to set the LED brightness to a corresponding level of heat (so low light for low temp, etc) however, the wiring diagram online must have had some errors because when I set it up following that it got hot and I immediately had to remove it. So I settled on something a bit different than where I started to still explore how these two components could interact. The next step would be to eliminate the potentiometer and have the user provide input on their device using a slider.
I am definitely understanding better how to create the code to run the individual components. I am still struggling with wiring up the individual components because I don't quite understand how each individual component is intended to be wired to prevent any problems. I also have trouble diagnosing between code and wiring errors. If there is a way to test the board setup without code to ensure it's set up correctly that would be useful to know!
I really want to use the RGB LED so in our next lab I will try to focus on making that work!
You can upload files of up to 20MB using this form.