How to use an Arduino as a USB to TTL converter || Arduino tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 เม.ย. 2014
  • This short video is a tutorial on how to use an Arduino as a USB to TTL (also known as COM or RS-232) converter. I was using a dedicated converter bought from eBay in my previous video: • How to unbrick a TP-Li... . If you have an Arduino lying around, it will easily substitute a USB to TTL converter.
    See all my Arduino tutorials here:
    • Arduino tutorials
    Subscribe to get notified about my new videos:
    th-cam.com/users/subscription_c...
    ----------------------------------------------------------------------------------------------
    TH-cam channel: / electronfuncom
    Google+: plus.google.com/+Electronfuncom
    Facebook: / electronfunpage
    Twitter: / electronfun
    Website: ElectronFun.com
    ----------------------------------------------------------------------------------------------
    Video, edit, voice by Chris Lorkowski
    Music by Jason Shaw - Keep It Real
    www.audionautix.com
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 132

  • @debdinoogmai
    @debdinoogmai 8 ปีที่แล้ว +10

    Fantastic. I just bricked my tp-link router and this is exactly what I need to fix it today instead of waiting for a usb to ttl converter.

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Raspoetin a Great, I'm glad my video helped you solve your problem. Good luck with the unbricking process!

    • @debdinoogmai
      @debdinoogmai 8 ปีที่แล้ว +1

      +ElectronFun.com
      All done and dusted :)
      It took me more time to find and configure a decent Terminal Emulator and TFTP server for Mac then connecting and un-bricking my router.
      btw, your vid on opening the TP link was very handy as well.
      Thx

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Raspoetin a Thanks a lot :)

  • @barebooger
    @barebooger 6 ปีที่แล้ว

    This worked with my older Arduino Duemilanove, thanks! I was having trouble programming the PID on a Tarocco servo controller with a 3.3v USB to serial cable. This did the trick. I think it needed the full 5V.

  • @renzevenir4853
    @renzevenir4853 7 ปีที่แล้ว +5

    Truly a life saver! Thanks! I have to customize my STOSD and I have no USB to TTL converter.

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      Thank you! I'm glad I could help :)

  • @davebutler95
    @davebutler95 2 ปีที่แล้ว

    This worked like a champ for Tasmotizing a few Sonoff Basics after also connecting 3.3V on the Arduino to 3.3V on the Sonoff.

  • @melbourneonrails5721
    @melbourneonrails5721 5 ปีที่แล้ว

    Used it to connect my C64 mini to pc. Works well! Thanks for this amazing video!!

  • @liquidpower
    @liquidpower 9 ปีที่แล้ว +2

    this helped so much i was trying to use a real usb to ttl the ftdi232 and every time it gave me an error watched this threw my arduino on it and bam i can upload the firmware now thanks!

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      Jason Brown I'm glad I could help you :)

  • @Ahmadnaweed786
    @Ahmadnaweed786 4 ปีที่แล้ว +2

    What about logic level ? Because the router is 3.3 v and atmega328p is 5 v?

  • @tuliog4178
    @tuliog4178 4 ปีที่แล้ว

    Mindblown! I mean, after i blown an arduino before, I still can use it. like this. Great.

  • @theUsesOFnot
    @theUsesOFnot 4 ปีที่แล้ว

    How can I connect a USB barcode scanner to an Arduino - do I need some kind of USB host? I just want to get the barcode via. serial port.

  • @bxeagle3932
    @bxeagle3932 2 ปีที่แล้ว

    Does this method works for stm8 board?

  • @saikatd9037
    @saikatd9037 3 ปีที่แล้ว

    How to program the external atmega ic using this technique?

  • @dnsshetty2430
    @dnsshetty2430 9 ปีที่แล้ว +7

    When using a normal USB to TTL device, we connect RX of the device to the TX of router, and TX of device to RX of router. However, in this video you have connected RX to RX and TX to TX.. am not too sure, but is this a correct configuration?

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว +6

      You are right, we connect TX to RX and RX to TX. Pay attention to the marks on the Arduino board: RX1 (1 is actually RX and TX from another device should be connected here). I agree, it is not marked clearly on the Arduino.

    • @dnsshetty2430
      @dnsshetty2430 9 ปีที่แล้ว +2

      ElectronFun.com Ahh.. makes sense now. Thanks :)

    • @onil3372
      @onil3372 5 ปีที่แล้ว

      can i have the code.?

  • @doniherald7745
    @doniherald7745 2 หลายเดือนก่อน

    someone say i need to connect CH_PD or EN pin to GND, but i can't find it in my Wemos D1 R1 board.
    turn out Reset pin to GND also works, Thanks!

  • @calebtshionza2308
    @calebtshionza2308 6 ปีที่แล้ว

    To the point and helpful advice thank you

  • @eaingraham2415
    @eaingraham2415 9 ปีที่แล้ว +1

    I'm trying this with an Arduino Leonardo, and when I make the connection between RESET and Ground (similar to whats shown in the video), the connection between my computer and the arduino gets reset (sounds reasonable when you think about it) ... How do I get my computer to speak to/through the arduino once the atmega gets put to sleep?

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว +1

      Eain Graham Hi Eain, your Leonardo behaves properly. Arduino Uno has 2 microcontrollers: the main unit and another one for USB communication. When you disable the main ATmega the USB connection remains unbroken. Leonardo has only one microcontroller for running the sketches and USB communication. That's why your connection gets broken when you reset the ATmega. See more details here: www.arduino.cc/en/Guide/ArduinoLeonardoMicro?from=Guide.ArduinoLeonardo.

  • @memogarcia9470
    @memogarcia9470 8 ปีที่แล้ว +3

    Hi, in this case I have the arduino 2560, what is the sketch for make it work? thanks

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Memo García Hi, unfortunately the Arduino Mega 2560 doesn't have an FTDI chip, so it's not as easy as with Arduino Uno. I haven't tried that with the Mega 2560, but the below link might help you:
      forum.arduino.cc/index.php?topic=287584.0

  • @pascalbeucher3829
    @pascalbeucher3829 9 ปีที่แล้ว +1

    Hi, then you connect a USB cable between the computer and the Arduino?
    USB PC ---> USB Arduino _ TX/RX Arduino ---> Device serial port ?

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      It goes exactly like you wrote. Just remember to connect TX to RX and RX to TX. Pay attention to the marks on the Arduino board: RX1 (1 is actually RX and TX from another device should be connected here).

  • @RubenEspinoza
    @RubenEspinoza ปีที่แล้ว

    Why with this method can`t flash SIM900A ?
    but without a usb to ttl converter does it work?
    I still don't understand.

  • @leon111333
    @leon111333 5 ปีที่แล้ว

    Really great! Thank you very much!

  • @xephael3485
    @xephael3485 4 ปีที่แล้ว +4

    What's your voltage reading on ground to RX or TX?

  • @dwhollrah
    @dwhollrah 8 ปีที่แล้ว

    Thanks, I've been looking for just this answer. I'm attempting a connection between the PCM on my truck to my laptop. Baud rate 8192. If I can manage this connection the Uno will pay its way. One thing I don't get..my truck forum has the RX and TX terminals pigtailed together into one terminal of the truck(5V). The only other connection is ground from board to truck terminal. Does this make sense to you? TY

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +dwhollrah I guess you've just found a new application for an Arduino board :)
      The thing with TX and RX pins pigtailed together does seem odd to me too. Can you give me the link to this forum post?
      When it comes to cars, I'm forced to rely on my mechanic, but I'll try to help if I can :)

    • @dwhollrah
      @dwhollrah 8 ปีที่แล้ว

      +ElectronFun.com I used your connections and went ahead with the connect to truck and got it working perfectly...tons of sensor data spilling out of my lappy now. This is worse than texting while driving. Here's that link. www.dieselplace.com/forum/63-gm-diesel-engines/21-6-5l-diesel-engine/457933-how-scan-your-obd1-6-5-less-than-10-a.html

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +dwhollrah What about the TX and RX pigtailed together? I can see it does look like this in the photo.

    • @dwhollrah
      @dwhollrah 8 ปีที่แล้ว

      +ElectronFun.com Yes, they are both joined to one lead running to a single terminal on the truck. The only other wire is ground just as you show. I've used it flawlessly for two days now....well a few boot hiccups.

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +dwhollrah I'm happy it works for you :)

  • @ercost60
    @ercost60 2 ปีที่แล้ว

    Thanks, worked fine to program a Picaxe once I swapped the Tx and Rx lines. Just as you said, Tx goes to Tx and Rx goes to Rx. That seems switched to me but it's a frame of reference thing.

    • @akmadsen
      @akmadsen ปีที่แล้ว

      I think it's because they're swapped internally again when bypassing the ATMEGA328 chip. That's how I read the schematics for the Arduino Uno (rev3) at least.

  • @chriskaprys
    @chriskaprys 3 ปีที่แล้ว +2

    I'm so glad this is here. I was about to purchase a USB to TTY serial converter, but then wondered if I couldn't just use one of my arduinos to do the same. Arduino to the rescue!
    I'm wondering how I actually interface with the device once it is connected, though. If I open the serial monitor I will only have a passive view of what's happening on the device, right? How would I send commands over a terminal once the device is connected?
    Thanks!
    *edit* Ignore me. I just realised the text field with 'Send' is at the top of the serial monitor. So blind sometimes 😎

    • @ElectronFunCom
      @ElectronFunCom  3 ปีที่แล้ว

      It should work in exactly the same as a regular USB to TTL converter, if I recall corectly.

  • @nischalpoudel3042
    @nischalpoudel3042 3 ปีที่แล้ว

    does this work for nodemcu esp8266?

  • @MZeroTolerance
    @MZeroTolerance 6 ปีที่แล้ว +1

    If I connect Arduino's TX to RX (loopback), then I will see in Serial Port what I send? Or not?

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว

      I haven't checked such a case, but it's a nice idea for an experiment :)

    • @alonsomatos9447
      @alonsomatos9447 5 ปีที่แล้ว +1

      Yes, i had just tested it and works flawlessly

  • @sweetclara
    @sweetclara 7 ปีที่แล้ว +1

    Please do me a favor?Can I use Arduino instead of Serial port to USB gender?Now I want to use 4,6 pin ( DSR/DTR) of serial ports cable with my device, but I don't have Serial port cable.So, I connect with my device (there are two cable to connect 4,6 pin actually) to Arduino.I am not sure it is working or not...

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว +1

      I'm not sure if I understand your situation. First of all - what device do you want to connect to your Arduino?

  • @stephencrown
    @stephencrown 8 ปีที่แล้ว +4

    Can i connect esp8266 to a PC in this method ?

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว +4

      +Stephen Crown Yes, you can, because this method bypasses the ATmega chip and uses the USB to TTL converter integrated into the board.

    • @lioneltechreviews9740
      @lioneltechreviews9740 7 ปีที่แล้ว +2

      yes, when the reset is grounded.

  • @matthewgutz
    @matthewgutz 7 ปีที่แล้ว

    I got this method to work using my arduino uno, but when trying with my arduino leonardo it doesn't seem to work. Any advice?

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว +1

      Arduino Leonardo is much different than Uno. The following webpage should be helpful: petervanhoyweghen.wordpress.com/2012/11/08/using-the-leonardo-as-usb-to-serial-converter.

  • @viniciuscavalcanti6479
    @viniciuscavalcanti6479 6 ปีที่แล้ว +1

    Hi, I tried with arduino mega 2560 and could not get it to work. Do you have any idea?

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว +2

      Arduino Mega 2560 doesn't have the FTDI chip, so it will not work as shown in the video, sorry.

  • @ram_psara
    @ram_psara 8 ปีที่แล้ว +1

    is it possible to use this technique for a gsm modem(serial to usb)....
    i tried but didn't work out..

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +THULASI RAM I believe it should work. What modem module do you have?

    • @ram_psara
      @ram_psara 8 ปีที่แล้ว

      sim900a...using pl2303 usb to serial converter..

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      Should work. Do you want to issue AT commands? How did you connect the USB to TTL converter to the GSM module?

    • @ram_psara
      @ram_psara 8 ปีที่แล้ว +1

      gsm modem serial port tx, rx, gnd to prolific usb rx tx gnd..tested using gsm modem tester software.....thank you for your quick reply..

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +THULASI RAM Have you tried using PuTTY to issue AT commands?

  • @user-gm5dj7qo8h
    @user-gm5dj7qo8h 9 ปีที่แล้ว +1

    Hello tell me you need to use the library for this example?

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว

      No, you don't need any code or libraries for this example. This Arduino board does not even need the Atmega microcontroller. It is only used as a USB to COM (also called TTL or RS-232) converter.

    • @matanbenyamin
      @matanbenyamin 9 ปีที่แล้ว +1

      ElectronFun.com can it damage thearduino or the ttl device? if the device works with 3.3 v?

    • @ElectronFunCom
      @ElectronFunCom  9 ปีที่แล้ว +1

      Matan Benyamin No, the router board from this video works with 3.3V and everything went just fine. There was no magic smoke and both devices work perfectly well until this day.

  • @sudoname
    @sudoname 8 ปีที่แล้ว

    Thanks a lot for sharing this ! I just started playing with Arduino, so pardon my noob queries, Google didn't help me much .
    1. Why would connecting "reset to ground" turn Arduino into TTL converter ?
    2. Is Arduino capable of working on both TTL and RS232 signals ? I was assuming all MCUs need TTL.

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว +1

      ShinchanPyara Hi,
      1. Normally to reset ATmega you need to connect the reset pin to GND for a short while. When it's constantly connected the ATmega is disabled and you can use directly the USB to TTL converter chip that's on the board.
      2. Actually it's not - Arduino can't work with RS232 signals without additional hardware.

    • @sudoname
      @sudoname 8 ปีที่แล้ว +1

      Thank you !

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      ShinchanPyara No problem :)

  • @thebug2782
    @thebug2782 7 ปีที่แล้ว

    sir, please explain the connection of an esp8266MOD smart wifi module to connect into a pc directly

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      See this: www.instructables.com/id/Getting-Started-with-the-ESP8266-ESP-12. It explains a lot.

  • @salimshahzada4786
    @salimshahzada4786 4 ปีที่แล้ว

    GREAT, SIR

  • @alexissalguero6875
    @alexissalguero6875 7 ปีที่แล้ว

    can you use this method to program a adruino mini pro?

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      I guess you mean my other video entitled: "How to program an Arduino on a breadboard". To answer your question - it is possible to program Pro Mini using another Arduino as ISP, see here: www.instructables.com/id/Program-Arduino-Pro-Mini-Using-Arduino-Uno

  • @user-kg9hk2wk6w
    @user-kg9hk2wk6w 4 ปีที่แล้ว

    After setting arduino as a usb to ttl converter how can i turn it back to normal ? I did as you said but after that i cant upload code to my arduino !

    • @RajivDeo
      @RajivDeo 3 ปีที่แล้ว

      Just remove the link between reset and ground.

  • @Abdul_rejman
    @Abdul_rejman ปีที่แล้ว

    Sir. Great

  • @serial507023
    @serial507023 8 ปีที่แล้ว +2

    Hi I am trying to use this to program my UV-5R radio, Usually it requires cable which has USB to TTL adapter, I made the cable and trying to use arduino as USB-TTL adapter, But it does not seem to connect... Tx-Rx line flashes once then it Chirp software gives error that it cannot detect the radio.
    Software: CHIRP
    Reference:
    www.miklor.com/COM/UV_ProgrCable.php
    www.miklor.com/COM/UV_CHIRP.php

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Dhananjay D I have never used CHIRP software, but have you set up all the COM port's parameters?

    • @serial507023
      @serial507023 8 ปีที่แล้ว +1

      I know about baud rate, Is there anything else I should set up...:)

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Dhananjay D Have you tried swapping TX with RX on one end of your cable?

    • @serial507023
      @serial507023 8 ปีที่แล้ว

      Yes...It was not working
      I recently got USB-TTL converter, will try that, and debug this later :P, Thanks

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Dhananjay D No problem, hope it helps :)

  • @SantoshTupsy
    @SantoshTupsy 2 ปีที่แล้ว

    Use this code upload to arduino(no need to connect wires):
    void setup(){
    pinMode(0,INPUT); pinMode(1,INPUT);
    }
    void loop(){
    }

  • @vitalikstaricov1677
    @vitalikstaricov1677 8 ปีที่แล้ว

    Как прошить arduino Uno с помощью USB TTL ch340g. Куда какие провода ставить

    • @ElectronFunCom
      @ElectronFunCom  8 ปีที่แล้ว

      +Vitalik Staricov I'm sorry, I don't speak Russian.

  • @jonnyphenomenon
    @jonnyphenomenon ปีที่แล้ว

    anyone else horrified by his choice of wire colors? red to voltage, brown to ground! GAH!
    Other than that, good info! :D exactly what I came here for.

  • @AlistairSutter
    @AlistairSutter 7 ปีที่แล้ว

    Hey man! Experimenting with my Uno here - trying to access the serial port of a router: a CradlePoint Ctr35. Used this link: www.devttys0.com/2012/11/reverse-engineering-serial-ports/ to find what I think is the headers. One weird thing with the TX though is that it goes to HIGH on boot, fluctuates a bit, then rests at LOW for however long I leave the device powered. Which makes me think that maybe I haven't found the right header? I was able to use the ground and vcc to power it up however, no problem.
    Running Kali Linux, I connected the UNO through USB, launched minicom - connected to /dev/ttyACM0 (Only tty I could find) and started testing all the different baud rates with the boot of the router. No success, even inverting the tx and rx connections. Not even garbage in the tty.
    Then tried testing the UNO-> connected tx&rx together and tried echo test > /dev/ttyACM0. And it worked. I think maybe I need to solder the wires on the router. What do you advise?

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      I haven't played with CradlePoint Ctr35, but I'm thinking maybe you are testing a wrong tty, but it's just my thought.

    • @AlistairSutter
      @AlistairSutter 7 ปีที่แล้ว

      ElectronFun.com I thought so too but there isn't that much other pins on it.
      I'm thinking the board uses 3.3V serial - any DIY advice?

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      The pin may be right, but maybe it's another tty in you Linux.

    • @AlistairSutter
      @AlistairSutter 7 ปีที่แล้ว

      Ah no - I can connect to a Belkin router through serial with the arduino using the same tty - problem is with the ctr35. The belkin uses 5V and the ctr35 uses 3.3V.

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว

      Nothing more comes to my mind now - helping remotely is not easy :|

  • @djkadakamc1889
    @djkadakamc1889 3 ปีที่แล้ว

    It works with routers and other stuff but unfortunatelly not for programming radio frequencies

  • @sebastianelytron8450
    @sebastianelytron8450 6 ปีที่แล้ว +2

    or just use an FTDI chip and save yourself the hassle....

    • @ElectronFunCom
      @ElectronFunCom  6 ปีที่แล้ว +2

      You could do that, if you had one on hand.

  • @cyancoyote7366
    @cyancoyote7366 7 ปีที่แล้ว +3

    Will this work on a nano?

    • @ElectronFunCom
      @ElectronFunCom  7 ปีที่แล้ว +1

      I haven't tried that with Nano, but see this: forum.arduino.cc/index.php?topic=278222.0.

    • @FLyR9
      @FLyR9 3 ปีที่แล้ว

      Hey, so have you try it?