Pretty Light

by Hesham_A_9 in Circuits > Arduino

839 Views, 5 Favorites, 0 Comments

Pretty Light

20170812_160913.jpg
20170812_160929.jpg
20170812_161124.jpg

You can change the light of the RGB LED by using the smart phone

RGB LED have a 7 colours so this project makes a very cool light

Components

20170812_135512.jpg
20170812_135413.jpg

-Arduino

-Breadboard

-Bluetooth module

- 2 RGB LED

-3 Resistor 250 ohm

- Cable Arduino

- Lap top to make programming of the Arduino and also to make the application

- Mobile to use the App

- Wires

-Plastic

Frame

20170812_141843.jpg
20170812_140459.jpg

You will get plastic not very dark to can show the light

And you will design as you like cube or rectangle or a Cylindrical as I made I made it in a quite small Cylindrical

Design the Circuit

20170812_150338.jpg
20170812_145944.jpg

you will connect the LED and the Bluetooth meduol as show in the photo Bluetooth meduol


Tx……………………….Pin 1

Rx…………………….....Pin 0


RGB LED

Green in Pin 11

Red in Pin 10

Blue in Pin 12

App for Mobile

New Bitmap Image.bmp
New Bitmap Image (2).bmp
Screenshot_2017-08-12-22-01-07.png
Screenshot_2017-08-12-22-01-13.png
Screenshot_2017-08-12-22-01-17.png

I used thunkable Website to make the app

http://app.thunkable.com

coz its very easy to make a app in this website and its like AppInvator In the app when you click in the buttons its just send a data by using the Bluetooth communication

Downloads

Programming of the Arduino

New Bitmap Image.bmp

The Arduino receive data from the mobile by using the app via the Bluetooth

Like when receive a 2 make a Blue light

And when receive

7 else if (data == '7')

// Purple (turn red and blue on):

{ digitalWrite(10, HIGH);

digitalWrite(11, LOW);

digitalWrite(12, HIGH); }

Red and blue will turn on so will make a purple light

Code

#include 
SoftwareSerial mySerial(0, 1); // RX, TX
void setup()
{
  Serial.begin(9600);
  pinMode(10, OUTPUT);  //Red
  pinMode(11, OUTPUT);  //Grean
  pinMode(12, OUTPUT);  //Blue
}
char data = 0;
void loop()
{
  if (Serial.available() > 0)
  {
    data = Serial.read();
    delay(100);
    Serial.print(data);
    Serial.print("\n");
  }
  if (data == '1')
    // Red (turn just the red LED on):
  {
    digitalWrite(10, HIGH);
    digitalWrite(11, LOW);
    digitalWrite(12, LOW);
  }
  else if (data == '2')
    // Blue (turn just the blue LED on):
  {
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    digitalWrite(12, HIGH);
  }
  else if (data == '3')
    // Green (turn just the green LED on):
  {
    digitalWrite(10, LOW);
    digitalWrite(11, HIGH);
    digitalWrite(12, LOW);
  }
  else if (data == '4')
    // Yellow (turn red and green on):
  {
    digitalWrite(10, HIGH);
    digitalWrite(11, HIGH);
    digitalWrite(12, LOW);
  }
  else if (data == '5')
    // White (turn all the LEDs on):
  {
    digitalWrite(10, HIGH);
    digitalWrite(11, HIGH);
    digitalWrite(12, HIGH);
  }
  else if (data == '6')
    // Cyan (turn green and blue on):
  {
    digitalWrite(10, LOW);
    digitalWrite(11, HIGH);
    digitalWrite(12, HIGH);
  }
  else if (data == '7')
    // Purple (turn red and blue on):
  {
    digitalWrite(10, HIGH);
    digitalWrite(11, LOW);
    digitalWrite(12, HIGH);
  }
  else
  {
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    digitalWrite(12, LOW);
  }
}

Downloads

Finally Step

20170812_161025.jpg
20170812_161012.jpg
20170812_160953.jpg
20170812_160851.jpg
20170812_160833.jpg

And in finally you will get a cool light by very cheap bell