Skip to content Skip to sidebar Skip to footer

How to Turn On Off LED Using Serial Monitor

Control A LED From Serial Monitor

How to Turn On LED With Serial Monitor - Arduino Uno has several advantages, one of which is that we can communicate using a serial monitor. 

This time we will learn to use the Arduino Serial Monitor to give orders to Arduino to turn on an LED and currently we don't need an External LED but we use the internal LED on the Arduino. This LED is connected to pin 13. 

Please enter the following code and upload it to your Arduino.

Code Program :

int led = 13;
char  i;

void setup() {
  pinMode(led, OUTPUT);

void loop() {
  if (Serial.available() > 0) {
    i =;

    if (i == '1') {
      digitalWrite(led, HIGH);

    else if (i == '0'){
      digitalWrite(led, LOW);

Now, open the serial monitor, type the number 1 then send. Then type the number 0 and send.

You can see the difference.

Video :

Post a Comment for "How to Turn On Off LED Using Serial Monitor"