Diwali Special

by robopathshala in Circuits > Electronics

3690 Views, 3 Favorites, 0 Comments

Diwali Special

05f239cc-a7b2-4ec4-befb-c68822841c72.jpg
56ec503c-bf07-4127-b635-0fdcccf5885f.jpg
1bc470c9-0121-4578-b68c-d8d2bc7a8eaa (1).jpg
Smart Diya

Winter is Coming...festival decorations are everywhere.

One of the gadgets that can be found everywhere are led light diya . They are cheap, clean and not as dangerous as real diya.

Let's start it.....

Preparation of the Materials

Arduino_Uno_-_R3.jpg
sen-1327-gas-sensor1.jpg
f67a57a3-5a0f-4b1d-939a-99b3c1741f64.jpg
f6502a0e-2236-4d89-8114-82af9a6385c8.jpg
b38a8904-d8f7-4fef-812c-d8f3351f5f1c.jpg
e667e836-e5aa-49dd-8a34-beabceb4c8c9 (1).jpg
6454d5e1-5a95-43d6-8616-da7bf28019e6.jpg

What we need for this DIY is a

  • Diya
  • Leds
  • Arduino uno
  • Gas sensor
  • General purpose Pcb
  • Wire
  • Lm 324 or 358
  • Photodiode
  • Resistances 330 ohm , 10k
  • Potentiometer 10k
  • Hot glue gun
  • A box
  • Soldering iron
  • Screwdrive

Preparing the Led Diya

e1c97652-ef95-4763-8de8-f162ede78656.jpg
603018be-628b-4efe-b17e-e375ab9688f3.jpg
6c99978d-a11c-4ba6-b963-979e274bb668.jpg
03c32d21-4466-491d-8b84-8e949be857b4.jpg
5e251ad3-47aa-4a38-9237-cf56f178ad10.jpg
deb55d71-329b-479c-acfa-0c1e83e04b40.jpg
de07b5d5-1702-46dd-9d99-8503fdacbccd.jpg
e667e836-e5aa-49dd-8a34-beabceb4c8c9.jpg

STEPS are :

  1. Takes some Yellow Leds and glue it on Diya with the help of hot glue gun.
  2. Now connect the all leds in parallel (positive to positive and negative to negative) with the help of soldering iron.
  3. Than I drilled the hole for I.R SENSOR and GAS SENSOR wire.

Circuit Diagram for Sensor

f55b2fda-9604-44ab-b402-537d1ab666aa.jpg
42dcca4b-a45b-402e-abdc-089e92351d0c.jpg
58402ed1-9812-4cf0-84ee-0a800d45ed37 (1).jpg
69342383-c888-4336-9aed-8ec32cc5d43f.jpg
a0b1582d-13c7-4ab1-9ac7-148ff37917a7 (1).jpg
a0b1582d-13c7-4ab1-9ac7-148ff37917a7.jpg
20170923_143747.jpg
8314e5d6-ecc0-4a9e-bd25-6dda07802270.jpg
94cf2a32-2ad3-451e-84a3-2b5a021dcff6.jpg

I used two sensors :

  1. one is I.R SENSOR with the help of I.R SENSOR. I am able to operate my DIWALI SPECIAL DIYA with any I.R remote (T.V, A.C).
  2. second one is GAS SENSOR.

WATCH MY VIDEO if you want to know why i am using Gas sensor in my instructable.

Final Touch Up

6454d5e1-5a95-43d6-8616-da7bf28019e6 (1).jpg
89e25a4d-303a-431a-810c-d34a848f99c1 (1).jpg
72eb9a20-97fe-4e22-8713-dda3fed82047.jpg
20170923_143808.jpg
20170923_143721.jpg
20170923_143738.jpg

Take a box and cut it from the bottom portion and glue it on base surface of Diya

Code

Screenshot (284).png
Smart Diya
int ledPin = 3; // choose the pin for the LED
int switchPin =4; // choose the input pin (for a pushbutton)
int val = 0; // variable for reading the pin status
int counter = 0;
int currentState = 0;
int previousState = 0;
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(switchPin, INPUT); // declare pushbutton as input
pinMode(A0, INPUT);
}
void loop(){
int pot_value = analogRead(A0);
val = digitalRead(switchPin); // read input value
if(pot_value>=180)
{
digitalWrite(ledPin, HIGH);
 }
else if(pot_value<=180&&pot_value>=150)
{
digitalWrite(ledPin, LOW);
 }
if (val == LOW) { // check if the input is HIGH (button released)
currentState = 1;
}
else {
  currentState = 0;
}
if(currentState != previousState)
{
if(currentState == 1)
{
counter = counter + 1;
}
if(counter%2==0)
{
digitalWrite(ledPin, HIGH);
 }
else
{
digitalWrite(ledPin, LOW);
}
}
previousState = currentState;
delay(250);
}