Electrical – How to use CD40109BE to level shift one input from 3v to 5v

character-lcdlevel-shiftingraspberry pi

I want to use the Raspberry Pi's 3.3v GPIO pins to control whether a 5v LCD screen is on or off. The Raspberry Pi has a 5v pin but it cannot be turned on or off using Python or similar. Only the 3.3v GPIO pins can.

Therefore, to do this I want to use a CD40109BE level shifter (datasheet) to shift the GPIO pin's voltage from 3.3v to 5v but I'm not quite sure how to connect it up.

Here's a schematic of what I want to do with the chip:


simulate this circuit – Schematic created using CircuitLab

But how would I do it? What pins and components would I need to use? I tried the schematic from this answer but it didn't seem to work for me and I only want to use a single input and output.

Thank you

Best Answer

That is an TC1602A-01T display and the datasheet was found by searching for "1602 LCD datasheet".

The CD40109BE is designed for shifting logic-level signals. In your case you want to switch the backlight on and off. Reading the datasheet reveals:

enter image description here

Figure 1. Datasheet extract. Note the warning!

The CD40109BE is not suitable for switching 100 mA.

enter image description here

Figure 2. R1 limits the current to a safe value. Q1 allows switching from a 3.3 V GPIO. Source: 1602 LCD backlight LED.

\$ R_1 = \frac {V_{SS}–4.1}{0.1 } \$

For a 5 V supply this would give R1 = 9 Ω. The nearest standard value is 10 Ω and this would be fine.