A Simple Arduino LED Example in Proteus

You can download, all the simulation files and codes for Arduino LED examples used in this tutorial, by clicking the below button:

Hello friends, I hope all are fine and having fun with your projects. We have covered enough Arduino commands in this Arduino Tutorial for Beginners series and now we are ready to create a simple project by interfacing an LED (Light Emitting Diode) . Today, I am going to share a very Simple Arduino LED Example in Proteus ISIS. First I will blink single LED using Arduino UNO and then I will blink multiple LEDs in Proteus .When you start working on Arduino then Arduino LED example is the first example which you must try because its the easiest one. Moreover, we all know that we have a small LED connected to pin # 13 on each Arduino so you can also check your Arduino as well that whether its working or not. So, let's get started with Simple Arduino LED Example in Proteus ISIS:

[dt_button link="https://www.theengineeringprojects.com/ArduinoProjects/A Simple Arduino LED Example in Proteus.rar" target_blank="false" button_alignment="default" animation="fadeIn" size="medium" style="default" bg_color_style="default" bg_hover_color_style="default" text_color_style="default" text_hover_color_style="default" icon="fa fa-chevron-circle-right" icon_align="left"]Download Simulation Files[/dt_button]

First of all, design a simple circuit of Arduino LED in Proteus ISIS as shown in below figure:

Now as you can see in the above figure that I have used an LED on Pin # 13 of Arduino UNO.

So, now upload the below sketch in your Arduino, its the Blink Example from Arduino, which works perfect for this Arduino LED Example:

void setup() { pinMode(13, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }

The above code is quite simple and you can see first we have used the pinMode Arduino Command to make the LED pin Output.

After that, we have used Arduino digitalWrite Command to blink the LED.

Now get the hex file from Arduino software and add it in your Proteus Arduino board.

Once the hex file is uploaded in the Arduino then run your Arduino LED Proteus Simulation and if everything goes fine then your LED will start blinking as shown in below figure:

Now you can see in the above figure that our LED at Pin # 13 started blinking.

If you read the above code of Arduino LED exmaple then its quite simple, first of all I just make the Pin # 13 output and then I have made it HIGH and LOW with a delay of 1000 msec.

You might wanna read How to use digitalRead in Arduino that will give you a better idea of How to deal with any digital pin.

So, now let's add more LEDs on other digital Pins of Arduino.

So, design a simulation as shown in the below figure:

Now compile the below code in your Arduino software and Get your Arduino Hex file:

int Led1 = 13; int Led2 = 12; int Led3 = 11; int Led4 = 10; int Led5 = 9; int Led6 = 8; int Led7 = 7; int Led8 = 6; int Led9 = 5; int Leda = 4; int Ledb = 3; int Ledc = 2; void setup() { pinMode(Led1, OUTPUT); pinMode(Led2, OUTPUT); pinMode(Led3, OUTPUT); pinMode(Led4, OUTPUT); pinMode(Led5, OUTPUT); pinMode(Led6, OUTPUT); pinMode(Led7, OUTPUT); pinMode(Led8, OUTPUT); pinMode(Led9, OUTPUT); pinMode(Leda, OUTPUT); pinMode(Ledb, OUTPUT); pinMode(Ledc, OUTPUT); } void loop() { digitalWrite(Led1, HIGH); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, HIGH); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, HIGH); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, HIGH); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, HIGH); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, HIGH); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, HIGH); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, HIGH); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, HIGH); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, HIGH); digitalWrite(Ledb, LOW); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, HIGH); digitalWrite(Ledc, LOW); delay(1000); digitalWrite(Led1, LOW); digitalWrite(Led2, LOW); digitalWrite(Led3, LOW); digitalWrite(Led4, LOW); digitalWrite(Led5, LOW); digitalWrite(Led6, LOW); digitalWrite(Led7, LOW); digitalWrite(Led8, LOW); digitalWrite(Led9, LOW); digitalWrite(Leda, LOW); digitalWrite(Ledb, LOW); digitalWrite(Ledc, HIGH); delay(1000); }

Upload this hex file in your Proteus Arduino and then run your simulation.

If everything goes fine then you will get all your LEDs blinking.

I have shown a glimpse of its working in below figure:

So, download the files and run your simulation and test it out.

If you check the code then it seems quite lengthy but its very simple.

I am just keeping one LED on and others OFF.

Now, let me tell you one thing, this is not the best way of coding but for starters you should first try it out.

In the coming lecture, I will teach you How to write Arduino Code Efficiently like I don't wanna add 100 lines just for such small work.

So, that's all for today. I hope you have enjoyed today's Arduino LED Example and are gonna test it. So, see you in next tutorial. Take care !!! :)