I2c-level-converterLevel-shifter-sideviewHooking up an I2C LCD display to a Raspberry Pi is pretty well documented. The only hard part is the level shifter. You need one in order to hookup the 3.3V GPIO pins of the Raspberry Pi to the 5V I2C pins of the LCD. This off course assumes that the I2C LCD is 5Volts, but they usually are.

I found a level shifter using two 2N7000 Mosfets. That’s great as they are really cheap and easy to get, so I decided to build it. I ordered 10 of Ebay for less then $2. I stuck to the 2.2K resistors but you can off course apply 10K resistors as in most level shifters. Another source, using BSS138 mosfets can be found here.

Level-shifter-topviewGetting the mosfets the right way in the pcb was harder then I thought. Resulting in a non functioning board. I didn’t double check the mosfets orientation when soldering them in, relying only on the eagle drawing. Checking it against the datasheet showed that I soldered them in the wrong way. Giving it a another hard thought I remembered that my Triad transistor tester also works for mosfets. A quick measurement confirmed that I soldered the mosfets in the wrong way. I unsoldered them and check using the Triad again if they still worked. They did. After adding them again, this time inserted correctly, the board worked. The image shows the correct orientation for my layout.

 

When milling my board I used to much speed when drilling the hole resulting in one broken corner. The board is still fully functional so I decided to use, and show, it as it is.

Level-shifter-bottomview

The design is not my own, but the pcb layout is. The parts in this schema are just 25 cents (excluding shipping which doubled the price), providing to can make your own board. A complete board can be bought for $2 at for example sparkfun.

If you decide to build your own please take care to orientate the mosfet correctly. The board file shows the outline of the mosfet, but please note that this is not the correct orientation. Therefore I added a snippet from the datasheet detailing the pinout to help you. I also marked the pins in the board and the eagle files.

Download Eagle schematic and board here.

Level-shifter-board-datasheet

Leave a Reply

Because you can * Time limit is exhausted. Please reload the CAPTCHA.