Picture of A bidirectional logic level converter (for I2C)
When working with sensors and microcontroller or arduino's, you'll need a level converter as a lot of sensors are designed for 3,3V and most microcontrollers will be 5V.

I know that they can be bought cheaply at sparkfun and others but when you only want to buy one converter you might pay more for the shipping than for the actual thing. And besides that, it is a simple thing to make.

You only need two bss138 mosfets, four 10k resistors, two sets of male headerpins and a pcb or a piece of veroboard.

Step 1: The circuit.

Picture of The circuit.
There is not much to tell about te construction of this circuit. Connect the gates directly to 3,3V, the sources via a 10K resistor to 3,3V and the drains via a 10K resistor to 5V.

Then make yourself a nice PCB-layout or find yourself a small piece of leftover veroboard and head to the next step.
converter.pdf(595x842) 13 KB
steveo985013 months ago

Why do you have 4 pins on each side when you are only connecting 3 pins on each side?

janw (author)  steveo985013 months ago
It's only because the board sits a bit more stable in the breadboard. You can make one with only 3 pins.
mpep4 years ago
Hi, please advise which pins are for what? My crystal ball has broken. ;-)
janw (author)  mpep4 years ago
look at the last picture in the last step. It should be there. SDA and SCL can be exchanged without problem aslong as you do it on both sides of the converter.
mathieulj4 years ago
Nice and simple does the trick.
jeff-o4 years ago
Thanks for this - very useful!