By Annalisa DeBari, James Liao, and Andrew Sack
Good day! Oh it's too bright outside! I need my sunglasses, oh but I don't want to put them on because I'm too lazy and my hands are occupied doing things that are more worth my time. What should I do? Should I just not wear sunglasses and let the bright sunlight hurt my eyes? Of course not! That's why we designed this device.
This project uses the raspberry pi and GoPiGo board. A grove light sensor is used to measure the brightness of the room. A 180 degree servo is used to actuate the sunglasses. Everything is mounted to an 80-20 frame which is shaped to sit on your head.
The light sensor value is read and compared to a threshold. We found that 68 was a good value for the threshold. If the value is greater than the threshold (it is sunny), the code checks to see if the sunglasses are already down and, if they are not, the sunglasses are lowered. The same thing happens with raising the sunglasses if the light sensor value is below the threshold. This all repeats in an infinite loop with a short sleep between iterations.