Created as a showcase project, AMAZE-28, the single-room summer house, was successfully constructed within 28 days on the grounds of the Kerala State Nirmithi Kendra. The 3D-printed building at the Kerala State Nirmithi Kendra in Thiruvananthapuram. (Photo: Shekunj) The inauguration of Kerala's inaugural 3D-printed structure, a 380-square-foot single-room summer house, is scheduled to take place on October 10 at the Kerala State Nirmithi Kendra (Kesnik) campus located in PTP Nagar, Thiruvananthapuram. Conceived as a showcase initiative, the summer house named AMAZE-28 was successfully finished within a mere 28 days. This impressive project was executed by Tvasta, a construction technology startup based in Chennai, founded by alumni of IIT-Madras, who have entered into a memorandum of understanding (MoU) with Kesnik. AMAZE-28 is perched upon a concrete foundation atop a gentle elevation within the Kesnik campus. Febi Varghese, the Director and Chief Executive Officer of...
Hi Techies !!!!!!!!
Today we are going to make a very interesting project, that is creating any color of light with Red, Green and Blue LED (RGB). Here we will control the brightness of each color with Arduino, to create the desired color. Let's start the collecting the components which we will need for this project.
COMPONENTS NEEDED -
Components used. |
- Solderless breadboard (1)
- Arduino UNO (1)
- RGB LED 5mm (1) / Red, Green and Blue LED 5mm (1 of each color)
- Power source 5V (1)
- Jumper Wires
- 1K ohm Resistor (1/3)
CIRCUIT -
STEP - 1 |
STEP - 2 |
In above circuit we have connected -
ANODE of RGB LED -
- Red - to pin 9
- Green - to pin 10
- Blue - to pin 11
CATHODE of RGB LED - to GND through 1K ohm resistor.
If you do not have RGB LED then you can use Red, Green and Blue LEDs (5mm) separately. Their connection is shown below.
Alternate Way to Make RGB LED |
Now we have completed our circuit. Now let's focus on programming part of this project.
PROGRAMMING -
You can find the link to download the complete code at the end of discussion, but right now we are going to discuss the programming of our project.
--------------------------------------------------------------------------------------------------------------------------
int redLed = 9;
int greenLed = 10;
int blueLed = 11;
void setup()
{
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(blueLed, OUTPUT);
}
--------------------------------------------------------------------------------------------------------------------------
In the above set of lines we just set the pin for red, green and yellow LEDs. And also defined those pin of arduino with which our LEDs are connected (that are pin 9, 10 and 11) as OUTPUT pin. We must notice here that pin 9, 10 and 11 of arduino are PWM pins. Why we are choosing PWM ??? Let's find the answer of this question ahead.
Now we define a function - void creatColor(int red, int green, int blue)
--------------------------------------------------------------------------------------------------------------------------
void creatColor(int red, int green, int blue)
{
analogWrite(redLed, red);
analogWrite(greenLed, green);
analogWrite(blueLed, blue);
}
--------------------------------------------------------------------------------------------------------------------------
Here we defined a function which take integer values of color intensity of each color. Since arduino only no digital values (HIGH or LOW) and intensity of color may very from off to full brightness, so how we would tell to arduino represent intermediate brightness of LEDs ?? To overcome this problem we are using PWM. With the help of PWM we can represent analog value into digital form. here -
OFF = 0
Full Brightness = 255
Intensity between off and full brightness will having the value between 0 to 255.
So with the help of analogWrite() we can assign the various intensties to the LEDs
--------------------------------------------------------------------------------------------------------------------------
void loop()
{
creatColor(255, 0, 0); //red
delay(500);
creatColor(0, 255, 0); // green
delay(500);
creatColor(0, 0, 255); // blue
delay(500);
creatColor(255, 255, 0); // yellow
delay(500);
creatColor(80, 0, 80); // purple
delay(500);
creatColor(0, 255, 255); // aqua
delay(500);
creatColor(255, 255, 255); // white
delay(500);
}
--------------------------------------------------------------------------------------------------------------------------
Above part is the main loop of the code, which will run again and again. Here we used our predefined function - creatColor(int red, int green, int blue).
This function will set the values of intensity of each color. By mixing up of different intensities of the three colors, new colors of light will form.
SIMULATION -
Our task has completed, now let's see the working of our project.
To watch the simulation of complete project - CLICK HERE
Comments
Post a Comment