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

Поделиться
HTML-код
  • Опубликовано: 11 дек 2024
  • 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:
    www.youtube.com...
    ----------------------------------------------------------------------------------------------
    RUclips channel: / electronfuncom
    Google+: plus.google.co...
    Facebook: / electronfunpage
    Twitter: / electronfun
    Website: ElectronFun.com
    ----------------------------------------------------------------------------------------------
    Video, edit, voice by Chris Lorkowski
    Music by Jason Shaw - Keep It Real
    www.audionautix...
  • НаукаНаука

Комментарии • 132

  • @debdinoogmai
    @debdinoogmai 9 лет назад +14

    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  9 лет назад

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

    • @debdinoogmai
      @debdinoogmai 9 лет назад +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  9 лет назад

      +Raspoetin a Thanks a lot :)

  • @davebutler95
    @davebutler95 3 года назад

    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.

  • @liquidpower
    @liquidpower 9 лет назад +3

    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!

  • @renzevenir4853
    @renzevenir4853 7 лет назад +5

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

  • @Ahmadnaweed786
    @Ahmadnaweed786 4 года назад +2

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

  • @dnsshetty2430
    @dnsshetty2430 10 лет назад +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  10 лет назад +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 10 лет назад +2

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

    • @onil3372
      @onil3372 6 лет назад

      can i have the code.?

  • @chriskaprys
    @chriskaprys 4 года назад +3

    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.

  • @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.

  • @doniherald7745
    @doniherald7745 9 месяцев назад

    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!

  •  Год назад

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

  • @sweetclara
    @sweetclara 8 лет назад +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  8 лет назад +1

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

  • @memogarcia9470
    @memogarcia9470 9 лет назад +3

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

    • @ElectronFunCom
      @ElectronFunCom  9 лет назад

      +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

  • @tuliog4178
    @tuliog4178 4 года назад

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

  • @melbourneonrails5721
    @melbourneonrails5721 5 лет назад

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

  • @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).

  • @serial507023
    @serial507023 9 лет назад +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  9 лет назад

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

    • @serial507023
      @serial507023 9 лет назад +1

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

    • @ElectronFunCom
      @ElectronFunCom  9 лет назад

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

    • @serial507023
      @serial507023 9 лет назад

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

    • @ElectronFunCom
      @ElectronFunCom  9 лет назад

      +Dhananjay D No problem, hope it helps :)

  • @ercost60
    @ercost60 3 года назад

    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.

  • @saikatd9037
    @saikatd9037 4 года назад

    How to program the external atmega ic using this technique?

  • @theUsesOFnot
    @theUsesOFnot 5 лет назад

    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.

  • @stephencrown
    @stephencrown 9 лет назад +4

    Can i connect esp8266 to a PC in this method ?

    • @ElectronFunCom
      @ElectronFunCom  9 лет назад +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.

  • @xephael3485
    @xephael3485 5 лет назад +4

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

  • @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.

  • @bxeagle3932
    @bxeagle3932 2 года назад

    Does this method works for stm8 board?

  • @ВадимГусев-с7о
    @ВадимГусев-с7о 10 лет назад +1

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

    • @ElectronFunCom
      @ElectronFunCom  10 лет назад

      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 10 лет назад +1

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

    • @ElectronFunCom
      @ElectronFunCom  10 лет назад +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.

  • @SantoshTupsy
    @SantoshTupsy 2 года назад

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

  • @MZeroTolerance
    @MZeroTolerance 7 лет назад +1

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

    • @ElectronFunCom
      @ElectronFunCom  7 лет назад

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

    • @alonsomatos9447
      @alonsomatos9447 6 лет назад +1

      Yes, i had just tested it and works flawlessly

  • @ΤΟΝΙΑΧΡΙΣΤΙΔΟΥ
    @ΤΟΝΙΑΧΡΙΣΤΙΔΟΥ 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 4 года назад

      Just remove the link between reset and ground.

  • @viniciuscavalcanti6479
    @viniciuscavalcanti6479 7 лет назад +1

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

    • @ElectronFunCom
      @ElectronFunCom  7 лет назад +2

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

  • @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.

  • @thebug2782
    @thebug2782 8 лет назад

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

    • @ElectronFunCom
      @ElectronFunCom  8 лет назад

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

  • @cyancoyote7366
    @cyancoyote7366 8 лет назад +3

    Will this work on a nano?

    • @ElectronFunCom
      @ElectronFunCom  8 лет назад +1

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

    • @Aw4yed
      @Aw4yed 4 года назад

      Hey, so have you try it?

  • @ram_psara
    @ram_psara 9 лет назад +1

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

    • @ElectronFunCom
      @ElectronFunCom  9 лет назад

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

    • @ram_psara
      @ram_psara 9 лет назад

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

    • @ElectronFunCom
      @ElectronFunCom  9 лет назад

      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 9 лет назад +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  9 лет назад

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

  • @sudoname
    @sudoname 9 лет назад

    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  9 лет назад +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 9 лет назад +1

      Thank you !

    • @ElectronFunCom
      @ElectronFunCom  9 лет назад

      ShinchanPyara No problem :)

  • @nischalpoudel3042
    @nischalpoudel3042 4 года назад

    does this work for nodemcu esp8266?

  • @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 :)

  • @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.

  • @calebtshionza2308
    @calebtshionza2308 6 лет назад

    To the point and helpful advice thank you

  • @leon111333
    @leon111333 5 лет назад

    Really great! Thank you very much!

  • @vitalikstaricov1677
    @vitalikstaricov1677 9 лет назад

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

    • @ElectronFunCom
      @ElectronFunCom  9 лет назад

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

  • @Abdul_rejman
    @Abdul_rejman 2 года назад

    Sir. Great

  • @salimshahzada4786
    @salimshahzada4786 5 лет назад

    GREAT, SIR

  • @teeteearrr
    @teeteearrr 8 лет назад

    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  8 лет назад

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

    • @teeteearrr
      @teeteearrr 8 лет назад

      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  8 лет назад

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

    • @teeteearrr
      @teeteearrr 8 лет назад

      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  8 лет назад

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

  • @sebastianelytron8450
    @sebastianelytron8450 7 лет назад +2

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

    • @ElectronFunCom
      @ElectronFunCom  7 лет назад +2

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

  • @djkadakamc1889
    @djkadakamc1889 4 года назад

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

  • @alexissalguero6875
    @alexissalguero6875 8 лет назад

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

    • @ElectronFunCom
      @ElectronFunCom  8 лет назад

      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