My room on campus has an aquarium, however, I am not in my room the majority of the day so I either leave the light on all day or just leave it off. This also happens on weekends that I am not on campus, the light stays on for almost three days. This isn't really a big deal, but with this project, I no longer have to manually switch the lights on and off ever again.How it Works:
The argon attached to the aquarium uses inputs from a photo-resistor and a time function. The time function is essentially called from the cloud because the argon is connected to the internet via wifi. During the hours of 8 a.m. to 9 p.m., the argon knows that one criteria for the light is met. The other criteria is the detected current value from the photo-resistor. If the value is under a predetermined value then the second criteria is met and the aquarium light turns on. If the time is not within the specified bounds, the light is off. If the detected value is greater than the predetermined value, the light is off. Another important input to note is that in its initial state the circuit is not active and argon is not using any inputs, the light is just off. The circuit gets turned on when a button attached to a second argon is pressed. This publishes an event turning the aquarium argon on. The second argon also displays the status of the aquarium argon in real-time. If the LED is red, the aquarium light is on, if it's yellow the light is off, and if the D7 light is on but the LED is off then the circuit is in an "off" state. When the circuit is active during the specified hours, the aquarium argon publishes the sensor value so that ThingSpeak can graph it in real-time.Things to Note:
1. Using tinker to determine the sensitivity and light on values for the photo-resistor is the absolute first step.
2. The photo-resistor, in my case, flipped before filming. Before filming, values were shown at about 3500 with no lights, and under 2500 with lights on. As of filming, the values read 900+ for lights on and under 700 for no lights on.
3. The sensing argon code shows what appears to be several repeats in the code. This is because > and < symbols in the didn't turn off the light but the = sign did when the set time was reached. This is the only way I found to get the time function to work correctly.ThingSpeak
YouTube: Video 1 is a brief explanation of how things work, and an example of the project working. Video 2 shows the tank light turning off at 9 p.m.Pictures: