Using Arduino as a bridge to connect serial devices with PC

I recently found an interesting use of the many Arduino boards that I have. You can use your Arduino board as a bridge to connect serial devices to the computer, without even writing a sketch. How cool is that? 😉

Before I tell you how you can do it, let me explain about virtual COM ports and how Arduino uses them.

Virtual COM ports

The ATmega328 microcontroller used in the Arduino board supports UART TTL (5V) serial communication. You can connect the microcontroller to the serial port in your computer (with appropriate logic level converters) and can interface with it.

But these days, most computers don’t have a serial port. So the Arduino team when they designed the board, placed another IC to channel this serial communication over USB. In pre-UNO boards this is handled by the FTDI FT232RL IC and in UNO it is handled by ATmega8U2 IC. In your computer, you will have to install corresponding drivers and the device will appear as the virtual COM port.

Holding the processor in RESET mode

The serial to USB(TTL) IC (either FTDI FT232RL or ATmega8U2) is connected to Arduino pins 0 and 1. If we hold the processor in RESET mode, then all its GPIO pins will me in tri-state, effectively removing it from the circuit and you can directly interface the serial to USB IC with your device.

To hold the processor in RESET mode, just connect the RESET pin (which is active-low) with the ground. This will hold the processor in RESET mode.

Interfacing the serial device

Now you can connect the serial device to the Arduino pins 0 and 1. You should however note that the Rx pin (pin 0) goes to the Rx of the device and Tx pin (pin 1) goes to the Tx of the device and not the other way around.

In your computer the device will appear as a Virtual COM port. You can connect to it using programs like screen or hyper terminal.

I didn’t had a serial device handy with me, so I used a another Arduino as a serial device to test this. I wrote a small sketch which was printing something in the Serial every few seconds and then when I opened the virtual COM port using screen, I was able to see its output.

This is a neat trick and might be useful if you have to interface some serial device like a GPS or a Bluetooth module with your computer.

Happy hacking 🙂

20 thoughts on “Using Arduino as a bridge to connect serial devices with PC

  1. Pingback: Use Arduino as an ISP programmer to program non-Arduino AVR microcontrollersHardware Fun | Hardware Fun

      1. Akshay Maharaj

        Hi.Sudar.

        Appreciate your article.

        Im currently trying to connect my atmega32 chip to hyperterminal using the arduino as a usb to ttl converter.Could you guide me as to how to go about doing this.

        Regards,
        Akshay Maharaj

        Reply
  2. Shankar

    Hi Sudar,

    I have a separate ATmega 16 MCU and an Arduino UNO. Can i run a program in my atmega16 and print the values, so that i can see them using arduino’s serial monitor.

    Thanks in advance 🙂

    Reply
      1. Shankar

        If the Atmega 16 has Arduino bootloader, you can program it(google for how to).
        Once done, you can use Software Serial libraries and connect the pins(TX and RX) from the IC to the assigned pins used in the library for TX and RX. and finally view the output from the arduino board’s usb serial.

        it goes like this: atmega16- -> Software Serial –>Arduino board –>USB Serial–> Serial monior

        Reply
  3. Dawood

    Hi there, great work!

    How do you configure the baud rate of the serial to USB(TTL) IC which you mentioned is either FTDI FT232RL or ATmega8U2?

    My serial device runs on a 500000 baud rate. I need to set up with the serial to USB IC. do you have any idea

    Reply
    1. Dawood

      Never mind. It seems that software on the PC will set it up. I thought that I need to configure the chip first.

      Thanks!

      Reply
  4. Pingback: Using Arduino UNO as a Bridge to Program Another Arduino Board – focusofascatteredmind

  5. alex

    I was stumped as to how to wire the DTR pin of the chip I wanted to interface with to the Arduino, since the reset pin was obviously already shorted to GND.
    In the end I simply removed the Atmega from my Arduino board and connected the DTR pin to the Arduinos reset pin and it worked perfectly!
    Thanks for the article, this is a much nicer solution than using soft serial!

    Reply
  6. phuzy

    Just wanted to say thanks!

    I had been struggling to get my Wemos D1 mini to act as a bridge; the trick being RST -> G!

    Reply
  7. Chet

    I just wanted to come here to say this post helped me hack (or modify my approach) to communicate with a satellite radio! I love how simple this solution is and how effective it is!

    Reply

Leave a Reply

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