Code for ARDUINO nano ⬇️⬇️
// Your program code goes here
const int buzzerPin = 12;
const int flamePin = 10;
int Flame = HIGH;
int redled = 8;
int greenled = 7;
void setup()
{
pinMode(buzzerPin, OUTPUT);
pinMode(redled, OUTPUT);
pinMode(greenled, OUTPUT);
pinMode(flamePin, INPUT);
Serial.begin(9600);
}
void loop()
{
Flame = digitalRead(flamePin);
if (Flame== HIGH)
{
digitalWrite(buzzerPin, HIGH);
digitalWrite(redled, HIGH);
digitalWrite(greenled, LOW);
}
else
{
digitalWrite(buzzerPin, LOW);
digitalWrite(greenled, HIGH);
digitalWrite(redled, LOW);
}
Materials required;
Bread board
Flame sensor
Arduino nano
Jumper cables
Buzzer
2 LEDs
Type B mini USB cable..........
.
.
.
.let's get started 🤩🤩🤩
Step by step explained with photos...!!👍
Positive terminal of buzzer (green wire ) to be connected to D12 on ARDUINO nano
🔝🔝🔝
Negative terminal of buzzer (yellow wire) to be connected to GND on ARDUINO nano
LED'S positive terminal (blue wire ) to be connected to D8 on Arduino nano
Second LED'S positive terminal(orange wire) to be connected to D7 on Arduino nano
LEDs negative terminal (both the LED's)(yellow wire) to be connected to GND on the Arduino nano
Sensor's output (brown wire) to be connected to D10 on the Arduino nano
Sensor's positive terminal (red wire) to be connected to 5V of ARDUINO nano
Sensor's negative terminal (black wire) to be connected to GND on the Arduino nano
.
.
.
.
.
.
We are done with the circuit and placing the components on bread board let's test and enjoy the video ......don't forget to subscribe,like and share 😀
No comments:
Post a Comment