Transcript
Page 1: 1.How to use 1 GPIO Pin to drive RaspberryPi Power-on-off ... · Tutorial 1 How to use 1 GPIO Pin to drive Raspberry Pi Power-on-off-status light The default indicator light of Raspberry

Tutorial www.52pi.com

1

Howtouse1GPIOPintodriveRaspberryPiPower-on-off-statuslightThedefaultindicatorlightofRaspberryPiistheredLEDlightnexttothepowerlight.Aslongastheraspberrypiispoweredon,itwilllightup.Itishardforustoknowwhethertheraspberrypiisonoroff.Itisevenhardertonoticethedifferencewhenyoufittheboardintoacase.Soifyouwanttoplacetheindicatorlightoutsidethecase,youmaycheckoutthistutorial.

ElectronicComponents:

1*RaspberryPi3ModelB1*RedLEDlight1*220Ohmresister1*Breadboard 2*Male/femaleDuPontJumpWire

InstallationDiagram:

ConnecttheGPIO26Pinsto220Ohmresistorfirst.Thenconnectittothereddiode.

Youmayrefertothisdetaileddiagram:

Page 2: 1.How to use 1 GPIO Pin to drive RaspberryPi Power-on-off ... · Tutorial 1 How to use 1 GPIO Pin to drive Raspberry Pi Power-on-off-status light The default indicator light of Raspberry

Tutorial www.52pi.com

2

ConfigurationModification:First thing first, run a command to boost the function of Device Tree which will enable yourraspberrypitobecompatiblewithmoredevices.Takealookattheuserguide:sudovim.tiny /boot/overlay/READMESearchforgpio-poweroff Poweroffmeans that the indicator lightwill not light upwhen the system is shutdown. You caneasliytelliftheraspberrypiisturnedoffproperlybycheckingtheindicatorlight.ThedefaultIOintheofficialusermanualisdefinedasIO26andthelatestsystemhasgotwiringPi.ItisveryeasyforyoutosetupandyoumaytakethissetupasthewarmupfortheApplicationKit.HereisthescreenshotfortheofficialREADME:

It is loaded by editing /boot/config.txt and by adding this command for module initialization:dtoverlay=gpio-poweroff,gpiopin=26,active_low Whenitisupdated,restarttheRaspberryPi:sudo sync sudo init 0Theindicatorwilllightupwhenthesystemisrunninganditwillbeturnedoffasthesystemisshutdown.Inthisway,youcaneasilytellthestatusoftheRaspberryPi.WhenyouDIYsomeinterestingapplications,youcanplacetheindicatoroutsidetoevaluatethestatusofthewholeoperation.


Top Related