5v level shifted io expansion for Pi/ Pi Pico - Page 1
Forum section: electronics / general

author: NE666
author_rank: Frequent Contributor
timestamp: February 20, 2025, 01:25:37 pm
content: There are a multitude of IO breakout boards available commercially for the Pi and Pi Pico but, try as I might, I can't seem to find any that include on-board 3.3v/5v level shifting for the GPIO pins.Does anybody here know of any?As a "part two" to my question, putting the Pi's to one side, does anyone know of anything (pre-built, and commercially available) that would provide 24 or more GPIO pins, with the same ability to interface either 3v or 5v logic levels, and which could be connected via USB to a PC, such that pin states could be individually set or read using a suitable Python (serial, or otherwise) library? Digilent's Digital Discovery would provide most of that, but even at that price point, I'd still need to take care of the level shifting myself.I'm aware that level shifter IC and modules are available, and that I could combine those myself with other options, however I am really looking for an integrated, single board solution, if such exists.

author: ledtester
author_rank: Super Contributor
timestamp: February 20, 2025, 02:45:44 pm
content: Maybe Digilent's Pmod LVLSHFT board will give you some ideas... it uses 8 1-channel SN47LVC1T45 transceivers so that each data line can be configured individually.https://digilent.com/shop/pmod-lvlshft-logic-level-shifter/(have a look at the bottom side of the board)

author: abeyer
author_rank: Frequent Contributor
timestamp: February 20, 2025, 06:34:21 pm
content: Never tried them myself, but I seem to recall there being several models of the Cypress PSoCs that had multiple voltage domains for banks of gpio, and their low end dev boards were sometimes used like this if you wanted an all in one solution.

author: westfw
author_rank: Super Contributor
timestamp: February 21, 2025, 02:44:38 am
content: The problem is that level conversion becomes difficult if you want to support ALL of the modes that a typical microcontroller pin can implement. Input is easy, output is easy, bidirectional is getting a bit tricky but is possible (and there are single-chip solutions.) Adding tri-stated, open-collector, internal pullups and pulldowns... I dunno.

author: shabaz
author_rank: Frequent Contributor
timestamp: February 21, 2025, 04:03:37 am
content: If it meets your needs, TCA6424A looks useful (it's an I/O expander, but with separately set I2C voltage level). It doesn't support every mode that the microcontroller's integrated pins would support of course, and would be slower, but maybe it's good enough.(EDIT: just noticed you're looking for a board; but maybe this is still useful, for a DIY PCB route).

author: wilfred
author_rank: Super Contributor
timestamp: February 21, 2025, 05:10:17 am
content: Does this look interesting? I saw it on the Arrow website last year when the sale was on but it is still only $1.https://www.arrow.com/en/products/dfr0844/dfrobothttps://wiki.dfrobot.com/8_Bit_Level_Translator_DFR0844https://www.ti.com/document-viewer/txs0108e/datasheet

author: shabaz
author_rank: Frequent Contributor
timestamp: February 21, 2025, 06:53:24 am
content: Quote from: NE666 on February 20, 2025, 01:25:37 pmRegarding your part two, Advantech has a variety of options. An example is USB-4751L which has 24 I/O, which has input levels compatible with both 3.3V and 5V logic. The outputs are 5V TTL, but those would be easy to drop down to 3.3V with external resistors if your attached equipment was not 5V logic compatible.The Advantech devices are controlled using an SDK called DAQNavi, and there are examples in many languages, including C and Python (I've never tried Python with them).They are very low-cost, all things considered (even for home use), and reliable.However, if you're doing hobby stuff and have a lower budget, then you may be interested in my project, calledEasy Adapter.It converts a Pi Pico into a USB-controllable 3.3V I2C and GPIO device. You could then append a TCA6424A board (for instance, this onehttps://www.digikey.co.uk/en/products/detail/mikroelektronika/MIKROE-4186/12806983to get your 5V compatible inputs/outputs (and another of those boards for 3.3V I/O if you wanted consistency). There's practically unlimited GPIO since more than one of those boards can be attached (and up to 8 Pi Pico Easy Adapter boards can be plugged into one PC).The Python interface for I2C is easy; see the GitHub page Readme for more information.That will get you there, but I think the Advantech route is the most practical if this is a work-related thing.

author: NE666
author_rank: Frequent Contributor
timestamp: February 21, 2025, 11:44:34 am
content: Thank you everyone for your suggestions.The Advantech unit looks somewhat promising, as this is indeed a work project and therefore not immediately open to "here's one I built earlier". I'd not considered searching for DAQ products, rather than IO. Thanks.For the future reference of anyone looking for a more home brew approach, I also found these items, which I think could make a good solution in the right context:A level shifter HAT for the Pi from CZH-Labs -https://czh-labs.com/products/rpi-33v-to-5v-26-i-o-bidirectional-voltage-level-shifter-module-for-raspberry-pi-logic-level-converterAn I2C GPIO expander from Waveshare (with selectable 3v or 5v operation), that could be bit-banged by a Pi or connected to a PC via a USB-I2C host adapter -https://www.waveshare.com/mcp23017-io-expansion-board.htm

author: phil from seattle
author_rank: Super Contributor
timestamp: February 24, 2025, 03:10:15 am
content: Maybe I don't understand the reasons for the question - why do you need bidirectional shift for all the pins? I've built a number of boards around the 2040/2350 and only use Bidirectional for very specific pins. (simple mosfets like in the product you linked to - those do have speed limitations.) For everything else, I use unidirectional shifting if 5V is needed.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: February 25, 2025, 10:28:43 pm
content: Quote from: NE666 on February 20, 2025, 01:25:37 pmThere are a shipload of PCB modules built on Cypress-CY7C68013A EZ-USB FX2LP™ USB Microcontroller (and clones) which has 3.3V operation with 5V tolerant pins.Some modules come with 8io and some come with 40 pins, which connect 3 8 bit ports + other control linesOne example:https://www.aliexpress.com/item/1005003827454121.htmlgoogle finds chatter on using this with pythonhttps://community.infineon.com/t5/USB-low-full-high-speed/USB-software-problem-about-a-python-lib-fx2/td-p/443410#.