In this project, we used three phototransistors and a color changing LED, to create a lamp that will change colors. The three photo transistors are used to determine the colors that the LED will be changing into, being Red, Green and Blue. This was a bit more intricate of a circuit as it required using both sides of the circuit board connecting the power from one side to the other. Each Phototransistor has a 10kohm Resistor, and is connected to Analog inputs A0, A1, and A2 on the Arduino itself. The longer prongs of the phototransistors is crossing the board over the middle and is powered from transferring power from one side of the board to the other. Then the LED itself, having 4 prongs, the longest being the ground, will be connected to the arduino digital pins 9, 10, and 11 to bring voltage to the led itself along with 3 220ohm resistors to each of these prongs as well. As for the coding, we assign the analog and digital pins to be constant integers, and added variables to the sensor values being used to fade the led, setting each integer value to 0 for now. In the setup, we begin communication and set the pins to be the output. In the loop, we set to code to read the analog pins as well as code in for sensor readings to appear. The new mapped values are then set to appear with the analogWrite functions for each pin.
DISCLAIMER:
This was recorded during daytime so it was a bit difficult to get a different predominant light than the white, as well as having lost the blue gel filter for the third phototransistor(it was not cooperating and flung away somewhere)


_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)






Comments