color mixing wheel
make a simple electronic tool to make a primary color mixing. manually by switches.
and automatic by IR sensor (if it is dark turn on the white (maxing from all color) light).
helping in simulating the circuit.
Breadboard
resistors (220 Ohm)
RGB LED (common cathode)
jumpers (female-male and male-male)
push button switch
LDR sensor
connection:
-RGB LED: common cathode to ground and red pin to pin number 2 in Arduino.
- the push button to pin number 5 to control the red light.
connection:
-RGB LED: blue pin to pin number 4 in Arduino.
- the push button to pin number 6 to control the blue light.
connection:
-RGB LED: green pin to pin number 3 in Arduino.
- the push button to pin number 7 to control the green light.
testing first push button to on red light.
but the simulation is not correct (it is always run without pushing on the switch)to solve the problem adjust the code on Arduino ID.
each bottom will light color (red, green blue)
if IR sensor is high white light will light up.
this condition two mixing color.
take this code to Arduino ID.
provide a (_PULLUP) beside the INPUT of the push button.
now it is run perfectly.
provide these lines controlling the green light.
provide these lines controlling the blue light.
it is not the right sensor but it is the same connection with Arduino and code.
LDR module connection with Arduino
provide these lines (LDR).
if push the button to on red light and push the button to on green light together, to mix those colors and get a yellow light.
if push the button to on green light and push the button to on blue light together, to mix those colors and get a cyan light.
if push the button to on red light and push the button to on blue light together, to mix those colors and get a purple light.
(not possible on TinkerCad to simulate it)
the mixing color is not correct, because lines of code are not arranged correctly.
part 1 of the code
part 2 of the code
part 3 of the code
testing (here, when push on 2 switches to mixing color, it is not mixing right)
After the arrangement of the code lines correctly.
move part of the Boolean operator (And) in the first.
part 1 of the code
part 2 of the code
part 3 of the code
the manual mode of waving hands.
the automatic mode