element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Raspberry Pi Power Status LED Indicator
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 5 replies
  • Answers 1 answer
  • Subscribers 676 subscribers
  • Views 2683 views
  • Users 0 members are here
  • raspberry
  • status
  • help
  • pi
  • led
  • power
  • newbie
Related

Raspberry Pi Power Status LED Indicator

b8a
b8a over 9 years ago

Hey guys, I have recently gotten my new Pi 3.

I am loving it and am thinking of making myself a custom case for it.

However I have searched and searched and cannot for the life of me find out how I can wire up 2 LEDs in order to show the power status.

 

In other words, I want to find out how I can create a circuit that will have a red LED on when the Pi is off and a Blue LED on when the pi is on.

 

Thanks in advance.

 

PS: I am still quite new to the electrical  spectrum.

  • Sign in to reply
  • Cancel
  • royleith
    0 royleith over 9 years ago

    It depends what you mean by 'on' and 'off'. The Raspi does not have the traditional circuitry of a desktop computer that powers down the power supply when the operating system closes down. That is what a desktop uses to turn the power light on and off.

     

    The GPIO 5V pin is at 5V as long as the external PSU is delivering power. If your case had a power switch, it would be easy to arrange a simple circuit powered from the PSU side of the switch that lit a blue light when there was 5V at the Raspi and a red light when there was not, but that does not indicate when it is safe to turn the power off because it does not show if Rasbian is running or not.

     

    The only useful indication is the red LED on the Raspi that shows when the PSU is supplying power and the green LED that flashes four times and then goes off when Rasbian closes down. I don't know if that works for other Raspi OSs.

     

    I don't know of any way that those LED indications can be extended to external circuitry. If that were possible, then a logic circuit could be devised to convert Green 'On' and Red 'On to the lighting of a blue LED and Green 'Off' and Red 'On' to a Red LED 'On' (an AND logic gate - Output '0' lights red and '1' lights blue).

     

    Many commercial cases make the on-board LEDs visible by using light pipes or a transparent case or lid. However, each new Raspi seems to have the LEDs in different positions which makes the light pipe method of limited use.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 9 years ago

    I would try to get code that sets gpio pins for OS initialized and OS shutdown. See raspberry pi - Run code in python script on shutdown signal - Stack Overflow that will help. I leave for you how to turn on or off the actually lights. Nice idea BTW.

    Clem

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • b8a
    0 b8a over 9 years ago in reply to royleith

    Hey Roy,

     

    Thanks for the quick reply.

    I am adding a momentary push switch and a python script that monitors for the button press and performs a safe shutdown and a boot.

     

    So therefore it is safe to assume that when the button is pressed and the pi turns on the Blue LED would turn on. As soon as the switch is pressed again the pi will perform a safe shutdown and the Red LED can be turned on while the blue one goes off.

     

    Thanks in advance

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • b8a
    0 b8a over 9 years ago in reply to clem57

    I was thinking that as well.

     

    But I just do not know how to go about that.

     

    Would I be able to use the Pi's GPIO pins to select the LED by the high or low state of the GPIO?

    Is there a pin that is low when the pi is off and high when it is on?

     

    Thanks in advance

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to b8a

    That's a great idea for the push switch to safely turn the device off, something the raspberry pi would really benefit from! Once you export a gpio pin you can set the direction of the pin to be an output pin. Setting it's value to 1 will make it go high 3.3v and setting it to 0 will make it go low 0v. I haven't checked for certain but I would assume that the pins are always low when the raspberry pi is powered down so it should be simple enough to work a solution with indicator led's

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube