Electronic, Craft, 3-D Ganesha
Material: 2-D design print of Ganesha, Water color , Glue, 3-D Printed foundation stand, Sketch pens.
Electronic material: Arduino kit, Jumper wire, PCB, Battery 5 V, Connector, Breadboard, RGB LEDs
Tools:
Soldering Gun, Scissor
Lesson plan:
1. Make a 2-D print of Ganapati on bond paper.
2. Cut the design using scissors.
3. Join the Ganapati body parts as shown in sequence.
4. Paint each part of the body using colors, sketch pen or water color, color should be simple and sober.
5. Attached chakra behind the Ganapati head..
6. Now placed the Ganpati on the foundation.
7. Write a code for Arduino with ultrasonic sensor.
8. Connect ultrasonic sensor with Microcontroller and do numbers of practicals, write code in such way that you will get lights on when you will be come in between 30 cm range from the system.
10. Mount the RGB lights on the PCB and soldering it properly.
9. Now attached your electronic system with the Ganapati foundation and do multiple trial before make it fix.
Code:
#define echoPin 2 // attach pin D2 Arduino to pin Echo of HC-SR04
#define trigPin 3 //attach pin D3 Arduino to pin Trig of HC-SR04
#define red_pin 7
#define blue_pin 8
#define green_pin 9
long duration;
int distance;
int i;
void setup() {
// put your setup code here, to run once:
pinMode(red_pin , OUTPUT);
pinMode(green_pin , OUTPUT);
pinMode(blue_pin , OUTPUT);
pinMode(trigPin , OUTPUT);
pinMode(echoPin , INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int ran_red;
int ran_green;
int ran_blue;
ran_red=random(100,255);
ran_green=random(100,255);
ran_blue=random(10,200);
digitalWrite(trigPin , LOW);
delayMicroseconds(2);
digitalWrite(trigPin , HIGH);
delayMicroseconds(10);
digitalWrite(trigPin , LOW);
duration = pulseIn(echoPin , HIGH);
distance = duration * 0.034 / 2;
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
if (distance<30){
for (i=1; i < 4; i ++){
analogWrite(red_pin , ran_red);
analogWrite(blue_pin , ran_blue);
analogWrite(green_pin , ran_green);
delay (100);
analogWrite(red_pin , 0);
analogWrite(blue_pin , 0);
analogWrite(green_pin , 0);
delay(100);
}
}else {
analogWrite(red_pin , 0);
analogWrite(blue_pin , 0);
analogWrite(green_pin , 0);
}
}
Working:
When we bring something in between ultrasonic sensor within 30 cm range then the RGB leds lights will turn on. The Ganpati is made of paper and pen. The small Ganpati and foundation of Ganpati is made up of 3-D Printer.
When anyone comes toward the Ganpati within 30 cm range, then the Ganpati foundation lights will be automatically on.
Created & Written By:
Soham Abhyankar (5th std)
Harshal Shimpi (Electronics Engg.)
Comments