Thursday, February 1, 2018

How to build your own USB to UART serial converter using cheap FT232 with voltage level shifting

The board includes 500mA fuse protection, EMI filtering, power LED indicator, RX and TX LED indicators, and a voltage level shifter that makes it compatible with 3.3V and 5V boards. This way you don't need to check the jumper if it outputs 5 or 3.3V so you don't risk burning your microcontroller. It just works with both voltages.
Eagle schematic and board layout are available for download down below.

USB to UART serial converter board tutorial DIY home build


Parts needed:

1 x USB Type B connector = 0.87$ (Farnell order code: 1696537)
1 x MC33190 - PPTC Resettable Fuse = 0.2$ (Farnell order code: 1800750)
2 x BLM21PG221SN1D - Ferrite Bead = 0.14$ (Farnell order code: 1515661)
2 x Green LEDs = 0.10$ (Farnell order code: 2426215)
1 x Red LED = 0.06$ (Farnell order code: 2463998)
2 x TVS Varistor 0603 = 0.44$ (Farnell order code: 1838966)
1 x 10 µF 0805 capacitor = 0.14$ (Farnell order code: 1759421)
1 x 0.1 µF 0805 capacitor = 0.05$ (Farnell order code: 2496944)
2 x 1 µF 0805 capacitor = 0.22$ (Farnell order code: 2320832)
3 x 220 ohm 0805 resistors = 0.04$ (Farnell order code: 9332804)
1 x 10k 0805 resistor = 0.01$ (Farnell order code: 9330399)
2 x 1k 0805 resistors = 0.02$ (Farnell order code: 9332383)
1 x 3.3V Zener Diode = 0.12$ (Farnell order code: 2453995)
1 x 1N4148WS. - Small Signal Diode = 0.08$ (Farnell order code: 1466524)
1 x 1x6 Receptacle
1 x FT232 IC = 1.9$ on eBay
1 x 70x34 mm double side copper clad board

TOTAL = ~5$

USB to UART serial converter with voltage translator schematic

FT232RL USB to UART converter with voltage level shifter translator
Click to enlarge or right click and open in new tab




Starting from the left we have a USB type B connector. In series with the USB 5V VCC is MC33190 a PTC resettable fuse F1. This protects the USB host by limiting the current to 500mA. In case of a short circuit, the current spikes to 1.5A for a very short time and in under a second the fuse resistance increases and the current is maintained at 200mA.
After the fuse, there is L2 BLM21PG221SN1D ferrite bead that blocks high-frequency switching noise from the IC that can induce noise on the USB power supply.
D1 and R1 is a green power indicator LED and it's current limiting resistor.
C1 and C2 are decoupling capacitors - they act as a current reservoir for the chip during peak current draw. The 10uF capacitor filters lower frequency whereas the 0.1uF filters higher frequency noise to ground.
VR1 and VR2 are CG0603MLC-05E varistors used for protecting the IC from ESD spikes. When the voltage increases over 20V, the resistance of the varistors decreases shunting the voltage to ground. Notice that the USB shield is connected to ground through the L1 ferrite bead. This ensures that any ESD voltage spike will be absorbed by the inductor and will not affect the ground potential.
D4 is a red LED that indicates UART transmission and D5 is a green LED that indicates reception.
I would change them with 0805 LEDs to be the same size.

The pin 13 of the FT232RL is the 3.3V out from the internal voltage regulator and is tied to the VCCIO pin 4. This puts the IC in 3.3V mode meaning it will output 3.3V on the transmission line. The reason for this is that I wanted to make it compatible with 3.3V and 5v boards.

In series with the TX (transmission) line is R3 and in parallel is D2 a 3.3V zener diode. If the FT232 communicates with a 5V board the 3.3V on the TX, still will be read as HIGH by the 5V board. The D2 zener is there to protect the FT232 chip in case that more than 3.3V will be on the line for some reason.
R2 is a 10k pull-up resistor that keeps RX line at 3.3V. D3 in series with RX line is a signal diode that blocks voltages from the other side in case there is more than 3.3V. Let's say that the chip communicates with a 5V MCU. When the MCU puts 5V on the RX line, the voltage will be blocked by the diode D3 and the R2 will keep the RX pin at 3.3V. But when the MCU puts a LOW voltage on RX line, the RX pin of the FT232 will be pulled to GND because the 5V is gone.

At the right side of the board is a 1 row, 6 pins receptacle (female header).
Pinout:
1 -  3.3V (max 50mA)
2 - 5V (USB VCC, max 500mA)
3 - TXD (connect to RX)
4 - RXD (connect to TX)
5 - DTR
6 - GND
C3 and C4 are 1uF bulk capacitors for 5V and 3.3V output.
DTR is HIGH and during communication is held LOW by the FT232. Use a capacitor in series and connect the other end to the reset line of your device in order to initiate the bootloader programming.

Notice that the 3.3V output from the FT232 internal voltage regulator can only supply 50mA. Make sure your device will not exceed that.

USB to UART converter pinout

USB to UART converter board logo
The logo didn't stick well

If you want to know how I made the PCB, visit Double sided PCB tutorial.

Download schematic and PCB layout projects


Eagle - USB to UART using FT232RL (Revision 1)




No comments:

Post a Comment