IOT 6
IOT 6
6
AIM : IoT based home Automation using Arduino.
HARDWARE REQUIRED :
Key Features:
PROCEDURE :
22EEAEC024 Submitted By :- Kunal Singh Chauhan
Step 1:- Build the circuit.
// Define pins
#define CLAP_BUTTON_PIN 11 // Pin connected to the push button
(clap simulation)
#define VOICE_LIGHT_ON_PIN 9 // Pin connected to Button1 (simulates
"light on" voice command)
#define VOICE_LIGHT_OFF_PIN 6 // Pin connected to Button2 (simulates
"light off" voice command)
#define VOICE_FAN_ON_PIN 5 // Pin connected to Button3 (simulates
"fan on" voice command)
#define VOICE_FAN_OFF_PIN 3 // Pin connected to Button4 (simulates
"fan off" voice command)
#define LED_PIN 2 // Pin connected to the LED (light)
#define RELAY_PIN 12 // Pin connected to the relay (fan)
void setup() {
pinMode(CLAP_BUTTON_PIN, INPUT_PULLUP);
pinMode(VOICE_LIGHT_ON_PIN, INPUT_PULLUP);
pinMode(VOICE_LIGHT_OFF_PIN, INPUT_PULLUP);
pinMode(VOICE_FAN_ON_PIN, INPUT_PULLUP);
pinMode(VOICE_FAN_OFF_PIN, INPUT_PULLUP);
pinMode(LED_PIN, OUTPUT);
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);
digitalWrite(RELAY_PIN, HIGH);
Serial.begin(9600); }
void loop() {
const int buttonPins[] = {CLAP_BUTTON_PIN, VOICE_LIGHT_ON_PIN,
VOICE_LIGHT_OFF_PIN, VOICE_FAN_ON_PIN, VOICE_FAN_OFF_PIN};