1

I am completely new to Raspberry Pi and electronics so please forgive my lack of knowledge but I am trying really hard to learn something new. I have tried searching the forum but things said in any post soon confused me :lol:

I am looking to create a "magic mirror" using magic mirror 2. I plan to buy this kit https://thepihut.com/collections/raspberry-pi-kits-and-bundles/products/raspberry-pi-starter-kit?variant=20336446079038 and add 2 of these buttons https://thepihut.com/products/rugged-metal-pushbutton-with-red-led-ring?variant=27740444561, 1 for power/shutdown and the other to dim the display/hide modules.

Firstly if I have understood correctly the buttons on their own would both need connecting to it's own GPIO pin (any available) and GND pin to function?

Assuming the above is correct what I don't understand is the LED side of things. Where and how do I connect these? Do I need a resistor? I would like these to be illuminated at all times even when switched off if possible (I don't think it is). I'm not interested in flickering when it boots or anything.

Any help would be greatly appreciated and any advice on where to start learning would be amazing!

  • Welcome Andy! Next time consider multiple questions. Can I assume you have a tester/multimeter? Are you familar with the notion of Normally Open / Closed contacts? – MaxDZ8 Sep 8 at 12:39
  • Fair point on asking multiple questions, I just assumed it would be easier with it being 1 project. As for a tester/multimeter, no I don't have one yet, I haven't brought anything yet, I'm still in planning/learning but I do understand the importance of having one. I wouldn't say I am fully aware but I have heard the term mentioned in terms of buttons. Like I say, I'm a complete beginner. – Andy Roe Sep 8 at 13:23
  • the button switch and the illuminating LED are two completely separate devices – jsotola Sep 8 at 22:11
  • @jsotola Thank you, I think this is probably the main cause of confusion for me with my lack of electronics knowledge I think I now understand what I am to do. – Andy Roe Sep 9 at 10:26
1

The buttons need connecting to a GPIO and either a 3V3 pin or ground. Ground is probably a more usual choice.

The LEDs need a resistor. Without a resistor they will consume as much current as they can and will burn out with a bright flash.

A few LEDs have built-in resistors. This should be made quite clear when you buy them. Otherwise assume you need a resistor.

If you want the LEDs permanently on you don't need a GPIO. Just connect power pin to LED to resistor to ground.

Without power a LED will be off.

Typically you would wire GPIO to LED (anode) to resistor to ground. But again you could wire GPIO to LED (cathode) to resistor to 3V3.

| improve this answer | |
  • So from what I see on the button's page, it does have built in resistor although I don't see the size anywhere. I have seen everyone using pins 5(GPIO 3) & 6(ground) for the button, The LED states to connect to 3-6v so I assume I can choose which I prefer? Is there any benefits to either? – Andy Roe Sep 8 at 13:33
  • @AndyRoe any voltage below 6 V is safe for the led in the button because the current limiting resistor is built in ... it won't light below 3 V .... you have to add another resistor if the button is too bright – jsotola Sep 8 at 22:18
  • @jsotola Again thank you, my assumptions were correct on this then :) – Andy Roe Sep 9 at 10:31
1

If you search you will find several tutorials on creating a magic mirror using a Pi.

The MagPi magazine has published a couple and there are projects on the Foundation website. e.g. https://www.raspberrypi.org/blog/build-a-magic-mirror-in-issue-54-of-the-magpi/

These have full instructions.

| improve this answer | |
  • I appreciate your help and the link will definitely be of some help as I was unaware of MagPi However this and no article or video I've seen showed adding a button to the project. That being said, like i said I appreciate the fact you brought my attention to some great learning material :) – Andy Roe Sep 9 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.