Eliter wrote:So, I want to get started with projects that control things outside of the Raspberry Pi. I notice that if I hookup the motor a a small RC helicopter, it turns off the computer, since it drains power. I found out that I need a relay for the Raspberry Pi, so the Raspberry Pi can flip a connection on, and the thing being controlled is being powered by something else.
I have found lots of 5V relays, some saying its for arduino/Pi. So, there's only 4GPIO pins that produce 5V, and I want to be able to use all 8 GPIO pins. How would this work? Do I need different relays? Do I need to do fancy stuff?
I also have a $10 budget for relays. So, keep a price within reason.
You are a bit confused on the GPIO.
In the 40 pin header there are 17 programmable pins which are the 'real' GPIO's.
There are also several other special purpose pins which can be used as GPIO when needed.
In the 40 pin header, there are also 8 GROUND pins, 2 full time 3.3V POWER pins and 2 full time 5V POWER pins. The GROUND and POWER pins are not really GPIO but many call them that.
Regarding the relay. I would suggest to get a relay board and not try to use a 'raw' relay. The relay boards have the control transistors and protection diode built in and have screw terminals to easily wire things up. They usually have an indicator LED to show when the relay is on or off.
You can get relay boards with 1, 2, 4, 8, or more relays on one board. Often referred to as channels For example: 4 channel relay board etc. http://www.sainsmart.com/sainsmart-rela ... ry-pi.html
Don't confuse the coil voltage with the relay input controls.......
When they say 5V relay they mean the electromagnetic coil voltage. Relays coils come in several voltages.... 5V, 12V, 24V are the most common.
You can use the 5V POWER pin on the RPi to power the coils as long as there are not too many. It would be best to use a separate power supply. You have to use a different power supply of course if using anything other than a 5V relay.
The relay board has 1 control terminal for each relay which is what you connect the GPIO to. (1 GPIO per relay).
Google will provide all the information you need. There are hundreds of Raspberry Pi relay tutorials etc.