Basic Arduino Programming (LED Blink)

 What is Arduino

  • Arduino is an open source electronic platform which is easy to use in case of hardware and software.
  • Arduino boards are able to read inputs in the form of a program/code to interact with respective connected devices.

Single LED Blink Circuit

Hardware Required
  1. Breadboard
  2. Arduino board
  3. Jumper wires
  4. LED
  5. 220ohm resistor
  6. Arduino code transfer cable

Connections
  1. Connect the LED to the breadboard
  2. Further, connect one terminal of the resistor to the LED and another terminal of the resistor is connected anywhere on the breadboard.
  3. Connect one terminal of the male to male jumper wire to GND (ground) and another to the second terminal of the resistor.
  4. For the second jumper wire, one terminal is connected to the 13th digital pin and the second terminal of the jumper wire to the negative terminal of the LED.





CODING/PROGRAMMING THE ARDUINO
  • In this circuit, we have only 1 LED and we want it to blink, hence the code will be as follows :



WORKING PRINCIPLE
  • Here, we want the LED to blink with a time interval of 1 second, that is 1000 milliseconds. Hence in the code we have mentioned that the loop should be constant and the LED should blink after every second in a loop.



LED off


 LED on




TRIPLE LED BLINK CIRCUIT


Hardware Required

  1. Breadboard
  2. Arduino board
  3. Jumper wires
  4. LED RED
  5. LED YELLOW
  6. LED GREEN
  7. 100ohm resistor
  8. Arduino code transfer cable
Connections
  1. Connect the LED to the breadboard.
  2. Connect one terminal of the 100 ohm resistor to the positive terminal of the LED and another anywhere on the breadboard.
  3. Similarly, other two LEDs, yellow and green are connected in the same pattern.
  4. Further, connect one terminal of the male to male jumper wire to GND and another terminal to the negative column of the power rail.
  5. Further, one terminal of  a jumper wire is connected to the 8th digital pin of the Arduino board and another terminal is connected to the second terminal of the 100 ohm resistor.
  6. Taking another jumper , one end of it is connected to the 12th digital pin and the other end is connected to the second terminal of the second 100 ohm resistor and similarly the third jumper wire is connected to the 13th digital pin and its other end is connected to the second terminal of the 100 ohm resistor
  7. Three more jumper wires are connected. The first terminal of the first jumper wire is connected on the negative column if the power rail and another terminal is connected to the negative terminal of the LED. Other two jumper wires are also connected in the same nature.



CODING/PROGRAMMING THE ARDUINO
  • In this circuit , we have 3 LEDs. We want those 3 LEDs to blink one after the other within a time interval of 1000 milliseconds, that is 1 second.
  • To achieve this, the code is as following,

WORKING PRINCIPLE
  • Here, we want the LED to blink with a time interval of 1 second, that is 1000 milliseconds. Hence in the code we have mentioned that the loop should be constant and the LED should blink after every second in a loop.
  • This should repeat for all the three different coloured LEDs.








Comments

Popular Posts