blippy wrote: ↑Fri Jul 24, 2020 11:33 amI recently got an USB to TTL232 module. I suddenly realised that I have no clue about voltages. I'd like to connect the device's RX and TX pins to the appropriate GPIO pins on the Pi. I have no idea if that will fry the GPIO pins, though. What's the answer?
The chip is a CH340C. I'm assuming that VCC output is 5V, which doesn't matter, because I am powering my Pi separately anyway. The big question is what's coming out of the TX pin.
Ref: https://www.raspberrypi.org/documentati ... on/uart.mdAll UARTs on the Raspberry Pi are 3.3V only - damage will occur if they are connected to 5V systems.
Indeed. You could just measure it with a multimeter as it should be idle high to connect to a Pi's UART. Or assume it's 0V/5V and choose resistors for an appropriate divider which will likely still work if 3V3.
Code: Select all
.----------. .------------------< Pi TXD | RX |<--' ___ | UART TX |-------|___|---.------> Pi RXD | 0V |---. 12K .|. `----------' | | | 22K | |_| | | `-----------^------- Pi 0V (GND)
Aha, that's useful. That voltage came out at 4.05V, which I assume is still too high. Sigh, well that was a waste of a couple of quid from China!
Just adjust the resistor values to drop it to 3V3 or slightly less. Plenty of on-line calculators available. 10K over 30K would probably do the job.
My electronics knowledge is naff, but I can figure out voltage dividers. If I set up a voltage divider I have to set up components with a breadboard. If I use an ESP32, it's basically just three Dupont wires into the Pi.
Many thanks.FTrevorGowen wrote: ↑Fri Jul 24, 2020 4:19 pm@blippy, for future reference you may find these notes/tests about/of a number of USB-to-Serial TTL devices of interest:
https://www.cpmspectrepi.uk/raspberry_p ... pters.html
You can take your dupont wires, and solder the resistors in-line, wrap it all with insulating tape, no PCB required. Or pass it though a plastic pen body cut-off to make a nicer end-result.