Introduction: BLINKING AN LED USIND ARDUINO
This is the most basic tutorial for the famous open source development board named ARDUINO
RASPBERRY PI tutorials are on the way,please wait.
Step 1: COMPONENTS REQUIRED
1.LED(any color,iam using onboard led in digital pin 13)
2.ARDUINO WITH USB CABLE
3.JUMPER WIRES
4.BREADBOARD
Step 2: WIRING THE COMPONENTS
Wire the components as shown in diagram and next step is how the code works.
1.The long leg of led is positive pin and short leg is negative pin or ground pin
2.connect the long led to digital pin 13
3.connect the short leg to any ground in the arduino board.(on board it will be named GND)
Step 3: CODING USING ARDUINO IDE
You can download the new ARDUINO IDE from the official website,this is an integrated development environment and easy to use programming tool,this is used to code all the arduino develoment boards.In next step I will show you how exactly the code works
1.Open arduino ide
2.click file-new
3.type the following code
4.void setup() {
pinMode(13, OUTPUT); }
void loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000); }
5.Make sure you have selected the correct port and board,you can verify this by checking in Tools options situated in the top of the IDE.
Step 4: WORKING OF THE CODE
void setup()-runs when you power the board or press reset
void loop()-runs over and over.
pinMode(13, OUTPUT);-configure the arduino pin 13 to be an output pin.
digitalWrite(13, HIGH);-set the logic level of pin to be high (5V)
digitalWrite(13, LOW);-set the logic level of pin to be low (0V)
delay(1000);-wait for a second(1000=1second)
Step 5: CONCLUSION
Congratulations for successfully completing the tutorial you can modify this code to work with more than one led and even create a pattern of lights ,feel free to try out different things using this board and dont forget to watch my other instructables too.
4 Comments
5 years ago
Great intro to Arduino tutorial. You might add some note about the voltage of the LED. Most LEDs are designed to run on 3 volts and the Arduino outputs 5 volts by default. So you either need an LED that is rated for 5 volts, or you need to add a series resistor of about 100 ohms to keep it from burning out prematurely.
Reply 5 years ago
Yes you are obviously right.The led I am using is an 5v volt rated and I will take utmost care in giving the right information.
Reply 5 years ago
Even with a 5v LED and a 5v output, it's still good practice to add a current limiting resistor, even if just a few ohms. You would be surprised at the current that can flow from just a small tolerance in voltage.
Reply 5 years ago
Yes it is a good practice and a safer one,appreciate it