Week 6
RGB Colour Mixer
Ideation
Tell us about your assignment's idea for this week. Why do you care about this idea? What inspired you? (Please include images or links to sources of inspiration)
This week’s assignment was to build and program a smart circuit using an Arduino UNO which reads a signal from an input component to control an action component using code blocks
I love playing with colors & blending them to produce new colors, so I simulate this online RGB color mixer ^^
https://www.csfieldguide.org.nz/en/interactives/rgb-mixer/
Tool Chain
Which software/machines/materials did you use in the assignment? Why?
Software:
Tinkercad: to build, simulate & test the electrical circuit online
Arduino IDE: to upload the code to the Arduino hardware
Electric Components:
Mini breadboard, jumpers to connect the component
RGB LED & three 220-ohm resistors to control light emission
Three 1kb potentiometers to set the percentage of each color
Arduino Uno to read the input signals from the potentiometers & accordingly, control the color of the RGB LED
Design/Preparation Process
Explain the design and/or preparation process of your assignment. How did you use the tool or software to design and/or prepare your assignment before fabrication/implementation?
Designing & simulation of the virtual circuit on Tinkercad
RGB LED, 3 resistors, 3 potentiometers, breadboard & Arduino UNO were inserted
+ &- rows of the breadboard were connected to the 5V and GND pins for Arduino (5V as no extra volts are required from an external source; around 2v went to the RGB LED & the extra for the resistor according to the ohm law)
Resistors are settled to 220 ohms to control the current
RGB led was connected in series to the three 220-ohm resistors (a resistor for each color leg)
The cathode leg of the RGB LED was connected to the breadboard's (-) row
The remaining terminals of each resistor were connected to the Arduino's ~3,~5, & ~6 analog output pins
Terminals (1) of all potentiometers were connected to the breadboard's (-) row, while terminals (2) were connected to the (+) row
The wiper pins of the potentiometers were connected to A0, A1, A2 analog input pins of the Arduino
by using code blocks, the value of each potentiometer was mapped to range values from 0 to 255, so each potentiometer will control the analog output of each RGB color.
-The value of the analog pin A1 (2nd potentiometer) controls the green color intensity by setting the value of pin 5 (green leg of the RGB LED) to range from 0 to 255
-The value of the analog pin A2 (3rd potentiometer) controls the blue color intensity by setting the value of pin 6 (blue leg of the RGB LED) to range from 0 to 255
-The value of the analog pin A0 (1st potentiometer) controls the red color intensity by setting the value of pin 3 (red leg of the RGB LED) to range from 0 to 255
Then, the circuit was simulated virtually. RGB LED can display any color by rotating the potentiometers
You can try it by using the following embedded simulation:)
Input components: potentiometers
Output component: RGB LED
Code File: Color_Mixer.ino
Development/Implementation Process
Explain the development/implementation process of your assignment. How did you use the machine/tool to manufacture or implement the design of your assignment?
Uploading text code on Arduino
.ino file was downloaded from Tinkercad & opened by Arduino IDE software
The Arduino board was connected to the laptop and the right port was chosen "Tools ==> Port ==> COM6 Arduino UNO"
Then, It was uploaded successfully
Building the physical circuit
The breadboard, Jumpers, 1 RGB LED, 3 220-ohm resistors, 3 1k potentiometers & ِArduino UNO were taken from the electronic kit
The circuit was built physically (exactly as it was designed on Tinkercad) using the hardware components and wires
+ &- rows of the breadboard were connected to the 5V and GND pins for Arduino
Each color leg of the RGB led was connected in series to a 220-ohm resistor
The cathode leg of the RGB LED was connected to the breadboard's (-) row
The remaining terminals of the resistors were connected to the Arduino's ~3,~5, & ~6 pins (~3: Red; ~5: Green; ~6: Blue)
The right terminals of all potentiometers were connected to the breadboard's (-) row, while the left terminals were connected to the (+) row
The middle pins of the potentiometers were connected to A0, A1, A2 pins of the Arduino (A0: Red; A1: Green, A2: Blue)
The Arduino board was connected to the laptop
The circuit was tested, and it worked successfully as shown in the video
Overcoming Challenges
What kinds of challenges or problems did you face while doing the assignment, tutorials, or exercises? How did you solve them? Did you ask for help from an instructor or peer? Please provide a link to the tutorial or article that you used to solve your problem (if any)
I had challenges related to circuits' wiring, which I solved by visually tracking the circuit to ensure the right wiring.
Also, I wasn't able to use the motor driver correctly, but our amazing instructor, Esraa, explained it in a simple way, and also this tutorial helped me a lot (https://lastminuteengineers.com/l298n-dc-stepper-driver-arduino-tutorial/)
Regarding this assignment, when mixing the three colors in reality, RGB LED doesn't display the exact desired color as it was in the virtual simulation on Tinkercad. For example, here in this picture, LED displays red, green, and blue colors at the same time, not the color resulting from mixing these colors in specific proportions (note: a white sheet of paper was placed behind the lamp to clarify the resulting color). I searched Google, then I found that the RGB LED actually consists of three separate LEDs (red, green & blue) packed together in a single case. maybe this is the reason! (https://arduinogetstarted.com/tutorials/arduino-rgb-led)
Final Project
How can you use the skills and knowledge that you've acquired this week in your final project?
Learning how to make smart actions is really cool ^^
WOW!
Our waving hand was awesome ^^