Introduction: RS232 to TTL UART Converter
In many microcontroller-based projects, you may need to communicate with PC. There are several ways to do this like RS232 COM port, USB port, parallel port, WIFI, Bluetooth, etc. You cannot directly connect computer to your microprocessor, you need wireless modules for WIFI and Bluetooth, voltage convertors for RS232 and parallel port and a protocol engine for USB. Here I am going to show you how to make a simple and compact RS232 voltage convertor for your projects that gets its power from the PC. If you are interested in making one yourself follow me.
Step 1: Things You Need
- 1x Female DB9 connector
- 1x 3.5mm stereo audio male connector
- 1x MAX232 IC
- 1x 7805 regulator
- 2x 1N4148 diodes
- 1x 47uF electrolyte capacitor
- 1x 100uF electrolyte capacitor
- 4x 4.7uF electrolyte capacitors
- About 1-5 meters 4-wire cable
- Some small pieces of wire
- Soldering tools (iron, wire and oil)
- Circuit diagram (you can find it in the pictures)
Step 2: Voltage Convertor Capacitors
I have chosen dead spider instead of PCB to have a more compact device. Solder four 4.7uF capacitors to the MAX232 IC according to the circuit diagram like the photos.
- C6: Pin+ to Pin2(MAX232), Pin- to Pin16(MAX232)
- C3: Pin+ to Pin1(MAX232), Pin- to Pin3(MAX232)
- C4: Pin+ to Pin4(MAX232), Pin- to Pin5(MAX232)
- C5: Pin- to Pin6(MAX232)
Step 3: Supply Regulator
Solder 7805 regulator to the MAX232 IC according to the circuit diagram like the photos.
- Pin2(7805) to Pin15(MAX232)
- Pin3(7805) to Pin16(MAX232)
Step 4: Supply Capacitors
Solder other capacitors to the MAX232 IC and 7805 regulator according to the circuit diagram like the photos.
- C2 (47uF): Pin+ to Pin16(MAX232), Pin- to Pin15(MAX232)
- C1 (100uF): Pin+ to Pin1(7805), Pin- to Pin2(7805)
Step 5: Supply Diodes
Solder negative pin of 1N4148 diodes to first pin of 7805 regulator.
Step 6: Wire Far Pins
Connect positive pin of C5 to second pin of 7805 regulator with a small piece of wire.
Step 7: DB9 Connector
Solder DB9 connector pins to the circuit using small pieces of wires according to the circuit diagram like the photos.
- Pin4(DB9) to Pin+(D1)
- Pin7(DB9) to Pin+(D2)
- Pin5(DB9) to Pin+(C5)
- Pin2(DB9) to Pin7(MAX232)
- Pin3(DB9) to Pin8(MAX232)
Step 8: Cable
Solder cable to 3.5mm audio connector, second pin of 7805 regulator and Pins 9 and 10 of MAX232 IC according to the circuit diagram. You can also use your own arrangement.
Step 9: Insulation
Put some pieces of paper among the pins that can connect together accidentally as insulator.
Step 10: Final Step
Now close the cover of DB9 connector and test what you made. Note that this device supplies from PC (RTS and DTR), so to power this device you must set (make high) serial port RTS and/or DTR.
I also made an adapter for USB port you can find here.
11 Comments
2 years ago
helo, stereo audio male connector, if this is replaced with usb type A, will it work too?
Reply 2 years ago
It's just a connector, you can use any type. But you can not connect that UBS to a PC or another device that has a USB, you can just connect it to another device that you made yourself and used a USB connector as its serial port connector.
6 years ago
I tried loopback test on it and it was successful. However my bluetooth audio module XS3868 doesn't work with it.(It works with Arduino UART). What is the cause?
Reply 6 years ago
As it mentioned on the last step "this device supplies from PC (RTS and DTR), so to power this device you must set (make high) serial port RTS and/or DTR", so if the terminal software you use does not set DTR or RTS there will be no power for this device to work.
Reply 6 years ago
I used a Voltmeter and was successfully receiving 5V through the voltage regulator. So I assure you that it is not a voltage problem. Instead it might be something else. Also, when I interconnected Rx and Tx of the UART, I was successfully receiving what I was typing. This is all I know. You happen to know anything?
P.S. My module requires a baudrate of 115200bps.
Reply 6 years ago
I have no idea.
Reply 6 years ago
ok
7 years ago
Hi, thank you for this
Can you advise how to set RTS and DTR to high?
Regards
Nick
Reply 7 years ago
You must set RTS or DTR by the program that uses the serial port.
Reply 7 years ago
Thank you
7 years ago
Awesome!