0

I am obviously new to Raspberry and Stack, but would be great if community can advice.

My setup is the following: - YwRobot 545043 power supply (controller) connected to the breadboard and to the Raspberry, which powers it (the controller) - the USB input from YwRobot is connected to LED lamps; once button on controller is switched on, LED are lighted up

What I want to do Connect the button on YwRobot to the Raspberry board somehow, so that when it is pressed, I receive input/output into the Raspberry

Use case is: Designing an alarm that through while loop will check current time, and when condition is met, it will turn the leds on; when button on controller or breadboard is pressed -- turns them off.

What I cannot figure: Is there a way to associate this YwRobots physical button with, say another button on breadboard that can send actual state of the buttoon back to Raspberry.

Essentially I need to link button 1 to Raspberry or to button 2

Here is an image below enter image description here

Much appreciate any ideas!

  • Here is a schema below .... no, it is not a schematic .... it is a picture of wires – jsotola Oct 26 '18 at 5:40
  • Indeed, sorry. The actual wiring is perhaps not that important, mostly to understand what I want to achieve – navuoo Oct 26 '18 at 14:52
  • As a last resort resort, you could, of course, cut the LED lamp's USB cord and wire the red and black wires within, through a transistor, to the pi's 5v power supply... Then you could read the button button using the GPIO pins and control the transistor using the GPIO pins. – scitronboy Oct 26 '18 at 23:51
1

You could have a separate power supply for the raspberry pi and connect the 3.3V power to a GPIO. Then, you could have a python program read the GPIO to see whether the button (1) was pressed.

Like:

Power->Raspberry Pi<-YwRobot 545043 power supply

Or:

YwRobot 545043 power supply->Button 2->GPIO

  • Thanks! The issue is I am not sure exactly how to wire Yw_Robot to the breadbboard itself. It has pins close to the button, but they don't seem to be configurable to read the input from the button – navuoo Oct 26 '18 at 14:56
  • On most power supplies like yours, button 1 is used for turning on or off the power supply. The green led indicates whether the power supply is on. – Unsigned_Arduino Oct 29 '18 at 0:18
  • Yes, it is, but the goal here is to connect the button on the power supply to the Raspberry, since I want to control USB output programatically. – navuoo Oct 30 '18 at 10:59
  • Yes so follow my post – Unsigned_Arduino Nov 5 '18 at 21:46

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.