I have a Raspberry Pi 1 Model A and have a simple hobby project I'm tinkering with. I will have two pushbuttons (
PB2 respectively) wired to the GPIO pins, as well as a buzzer and an LED. The idea is to power this on with batteries.
When the pi is powered on, Raspbian will start up and a syste service (daemon) that I write will start up. Once this service is running it will power on the LED and keep it turned on until the service shuts down or the pi is powered off (obviously).
If both PB1 and PB2 are pushed at the same time, this running service will detect this and will cause the buzzer to sound. If either pushbutton is released the service will detect this and turn the buzzer off. Really simple. (Yes I realize I could accomplish this without the pi but there's more to the story here.)
I want to make sure that the hardware I've selected is compatible with my pi (especially the buzzer) and that I'm not gonna fry my pi.
- RadioShack brand (275-1566)
- Momentary Pushbutton Switch
- Contacts rated at 3A at 125VAC; 1A at 250VAC
- RadioShack brand (276-0307)
- RadioShack brand (273-0793)
Can I wire these components directly to my pi's GPIO pins or should I put any protective elements (resistors, etc.) in between them? Keep in mind that there would be periods of time when all of them would be operating at the same time (the pushbuttons are being pushed, the LED is being lit up and the buzzer is sounding). Or are there other parts with different ratings that I should be using? What types of batteries would work for this project (it's fine if I have to replace the batteries often, they don't have to be heavy duty this is just a toy project). Thanks in advance!