Serial Communication Between an Arduino and the TL-MR3220 Router

Last time, I installed OpenWRT on the TL-MR3220 router and added a connector for it’s serial interface. Today, I wanted to try and connect this interface to an Arduino to make the two communicate. The router’s interface operates at 3.3V while the Arduino’s UART operates at 5V, so we need to convert between those levels. The cheapest way to do this that I could find is described here. It involves using a 74LS04 hex inverter chip to convert the 3.3V signal up to 5V and two resistors for a simple voltage divider to convert the 5V signal down to 3.3V.

The hardware setup and wiring is shown in the picture above. To test the connection, I uploaded a simple sketch to the Arduino that will let the pin 13 LED blink and that transmits the LED status over the serial interface:

static int count = 0;

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

void loop() {
  Serial.print("Turn #");

  digitalWrite(13, HIGH);
  Serial.println("LED ON");
  digitalWrite(13, LOW);
  Serial.println("LED OFF");

On the OpenWRT based router I first disabled the serial console by commenting it out in /etc/inittab. (Make sure that you have other ways ready to connect to the router like SSH before you do this!)

::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
# Disabled serial console.
#ttyS0::askfirst:/bin/ash --login

Then I installed screen as a terminal software using opkg and I was able to listen to the status reports sent by the arduino.

root@tplink:~# opkg update
root@tplink:~# opkg install screen
root@tplink:~# screen /dev/ttyS0 9600

3 thoughts on “Serial Communication Between an Arduino and the TL-MR3220 Router

  1. Pingback: Wifi Enabled RGB Matrix Wall Light, Part 1 |

  2. Very nice project, congratulations. Why haven’t used the mr3220 usb port to communicate with arduino?

  3. I was prototyping the connection for an Arduino compatible board called Rainbowduino which does not feature an USB port. Also, I wanted to save the router’s USB port for a flash drive.

Leave a Reply

Your email address will not be published. Required fields are marked *