You are on page 1of 6

BiDirectionalLogicLevelConverterHookupGuide

CONTRIBUTORS:

JIMB0

Introduction
Doyouhavea3.3VI2CorSPIsensorthatmightgoupinsmokeifconnectedtoa5VArduino?Ora5V
devicethatneedsaworkaroundtobecompatiblewithyour3.3VRaspberryPi,ArduinoDueorpcDuino?
Togetoverthisobstacleyouneedadevicethatcanshift3.3Vupto5Vor5Vdownto3.3V.Thisis
calledlogiclevelshifting.LevelshiftingisadilemmasocommonwedesignedasimplePCBassemblyto
makeinterfacingdevicesalittleeasier:theBiDirectionalLogicLevelConverter.

Thoughtheyresharethesameshapeandsize,thisbidirectionallogiclevelconvertershouldntbe
confusedwiththemoreunidirectionalversion.Thisconvertercanpassdatafromhightolowand/or
lowtohighonallchannels.Itsperfectforlevelshiftingbetweendevicesthataresharingadatawire,
likeI2Coraonewireinterface.

CoveredInThisTutorial
InthistutorialwelltakeanindepthlookattheBiDirectionalLogicLevelConverter.Wellexaminethe
schematicandboardlayoutexplainingwhateachpinontheboarddoes.Attheendwellgooversome
hookupexamplestoshowhowyoumighthooktheboardupforvariousinterfaces.

SuggestedReading
LogicLevels
HowtoUseaBreadboard
WhatisanArduino?
HowtoSolder
WorkingwithWire

BoardOverview

Ifyoutakeapeakattheboardsschematic,youdfindthatthebidirectionallogiclevelconverter(lets
shortenthattoBDLLC)isactuallyaverysimpledevice.Thereisbasicallyonelevelshiftingcircuiton
theboard,whichisrepeatedfourtimestocreatefourlevelshiftingchannels.ThecircuitusesasingleN
channelMOSFETandacouplepullupresistorstorealizebidirectionallevelshifting.

ThebidirectionallevelshiftingcircuitusedonallfourchannelsoftheBDLLC.
Throughsomesemiconductormagic,thiscircuitcanshiftalowvoltagesignaltohighand/orshiftahigh
voltagesignaltoalowvoltage.A0Vsignalononeendremainsa0Vsignalontheother.Foracomplete
analysisofthiscircuit,checkoutthisexcellentPhilipsApplicationNoteAN97055.

ThePinout
Thereare12totalpinsontheBDLLCtwoparallelrowsofsixheaders.Onerowcontainsallofthe
highvoltage(e.g.5V)inputsandoutputs,theotherrowhasallthingslowvoltage(e.g.3.3V).

Thepinsarelabeledonboththebottomandtopsidesoftheboard,andorganizedintogroups.Lets
lookcloseratsomeofthepingroups:

VoltageInputs
ThepinslabeledHV,LV,andtwoGNDsprovidehighandlowvoltagereferencestotheboard.
Supplyingasteady,regulatedvoltagetobothoftheseinputsisrequired.
ThevoltagesuppliedtotheHVandGNDinputsshouldbehigherthanthatsuppliedtotheLVside.For
example,ifyoureinterfacingfrom5Vto3.3V,thevoltageontheHVpinshouldbe5V,andthevoltage
onLVsouldbe3.3V.

DataChannels
TherearefourseparatedatachannelsontheBDLLC,eachcapableofshiftingdatatoandfromhigh
andlowvoltages.ThesepinsarelabeledHV1,LV1,HV2,LV2,HV3,LV3,HV4,andLV4.Thenumberat
theendofeachlabeldesignatesthechannelofthepin,andtheHVorLVprefixdetermineswhetherits
onthehighorlowsideofthechannel.
AlowvoltagesignalsentintoLV1,forexample,willbeshifteduptothehighervoltageandsentout
HV1.SomethingsentinHV3willbeshifteddownandsentoutofLV3.Useasmanyofthesechannelsas
yourprojectrequires.Youdonthavetouseeverysingleone.
Keepinmindthattheselevelshiftersarepurelydigital.Theycantmapananalogvoltagefromone
maxvoltagetoanother.

HookupExamples
Assembly

Beforeyoucanplugtheconverterintoyoursystem,youllneedtosoldersomethingintoit.Therearea
lotofoptionshere.Youcouldsolderstraightmaleheadersin,andplugitrightintoabreadboard.Or
perhapsyouwanttosolderwiresdirectlyintoit.Pickanassemblymethodthatmeldswithhowyou
intendtousetheboard.

OnceyourBDLLCissolderedup,itstimetohookitup.Yourhookupwillprobablyvarydependingon
whichcommunicationinterfaceyoureusing.Belowwellshowhowtohookthelevelconverterforthree
ofthemostcommoncommunicationprotocols.

UsingtheBDLLCforSerial
AlthoughyouwontbetakingadvantageoftheBDLCCsbidirectionalabilities,itsperfectlyfinetouse
theboardtoshiftserialcommunication.SerialusuallyrequirestwosignalwiresRX(receive)andTX
(transmit)whichbothhaveadefineddirection.Thesesignalscanbepassedthroughanyofthefour
channelsontheBDLLC.
Letssay,forexample,youwanttohookupanElectricImpBreakoutBoard(whichhasa3.6Vmaximum
inputvoltage)toanArduinoUnoviatheirUARTs.Heresonepossiblehookup:

MakesureLVispoweredat3.3V,andHVisat5V.Doublecheckthatthechannelsmatchup,anda
shiftingyouwillgo!Youveevengottwoextrachannelstoshiftasyouplease.

UsingtheBDLLCforSPI
TheBDLLCsfourchannelsareaperfectmatchformostSPIcommunications.SPIusuallyrequiresfour
wires:MOSI(masterout,slavein),MISO(masterin,slaveout),SCLK(serialclock),andCS(chip
select).ThesefourwirescaneachberoutedthroughachannelontheBDLLC.

Forexample,ifyouwantedtoconnectanArduinotoanADXL345BreakoutBoard,whichhasan
operatingrangeof2.03.6V,hereshowtheBDLLCcouldbesplicedin:

SinceeachofthechannelsontheBDLLCarebidirectionalanyofthefourSPIlinescangothroughany
oftheBDLLCsfourchannels.

UsingtheBDLLCforI2C
I2CisthecommunicationstandardwheretheBDLLCreallyshines,becauseitrequiresthatbothdata
andclocksignalsSDAandSCLbebidirectional.Eachofthoselinescanbepassedthroughanyof
theBDLLCslevelshiftingchannels.
Forthisexample,letskeepusingtheADXL345breakoutbutinsteadswapovertotheI2Cinterface.We
canevenaddanotherI2CdevicehowabouttheL3G4200DGyroscopeBreakout.SinceI2Cisonlya
twowireinterface,wehaveroomontheBDLLCtofitinacoupleofextrasignals,liketheinterrupt
outputsfromeachboard

Thetwo3.3VI2CdevicescanbothsharethesamelevelshiftedSDAandSCLlines.EvenmoreI2C
devicecanbeadded,aslongastheyhaveuniqueaddresses.

Resources&GoingFurther
HerearesomeresourcesrelatedtotheLLCandlevelshiftingingeneral:
BiDirectionalLogicLevelConverterSchematic
BiDirectionalLogicLevelConverterEagleFiles
BiDirectionalLogicLevelConverterGitHubRepo
PhilipsAN97055Anawesomeapplicationnotecoveringbidirectionallevelshiftingcircuits.

GoingFurther
IfyourelookingforaplacetousetheLLC,thesetutorialsmightsparksomeideas:
ElectricImpBreakoutHookupGuideTheElectricImpworksat3.3Vmax,soifyouinterfaceit
withany5VsystemsyoumayneedanLLC.
GettingStartedwithpcDuinoThepcDuinoisanother3.3Vbasedsystem.Thisisapowerhouse
comparedtotheElectricImp,though.ItcanrunLinuxorAndroid,andhasallsortsofawesome
functionality.
UsingtheArduinoProMini3.3VIfyouwanttostickwithArduino,andwanttouse3.3Vsensors,
considerusinganArduinothatrunsat3.3V.ThatwayyouwontevenneedtobotherwithanLLC!

You might also like