Turn AC bulb ON and OFF using hand clap, audio or sound Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 มิ.ย. 2024
  • In this video you will learn and get code for Arduino on how to control AC bulb with relay and sound sensor.
    Two example is with code and demonstration is shown :
    1- Basic example where only Digital pin of the sensor is used to control light with Arduino
    2- Advanced example where analog output of the sound sensor is used to get audio level and control under different noise and sound condition.
    *** Purchase Sound Sensor from **
    AliExpress: s.click.aliexpress.com/e/_A6c0CG
    Amazon USA: amzn.to/3fYAyc5
    Amazon Canada: amzn.to/3xGpoP9
    All other Amazon: amzn.to/3m3aFLY
    Download the code for this video: robojax.com/L/?id=278
    Jump to different chapters of this video:
    00:00 Introduction
    01:51 Hardware Explained
    04:22 Connecting AC bulb
    05:17 Wiring Explained
    05:57 Basic project demonstration (using digital pin)
    06:28 Basic Arduino Code Explained
    10:00 Using Analog pin with audio level control
    10:38 Advanced mode
    12:51 Advanced Arduino Code explained
    Tutorial by Ahmad Shamshiri form Canada
    ****************************
    Arduino Step by Step Course (over 150 lectures) Starts here • Lesson 00 What is Ardu...
    ****************************
    If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link paypal.me/robojaxTV
    Follow me on Facebook robojaxTV
    Follow me on Twitter: / robojaxtv
    Follow me on Instagram: / robojax
    Tutorial by Robojax.com
    Get other projects code and learn Arduino
    robojax.com/learn/arduino
    *** AFFILIATE PROGRAM ***
    We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
    #robojax #robojax_sound #robojaxArduinoCourse
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 71

  • @roboticslab8485
    @roboticslab8485 3 ปีที่แล้ว +3

    Your tutorials are so so so good and very much useful. I learned arduino totally from your video sir! Thank you so much for these useful tutorials.

    • @robojax
      @robojax  3 ปีที่แล้ว

      Great to hear! Thank you.

  • @5621346
    @5621346 3 ปีที่แล้ว +3

    great project sir! i enjoyed a lot the tutorial!

    • @robojax
      @robojax  3 ปีที่แล้ว

      Awesome, thank you!

  • @nathansakatengo3364
    @nathansakatengo3364 2 ปีที่แล้ว +1

    this is so helpful

  • @khaldsalhi5953
    @khaldsalhi5953 ปีที่แล้ว

    Thank u 😍😍😍👏👏👏👏👍

  • @maheshtharaka6443
    @maheshtharaka6443 ปีที่แล้ว

    awsome brother wow all the best

    • @robojax
      @robojax  ปีที่แล้ว

      Great. Here is the video with wiring th-cam.com/video/INq8A3dLNzM/w-d-xo.html

  • @ishaankelkar7521
    @ishaankelkar7521 2 ปีที่แล้ว +1

    Hello. Thank you so much for this tutorial. I have a few questions. If you could answer them that would be awesome. 1) Do you have like a circuit diagram to show where to connect the 3 pins into the arduino uno? 2) Can this sensor hear chords and sense them and write them in the analog output?
    And my main use case is this. I want to make it so that the sensor reads and hears a specific value, and the value is either true/false it should make something happen with led lights which I also have to connect to arduino pins. Which connections do I make for each type of thing ( sound sensor and individually addressable led lights )? Is it possible to use if-statement to do this? Thank you so much!

    • @robojax
      @robojax  2 ปีที่แล้ว

      Hello,
      1-I have explained the module pin by pin and then explained the wiring. you don't need diagram.
      2-I don't know what "chords" is. I have explained both analog and digital output with examples. for true or false use digital output.
      I suggest following my course ***** Free Arduino Course worth $200****
      Arduino Step by Step Course (over 100 lectures) Starts here robojax.com/L/?id=338

  • @RahulJain-rj6jw
    @RahulJain-rj6jw 5 ปีที่แล้ว

    Too good

  • @MdRana-jh7eh
    @MdRana-jh7eh 2 ปีที่แล้ว

    Nice

  • @MrJoe560
    @MrJoe560 2 ปีที่แล้ว +1

    Awesome project! Would it be possible to alter the code so the light is only on when sound is detected? I’m trying to make a lamp that requires continuous sound to stay on. It seems like it should be an easy change but I am very new to Arduino coding.

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      Hi, so you don't want it to toggle. if there is sound, keep the light ON, else OFF. the use this instead of loo();
      void loop() {
      // SOUND Sensor Code by Robojax.com 20180217
      val = digitalRead(SOUND);
      if(val == HIGH){
      Serial.println("Light ON");
      digitalWrite(relayPin, LOW);
      }else{
      Serial.println("Light OFF");
      digitalWrite(relayPin, HIGH);
      }
      // SOUND Sensor Code by Robojax.com 20180217
      delay(100);
      }

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      ***** Free Arduino Course worth $200****
      Arduino Step by Step Course (over 150 lectures) Starts here robojax.com/L/?id=338

    • @MrJoe560
      @MrJoe560 2 ปีที่แล้ว

      @@robojax thank you! I will try this out

  • @voiceoftruth1O1
    @voiceoftruth1O1 6 ปีที่แล้ว

    Thanks.

    • @robojax
      @robojax  6 ปีที่แล้ว

      You are welcome.

  • @samu-yx8zv
    @samu-yx8zv 3 ปีที่แล้ว

    Hey man awesome video, im trying to build this project myself and im a little new to this. I just have 1 question, you lost me a little at which pin of the sound sensor you used. Do we need digital output or analog output connected to pin 2? And what do we do with the other pin, just leave it?

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      Hello, you made me watch the video as I was surprised to be asked such questions which I try to near lave. Indeed I have explained. This video has two part and shows two code which in each code one of the pins used. I have added the timing in the description of this video(as I was watching it) so you can jump to different section of the video by clicking on the time or clicking on the player timeline. good luck.

    • @samu-yx8zv
      @samu-yx8zv 3 ปีที่แล้ว +1

      @@robojax thank you very much i have figured it out, however i cant seem to be able to download the code from your website. I have found the link within arduino code that is connected to this video (number 61, robojax.com/learn/arduino/?vid=robojax-sound-sensor-AC-Bulb) but i dont see a download code option.
      Nevermind, I just copied the exact code from the video. So far it doesnt work but maybe im just not reaching the threshold, about o adjust it now.

    • @robojax
      @robojax  3 ปีที่แล้ว +1

      you are welcome. I have changed the link in the description to robojax.com/L/?id=278 and it should be available.

  • @fmtpdx2359
    @fmtpdx2359 6 ปีที่แล้ว

    Hi Sir. do you have project of piezoelectric vibration energy harvesting for storage? hope you have such project. tq sir.

    • @robojax
      @robojax  6 ปีที่แล้ว

      Hi, no I have not. I haven't seen the cheap efficient material to make it practical yet.

  • @whencutchinta7580
    @whencutchinta7580 3 ปีที่แล้ว

    Avrdufe stk500 _ disable coming sir what I want to do

  • @ceba2
    @ceba2 8 หลายเดือนก่อน

    Thank you !
    Can I specify a specific sound, so that the sensor will recognize it and then turn it on and off according to the sound, such as the sound of a siren and so on...

    • @robojax
      @robojax  8 หลายเดือนก่อน

      No. This just detects the loudness of any sound .

    • @ceba2
      @ceba2 8 หลายเดือนก่อน

      @@robojax Thank you for replying!
      But do u know how I can do that? Does the light turn on at a certain sound?

    • @robojax
      @robojax  8 หลายเดือนก่อน

      Only by sound level. But look for speech recognition. There are solutions. I might make video on that in a 2 or 3 months

    • @ceba2
      @ceba2 8 หลายเดือนก่อน

      Thank u really
      I have a project coming soon in my studies and I have to do that point…
      Thank u soooooo much

  • @samarthjain7559
    @samarthjain7559 3 ปีที่แล้ว

    Can you tell how to make the same project without the hardware in proteus using .wav file of recorded claps?
    I am having issues in that.

    • @robojax
      @robojax  3 ปีที่แล้ว

      proteus is the most expensive software for PCB design. don't have it.

  • @elmeramban7395
    @elmeramban7395 ปีที่แล้ว

    did you plug it to power on the light? or it's just the laptop/pc that powers everything?

    • @robojax
      @robojax  ปีที่แล้ว

      Please watch and get the answer.

    • @elmeramban7395
      @elmeramban7395 ปีที่แล้ว

      You didn't mention anything in the video.

  • @armansoltani2658
    @armansoltani2658 2 ปีที่แล้ว

    Hello dear friend, I want to use this circuit for fan sound. Can it be used for fan sound? Turn on the light when the fan is on. Turn off the light when the fan is off. Thank you, thank you for answering Please answer me

    • @robojax
      @robojax  2 ปีที่แล้ว

      Hello, yes it can. we use relay and relay is a switch which can turn ON/OFF anything.

  • @Andrew045
    @Andrew045 2 ปีที่แล้ว +1

    One question: the D0 pin goes to pin 2, but A0 pin where goes?

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      Please watch the video fully

  • @bignerd8050
    @bignerd8050 2 ปีที่แล้ว

    Could you modify this to a servo operated light switch? i’ve been searching and searching and can’t find anything

    • @robojax
      @robojax  2 ปีที่แล้ว

      what do you mean by "servo operated light switch"? is the servo moving the light in lift-to-right if so, you don't need anything, just simple servo code which is part of Arduino and attach your light to servo.

  • @Ant_01013
    @Ant_01013 2 ปีที่แล้ว

    Hi I am new to Arduino, can I use an Arduino R3 CH340G for this project?

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      Hi, it is just Arduino. The rest of stuff you've written are extra. Here is my $200 course that is on Udemy, posted on TH-cam for free bit.ly/arduinoStepByStep

    • @Ant_01013
      @Ant_01013 2 ปีที่แล้ว

      @@robojax the light bulb won't turn off. any suggestions to fix this problem? (Also, thank you for the free lessons it really helped me on understand what I can do with an Arduino.)

  • @elmeramban7395
    @elmeramban7395 ปีที่แล้ว

    How would the wirings will be if my AC light has on/off switch?

    • @robojax
      @robojax  ปีที่แล้ว +1

      you will need one more three weay switch. the relay shown has already three pins and you just need a switch that has 3 pins. see details of controlling one light with two switches en.wikipedia.org/wiki/Multiway_switching

  • @nabmaj1417
    @nabmaj1417 3 ปีที่แล้ว

    Do i have to shout so sensor work or it can be more sensitive? Help me sir

    • @robojax
      @robojax  3 ปีที่แล้ว

      no. I've shown that you can set sensitivity.

    • @nabmaj1417
      @nabmaj1417 3 ปีที่แล้ว

      @@robojax i did change it, but it didnt change much ( still need to shout)?

    • @robojax
      @robojax  3 ปีที่แล้ว

      It should work, or get different sound module

    • @gameplayml4511
      @gameplayml4511 3 ปีที่แล้ว

      Its so amazing sir, i learned a lot
      Can i fo this project? Like in thesis i'm in 3rd year college now ,and i want this it gives me excited about this project

  • @khori3043
    @khori3043 2 ปีที่แล้ว

    I want to do something similar but instead of clapping to turn on the light, I want the light to turn on when a certain sound threshold is reached. For example, if I am talking in a normal tone the light will not flash on, but if I were to shout or scream the light will flash on. How would I go about achieving this?

    • @robojax
      @robojax  2 ปีที่แล้ว

      Hi, that is called speech recognition which need more advanced signal processing. So search for speech recognition.

    • @khori3043
      @khori3043 2 ปีที่แล้ว

      @@robojax hmm I don't think that is what im looking for exactly. I just want the light to activate when sound exceeds a certain threshold (not specifically talking). Then deactivate once that sound has stopped.

    • @robojax
      @robojax  2 ปีที่แล้ว

      this can just detects level of sound and if you try to create the same level of sound, then it will detect it . The problem is that many different sounds will have the same level or amplitude and that makes it to have false detect.

  • @DoluolaBalogunTemitopepe-sb6xz
    @DoluolaBalogunTemitopepe-sb6xz ปีที่แล้ว

    Can we use a normal torch or bulb and how

    • @robojax
      @robojax  ปีที่แล้ว

      I have tones of touch sensor videos. Just search my channel “touch robojax “

  • @John-id2ds
    @John-id2ds 3 ปีที่แล้ว +2

    I have only 3 pin sound sensor what can I do

    • @robojax
      @robojax  3 ปีที่แล้ว +2

      it is the same.so you have either Digital or analog. I've demonstrated both in video. Please watch and you will be able to use it. good luck.

    • @John-id2ds
      @John-id2ds 3 ปีที่แล้ว

      @@robojax only digital thanks

  • @christopherjamesjorolan2355
    @christopherjamesjorolan2355 5 ปีที่แล้ว

    Hi sir how to download its code?

    • @robojax
      @robojax  5 ปีที่แล้ว

      Hi, see this instruction snag.gy/EG4O2l.jpg

  • @dhirajbaniya5256
    @dhirajbaniya5256 ปีที่แล้ว

    Where we find it

    • @robojax
      @robojax  ปีที่แล้ว

      Link in description

  • @chyrinejamera3968
    @chyrinejamera3968 ปีที่แล้ว

    CAN YOU SHOW ME THE WIRING DIAGRAM PLEASE

    • @robojax
      @robojax  ปีที่แล้ว

      here is better version with wiring diagram which is part of my Arduino course th-cam.com/video/INq8A3dLNzM/w-d-xo.html

  • @user-oe1oq5mg2h
    @user-oe1oq5mg2h ปีที่แล้ว

    Sir pls send me the code for clap sensor

    • @robojax
      @robojax  11 หลายเดือนก่อน

      The link is under the video in description

  • @DOT307
    @DOT307 ปีที่แล้ว

    Did not expain wire connection properly and no circuit diagram

    • @robojax
      @robojax  ปีที่แล้ว

      Please watch updated video Lesson 15: Arduino Sound Sensor Module | Arduino Step By Step Course
      th-cam.com/video/INq8A3dLNzM/w-d-xo.html