Arduino tutorial 2- LED Blink program with code explained | How to blink an LED using Arduino |

Поделиться
HTML-код
  • Опубликовано: 26 авг 2024
  • Part - 2
    * Input /Output Devices
    * Analog /Digital Devices
    * Explanation of digitalWrite()
    * How to blink a LED
    Code & Circuit :
    drive.google.c...
    Learn Arduino programming even without components (Online Arduino Simulator) :
    Tutorial video - • How to learn Arduino u...
    Part-3 (Push button) : • Push Button and LED wi...
    Product Links:
    Arduino Uno : www.flyrobo.in...
    OR
    amzn.to/46vgG9z
    LED bulbs : www.flyrobo.in...
    OR
    amzn.to/3Pz0vOE
    -*-*-*-*-*-*-*-*-*-*
    Follow us on Instagram :
    / tech_at_home
    Like us on Facebook :
    / tech-at-home-220885266...
    #ArduinoTutorials#LEDblink#techathome
    Thanks for watching!
    *Like Share and Subscribe

Комментарии • 265

  • @user-hh7vc1vv7c
    @user-hh7vc1vv7c 10 месяцев назад +6

    Very good video. I showed this video to my class and instantly they became newton.

    • @techathome
      @techathome  10 месяцев назад

      Thank you ❤️ 😂

  • @elricbell4662
    @elricbell4662 2 года назад +15

    Thanks very much for this. As a complete newcomer to Arduino I have been able to write and edit my first simple sketch and actually understand what all the commands mean. Well done for such a well-planned tutorial.

  • @kripathankachan1782
    @kripathankachan1782 3 года назад +25

    My led is blinking ☺️☺️👍

  • @manupriya5537
    @manupriya5537 2 месяца назад

    bro i am totally fresher to this concept in my clg they are giving placement training regarding IOT , but i could not understand anything today after seeing ur vd i felt happy thank u so much pls continue do more vds

    • @techathome
      @techathome  Месяц назад

      Thanks for the feedback♥☺
      All the best!!!

  • @misamiamya
    @misamiamya 5 месяцев назад +3

    thank you for the code explanation! very helpful!

  • @theGday
    @theGday Год назад +2

    great video bro I am from software background but i always have a question about these things that how it work now i understood

  • @NezukoKamado-ru2uc
    @NezukoKamado-ru2uc 2 года назад +5

    Tysm! this helped me a lot when I was required to do this project

  • @nisarggaming802
    @nisarggaming802 2 месяца назад +1

    sir in my case there is some error in uploding infact I use same code and do all as you done but my port shows two port com1& com3 .I chose both but both led to error

    • @techathome
      @techathome  2 месяца назад

      What is the error.
      You can check your com port in device manager.

  • @5084204
    @5084204 Год назад +1

    /* A simple program to sequentially turn on and turn off 5 LEDs */
    int LED1 = 13;
    int LED2 = 12;
    int LED3 = 11;
    int LED4 = 10;
    int LED5 = 9;
    void setup() {
    pinMode(LED1, OUTPUT);
    pinMode(LED2, OUTPUT);
    pinMode(LED3, OUTPUT);
    pinMode(LED4, OUTPUT);
    pinMode(LED5, OUTPUT);
    }
    void loop() {
    digitalWrite(LED1, HIGH); // turn on LED1
    delay(200); // wait for 200ms
    digitalWrite(LED2, HIGH); // turn on LED2
    delay(200); // wait for 200ms
    digitalWrite(LED3, HIGH); // turn on LED3
    delay(200); // wait for 200ms
    digitalWrite(LED4, HIGH); // turn on LED4
    delay(200); // wait for 200ms
    digitalWrite(LED5, HIGH); // turn on LED5
    delay(200); // wait for 200ms
    digitalWrite(LED1, LOW); // turn off LED1
    delay(300); // wait for 300ms
    digitalWrite(LED2, LOW); // turn off LED2
    delay(300); // wait for 300ms
    digitalWrite(LED3, LOW); // turn off LED3
    delay(300); // wait for 300ms
    digitalWrite(LED4, LOW); // turn off LED4
    delay(300); // wait for 300ms
    digitalWrite(LED5, LOW); // turn off LED5
    delay(300); // wait for 300ms and start again
    }
    // This code is just cleaner.

  • @tusharthakker7777
    @tusharthakker7777 2 года назад +4

    Very nicely and clearly explained

  • @ajithkprabhakar1
    @ajithkprabhakar1 Год назад +1

    Hi,
    As a newcomer, your video is very useful to me and interesting. I would like to know how to set up 4 LED's

    • @techathome
      @techathome  Год назад

      Thank you
      Similarly declare leds to different digital pins
      Set the pinmode for all pins.
      Use digitalwrite for different pins seperately

    • @srirammahapatra448
      @srirammahapatra448 Год назад

      ​@@techathome tell the pin number 's which pins are to be use

    • @techathome
      @techathome  Год назад

      You can use any digital pins from 0 to 13

  • @tanusrisantra7111
    @tanusrisantra7111 2 года назад +1

    Tnx u so much....I am a beginner...I can comfortably understand everything of aurdino...but it's not clear that can we make connections in every pin or only pin 7??

    • @techathome
      @techathome  2 года назад +2

      You can connect to any digital pin

    • @TechknowledgeHome
      @TechknowledgeHome 2 года назад

      You can use any digital pin as well as analog pins. Analog pins are more powerful pins than digital pins.

  • @durgasaiharshithalanki4111
    @durgasaiharshithalanki4111 2 месяца назад

    Nice explanation sir😊 awesome 👍

  • @werideclub
    @werideclub Год назад +1

    (very new to Arduino)Starting from my requirement
    I need to turn on a water motor(5v) for about 2 mins after every 12 hours, basically trying to automate water pump for home garden pots when I am travelling.
    I feel above code will perfectly work just I need to tweak delay time, is there anything else I should consider ? any other way to do it?
    also can I use Arduino Nano instead of UNO? or Uno is better?(as I said new to this)

    • @werideclub
      @werideclub Год назад

      BTW this doesn't work any more
      Product Links:
      Arduino Uno : amzn.to/3IGPadf

  • @AboywithOCD
    @AboywithOCD 29 дней назад

    If I pass in my exams because of this I will give you a chocolate

    • @techathome
      @techathome  28 дней назад

      Soon I will be receiving a chocolate then😶

    • @AboywithOCD
      @AboywithOCD 28 дней назад

      @@techathome Hopes for the best 😊

  • @ahmedal-kharusi9053
    @ahmedal-kharusi9053 Год назад +1

    Hello nice video , why you didnt do a resistor for the led so it will not burn with 5v ?

    • @techathome
      @techathome  Год назад +2

      As I have read , pin 13 has inbuilt resistor.
      But it is always better to use current limiting resistor.
      May be it will burn, if it is ON for long time without resistor.

  • @anematrix521
    @anematrix521 Год назад

    im so happy i made my first led lit
    i only have 1 question when do i need resistors?

    • @techathome
      @techathome  Год назад +1

      Nice!!
      According to what I read, pin 13 has inbuilt resistor.
      If using any other pins, It's better to use a resistor always.

    • @anematrix521
      @anematrix521 Год назад

      @@techathome thank you so much

  • @techeducation1463
    @techeducation1463 2 года назад +1

    how can we change duration of time ?

    • @techathome
      @techathome  2 года назад

      Change the value inside delay function

  • @mukullanje5007
    @mukullanje5007 Год назад

    Sir you said : longer leg= anode(+) and positive connected to digital pin and ;shorter leg = cathode (-) which is connected to ground but in this video you connected vice versa

    • @techathome
      @techathome  Год назад

      No, I have connected Longer one(+ve) to digital pin only, and shorter one to GND.

  • @EdTechPraveen
    @EdTechPraveen 8 месяцев назад

    Bro my transmission light blinking automatically please help me

  • @Arun_1008
    @Arun_1008 3 года назад +3

    Hello 😊, Please provide All Equipment link for buy it and also Code

    • @techathome
      @techathome  Год назад

      Everything is in description

  • @AbhishekAbhishekp.s
    @AbhishekAbhishekp.s 9 дней назад

    Its working wow

  • @annuchaudhary164
    @annuchaudhary164 2 года назад +1

    thank you

  • @DTalesJourney
    @DTalesJourney Год назад

    Sir mujhe har 30 seconds ke bad blinking led chahiye 5 seconds le liye...
    Plzzz help me with the code

  • @user-dl5wf8sm9d
    @user-dl5wf8sm9d 6 месяцев назад

    Meeru output ni big letters rasaru kada enduku smalls enduku tesukovatledu
    Elaaa code Ki related videos Chestara plz its helpful to all why we write the code like this .

  • @aasirawez3722
    @aasirawez3722 Год назад

    If more LEDs are to be blinked then because I want to make a project which has maths shape like arrow, circle, triangle

  • @hansikawijerathne5507
    @hansikawijerathne5507 Год назад

    Thank you very much💗 this is very important👍

  • @RAMKUMAR-eb1kq
    @RAMKUMAR-eb1kq 3 месяца назад

    what is the wire name connected from aurdino to the system

  • @ItachiUchiha-qe5py
    @ItachiUchiha-qe5py 5 месяцев назад

    Is there any specific side of jumper wire(positive or negative)?

  • @sumalatha24
    @sumalatha24 Год назад

    Sir I have installed arduino in Ubuntu 20.04 my port is like /dev/ttyS4
    My output is showing like programmer is not responding.
    One more doubt as u said use digital pin for led connection if I connect 7 and running example blink program it's blinking. But when Iam using pin 4 led is not blinking

    • @techathome
      @techathome  Год назад

      Regarding 1st question, I have not used Ubuntu OS anytime, so no idea how it shows for Port.
      If you are connecting LED to different pin, you also have to edit the pin number in the code.

  • @poojasureka1760
    @poojasureka1760 Год назад

    Why have you connected led 1 to 7 can it be connected to any other number in the digital section

    • @techathome
      @techathome  Год назад

      Yes you can connect to any of the digital pins,
      But declare correctly in the code.

  • @bhubaneswarchandrasekharpu9349
    @bhubaneswarchandrasekharpu9349 2 года назад

    THANKS A LOT FOR UR NICE DESCRIBTION

  • @rohanshiragaonkar917
    @rohanshiragaonkar917 Месяц назад

    Thank u sir

  • @SathishYeripogu
    @SathishYeripogu 2 года назад

    Fabulous explanation

  • @WebDepthMviewsyearsago
    @WebDepthMviewsyearsago 3 года назад +5

    #define LED 13
    void setup()
    {
    pinMode(LED, OUTPUT);
    }
    void loop()
    {
    digitalWrite(LED, HIGH);
    delay(1000);
    digitalWrite (LED, LOW);
    delay (1000);
    }

    • @ananyarajansvlogs9651
      @ananyarajansvlogs9651 Год назад

      not working , my port is not selecting

    • @techathome
      @techathome  Год назад

      Which type of Arduino are u using, Ch340 smd chip or the Dip IC one?

  • @vsbrosis957
    @vsbrosis957 2 года назад +1

    very informative

  • @dakshataramteke1838
    @dakshataramteke1838 10 месяцев назад

    Which jumper wire is using male to male, male to female , female to female please tell me

  • @guliyevshahriyar
    @guliyevshahriyar Год назад

    Thank you for helping.

  • @readytoboot
    @readytoboot Год назад

    Keep going. 💪🏻💪🏻💪🏻💪🏻

  • @aryanraj-br5np
    @aryanraj-br5np 2 года назад

    Sir we know that an LED will fuse if we use 5v dc. Here in the code we are not setting up the voltage to 3.5v approx. which is normal voltage for led. So how the Arduino automatically giving correct voltage for led. Plz tell.

    • @Slimey3DPrinting
      @Slimey3DPrinting 2 года назад

      it will always gives 5v dc, so use a current limiting resistor

  • @Dishank25S
    @Dishank25S Год назад

    Great video 🔥

  • @user-vz2rh3nb5i
    @user-vz2rh3nb5i 10 месяцев назад

    thank you so much it helped ,me a lot 😚😚😚🙄🙄

  • @MuhandisTv
    @MuhandisTv 4 года назад

    Good job 👍👏👌👌

  • @AnjumFAffu
    @AnjumFAffu Год назад

    Hey..How to fix the error occured while uploading the sketch

    • @techathome
      @techathome  Год назад

      Check if the proper board is selected along with COM port in Tools

  • @indianarduinoprojects8753
    @indianarduinoprojects8753 2 года назад +1

    My led on my arduino uno board is not blinking on pressing the reset button and code is not uploading to it can you please help me 🙏🙏

  • @govindkatyura7485
    @govindkatyura7485 2 года назад

    What's the use of resistor? I don't know why and where to use them

    • @techathome
      @techathome  2 года назад

      That is used as current limiting resistor
      Usually LED need very less current, if you don't use resistor, LED can burn after using for more time .
      But I have heard pin 13 has inbuilt resistor.
      U can use with LED, if you are connecting to any other pin except 13.

  • @Officialnoob_-999
    @Officialnoob_-999 7 месяцев назад +1

    My led is not blinking 😢😢😢

    • @techathome
      @techathome  7 месяцев назад

      Check the connections.

  • @nileshnakade7470
    @nileshnakade7470 Год назад

    Sir, would you plz make video on lcd, ph and waterlevel sensor

    • @techathome
      @techathome  Год назад

      LCD part 1 : ruclips.net/video/fyL1h62QHJs/видео.html
      LCD part 2 : ruclips.net/video/LyuybcoNEsw/видео.html
      Other sensor, will make soon

  • @manpreetnooraulakh2846
    @manpreetnooraulakh2846 Год назад

    Can you share the code , the link that you given it is not opening

    • @techathome
      @techathome  Год назад

      Can u send request on mail, I will share the file.

  • @coolscholars4451
    @coolscholars4451 5 месяцев назад

    can't set com-state for "\\.\COM24 ??

    • @techathome
      @techathome  5 месяцев назад

      Check com port in device manager and select the same in Arduino IDE

  • @gundewarsriguru4136
    @gundewarsriguru4136 2 года назад

    can i kow the process to blink two LEDS with same code and connections

    • @techathome
      @techathome  2 года назад

      Just connect one more LED to same digital pin

  • @mileshk2293
    @mileshk2293 3 года назад +1

    Nice helpful

  • @souravl6882
    @souravl6882 4 года назад

    Nice one deepak

  • @pvasu8264
    @pvasu8264 17 дней назад

    Why You didn't used Resistor

    • @techathome
      @techathome  13 дней назад

      For less time it's still ok.
      But it is safer to use a resistor.

  • @kangajankuganathan7457
    @kangajankuganathan7457 2 года назад +1

    Thank you :-)

  • @Eyshcoffee
    @Eyshcoffee 2 года назад

    Is it possible to make the LED stop blinking after blinking 10 times? And how?

    • @techathome
      @techathome  2 года назад

      Refer this [I have used built in led- pin 13]
      int x=1;
      void setup() {
      pinMode(LED_BUILTIN, OUTPUT);
      }
      void loop()
      {
      if(x==1)
      {
      for(int i=0;i

  • @nahomhabtamu870
    @nahomhabtamu870 2 года назад +1

    no it is working first not on 7 on 13

    • @techathome
      @techathome  2 года назад

      It will work on all digital pins, have you configured correctly in code?

  • @AliBaba-dc6zo
    @AliBaba-dc6zo Год назад

    can you make complete course on arduino coding and implementation

    • @techathome
      @techathome  Год назад +1

      I already have Arduino tutorials playlist : ruclips.net/p/PL4B0LEKY-jrT_fjOGkX_NZ52ZHZf8s9S-

  • @majaharali125
    @majaharali125 6 месяцев назад

    Bro, mera blinking program nahi run ho rahahe, mujhe thora help chahiye....

    • @techathome
      @techathome  6 месяцев назад

      What is the error?

  • @InformationEducation6
    @InformationEducation6 8 месяцев назад

    Sir Arduino code kese banaya ka ak video banaya

    • @techathome
      @techathome  7 месяцев назад

      I didn't understand your doubt, Code is explained in the same video.

  • @muniranorqoziyeva1301
    @muniranorqoziyeva1301 11 месяцев назад

    😊soo cool 🎉

  • @kevalhadiyal1458
    @kevalhadiyal1458 Год назад

    If I want to blink a LED for perticular voltage, so how I can do that?

    • @techathome
      @techathome  Год назад +1

      What are you using to give voltage input?

    • @kevalhadiyal1458
      @kevalhadiyal1458 Год назад

      I have One Uv-LED Want use for different voltages ( say, 6.5V , 7V, 7.5V) here I want to use it for different Power.

  • @knowledgeboard-fi2cs
    @knowledgeboard-fi2cs Год назад

    How i connect the Arduino to mobile

    • @techathome
      @techathome  Год назад

      There are few apps available on Play Store,
      Using that u can write code and upload from your phone using OTG cable.

  • @JoeEvansSound
    @JoeEvansSound Год назад +2

    Hi mate. thank you for this video and your hard work, it is a very good video adding extra information for us. thank you very much. :¬)

  • @Panchothefatcat
    @Panchothefatcat Год назад

    How do you change the color?

  • @ankithshetty2104
    @ankithshetty2104 Год назад

    HI SIR I would like to ask can we use this as a indicator .

  • @rajathkrishnarhathwar4334
    @rajathkrishnarhathwar4334 3 года назад

    In tinkercad, ground pin wire is not there. What to do?

    • @techathome
      @techathome  Год назад

      Refer this : ruclips.net/video/cBmYkaKy0do/видео.html

  • @usmanbeacon1769
    @usmanbeacon1769 3 года назад

    How can i give input from pc to Arduino for led on or off by command line?? Or any other method??

    • @techathome
      @techathome  Год назад

      Refer this : ruclips.net/video/uT8-HPMS1cU/видео.html
      Instead of bluetooth module , you can send value from serial monitor

  • @shenoyhariprasad
    @shenoyhariprasad Год назад

    Hello Sir, could you please provide me with the purchasing link for Arduino Uno from Amazon that you used in the tutorial? The link mentioned in the tutorial description is not opening.

    • @techathome
      @techathome  Год назад

      Arduino Uno: amzn.to/40qhiti

  • @Arun_1008
    @Arun_1008 3 года назад

    Can You provide me Report of this program...🙏

  • @jeetpandya4760
    @jeetpandya4760 Год назад

    How to blink blue led 5 times and stop it then blink red led 5 times

    • @techathome
      @techathome  Год назад

      Use For loop with count 5.
      Add blink logic inside for loop.
      Repeat same for next LED.

  • @yasithlalanjana1125
    @yasithlalanjana1125 2 года назад +1

    //RUclips|Tech at Home
    int led1=7;
    void setup()
    {
    //pinMode(pin,mode);
    pinMode(7,OUTPUT);
    }
    void loop()
    {
    digitalWrite(led1,HIGH);
    delay(200);
    digitalWrite(led1,LOW);
    delay(200);
    }

  • @agfilmsmarketing
    @agfilmsmarketing 10 месяцев назад

    I want to connect electromagnet,
    Turn ON and OFF
    Please guide me

    • @techathome
      @techathome  10 месяцев назад

      You have to use relay module. Refer this tutorial: ruclips.net/video/iy3nXFh__rg/видео.htmlsi=7FvMi5UPKguK-8IV
      In this only changes are,
      1. Instead of AC bulb, connect your electromagnet wires.
      2. Instead of AC power supply, connect DC voltage required for your electromagnet.

    • @agfilmsmarketing
      @agfilmsmarketing 10 месяцев назад

      @@techathome thank you
      Another thing
      I want to connect 8 electromagnets
      Turn on NC on start
      turn off randomly
      Once all are turned off wait for RESET button
      And do the process again
      Please help

  • @khushisingh9603
    @khushisingh9603 Год назад

    Hello sir and thank you

  • @NehaKumari-cs5qe
    @NehaKumari-cs5qe Год назад

    My led is not blinking I also do same but it's not blinking

    • @techathome
      @techathome  Год назад

      Can u verify the connections, Anode and cathode

  • @jayshhirekar159
    @jayshhirekar159 Год назад

    How can I stop blinking of LED

    • @techathome
      @techathome  Год назад

      You can keep the blink logic inside a for loop .
      for(int i=0; i

  • @deekshaprajapati8892
    @deekshaprajapati8892 Год назад

    Yes my led also blinking❤

  • @ahmedshaker7897
    @ahmedshaker7897 2 года назад

    if we removed arduino cable , will the led still blink ?

    • @techathome
      @techathome  2 года назад

      No,
      You have to give supply using battery (round pin connector)
      Or usb(power bank)

    • @ahmedshaker7897
      @ahmedshaker7897 2 года назад

      @@techathome ok thanks

  • @charanjitnarang7292
    @charanjitnarang7292 2 года назад

    How many led can be connected

    • @techathome
      @techathome  2 года назад

      There are 13 digital pins, you can use them

  • @srirammahapatra448
    @srirammahapatra448 Год назад

    Hy
    If i use pin no -6 or -5 that will be run ?

    • @techathome
      @techathome  Год назад +1

      Yes you can use,
      But declare the correct pin in the code as well

    • @srirammahapatra448
      @srirammahapatra448 Год назад +1

      thanks you so much for your response
      @@techathome

  • @lukasnevidzan5523
    @lukasnevidzan5523 2 года назад

    LED hat not resistor ????

    • @techathome
      @techathome  2 года назад

      Arduino pin 13 already has register inside

  • @prithvisatarkar4178
    @prithvisatarkar4178 2 года назад

    Hello sir, I have facing problem while uploading the code, it shows byte error

  • @ruhulwara
    @ruhulwara Год назад

    Thank you dada

  • @MrExcel1986
    @MrExcel1986 2 месяца назад

    my my led is not blinking

  • @zakawaka3752
    @zakawaka3752 2 года назад

    And how to make it for slowly turning on and off

  • @inventortech-mp6eh
    @inventortech-mp6eh Год назад

    thanks

  • @vijayakumari-kc8mj
    @vijayakumari-kc8mj Год назад

    I want Circuit diagram on led blink

  • @enriquedb666
    @enriquedb666 10 месяцев назад

    THANKSSS

  • @biopoweruk
    @biopoweruk Год назад

    no resistor to protect the LED?

    • @aatrox5559
      @aatrox5559 Год назад

      That is used as current limiting resistor
      Usually LED need very less current, if you don't use resistor, LED can burn after using for more time .
      But I have heard pin 13 has inbuilt resistor.
      U can use with LED, if you are connecting to any other pin except 13. here you go sir

    • @techathome
      @techathome  Год назад

      Yes , even i have come across the same on internet
      Pin13 has inbuilt resistor

  • @nimeshkumavat4784
    @nimeshkumavat4784 4 месяца назад

    Where is part 1 ?

    • @techathome
      @techathome  4 месяца назад

      Complete playlist: ruclips.net/p/PL4B0LEKY-jrT_fjOGkX_NZ52ZHZf8s9S-&si=nfOqvqjlkUnmWSpW

  • @ashinthtnyt2179
    @ashinthtnyt2179 2 года назад

    Similar to java ???

  • @technodarsh5721
    @technodarsh5721 3 года назад +1

    Can I call you? I need help!

  • @sriashwinv1829
    @sriashwinv1829 8 месяцев назад

    My LED is blinking

  • @syedsharukh8265
    @syedsharukh8265 Год назад

    Was the language c++

    • @techathome
      @techathome  Год назад

      Basics of C with some Arduino specific functions

  • @alirezafazeli231
    @alirezafazeli231 2 года назад

    good video

  • @devipriyaSudalaikan
    @devipriyaSudalaikan Год назад

    Tqqq💜💜💜💜

  • @Saizzzo
    @Saizzzo 9 месяцев назад

    Prepare diwali light with Arduino

    • @techathome
      @techathome  9 месяцев назад

      ruclips.net/video/HCQWPmSDqco/видео.htmlsi=GC-dnIPxvUbPzzbG

  • @gayathrinaidumiriyala7262
    @gayathrinaidumiriyala7262 4 года назад

    same way done.but led not blinking ,may i know the reason

    • @techathome
      @techathome  4 года назад

      Reverse the terminal of LED and check once. Even then if it is not working, connect to any other digital pin.

    • @gayathrinaidumiriyala7262
      @gayathrinaidumiriyala7262 4 года назад

      @@techathome all changes made but no result

    • @techathome
      @techathome  4 года назад

      @@gayathrinaidumiriyala7262 can you please send me the code.
      Mail here : deepakhd20@gmail.com

    • @gayathrinaidumiriyala7262
      @gayathrinaidumiriyala7262 4 года назад

      @@techathome done

    • @techathome
      @techathome  4 года назад

      @@gayathrinaidumiriyala7262 in the digitalwrite () , instead of led change it to 7 in both lines.

  • @Migwiwamwangi
    @Migwiwamwangi 2 года назад

    awesome

  • @MMM-jr7zg
    @MMM-jr7zg Год назад

    So good.