Objective
To control an LED using serial communication between a microcontroller (such as Arduino) and
a computer, allowing the user to turn the LED on or off by sending commands through a serial
monitor.
Hardware Setup
Two Arduino UNOs One 5mm LED
Connecting Wires Breadboard
Step 1
Connect virtual pin Tx of first Arduino (Master) board with pin Rx of second Arduino (Slave)
board. Then, connect virtual pin Rx of first Arduino (Master) board with pin Tx of second
Arduino (Slave) board. We will use Software Serial to configure pin 10 as RX and pin 11 as TX.
Step2
Anode pin of LED is connected with digital pin 2 (Slave) and connects to breadboard. Then, the
cathode pin is grounded and also make sure both Arduino boards have their grounds in
common.
Step 3
Create the program Arduino Master and Slave.
Step 4
Transfer the program to Arduino and the LED will turn on and turn off.