Hi all. Nice to meet you all and glad that I have a chance to join this group=)Recently, I will do my final year project with the title of "Smart Home Control Using Brain Wave". Yet, I am not really sure on which arm that I should choose><Could you all give any suggestions to me?
Thanks and best regards,Seet Ting Ma
thanks for yr replies.
by the way, i discover that raspberry pi need to equipped with pi face then only it can be used to to control LED, sensors and so on...is it true?
No, you do not need any extra hardware, because the GPIO pins are available to you.
The PiFace you're thinking of may contain relays; these are for turning on/off things that require more power than a LED.
The only things you need, in order to control LEDs are ...
One wire connects one end to VCC on the Raspberry Pi, the other end to the resistor.
The free end on the resistor should be connected to the anode (plus, long pin) of the LED.
The cathode (minus, short pin) of the LED should be connected to the second wire.
The second wire's other end connects to a GPIO port of your choice on the Raspberry Pi.
You should now configure that GPIO pin to output, then you can switch the LED on/off by changing the pin's value.
The 1K Ohm resistor is chosen, because the light won't blind you, plus it will make sure that the GPIO pin can handle the current going through the LED.
If selecting a stronger resistor, the LED will become brighter, but be careful; if it's too strong, it might draw too much current for the Raspberry Pi to handle.
You will need to find out how much current a GPIO pin can sink and calculate the strongest resistor value you can use.
(The lower resistance, the stronger the resistor is, and more current will flow through the resistor)
Example if VCC is 3.3V:
3.3V / 33000 Ohm = 0.0001 Ampere = 100uA. The LED will be completely off, no matter what you do.
3.3V / 3300 Ohm = 0.001 Ampere = 1mA. If you're lucky, the LED will be lit, but the light will be very weak.
3.3V / 1000 Ohm = 0.0033 Amperes = 3.3mA. This should be safe for all microcontrollers.
3.3V / 100 Ohm = 0.033 Amperes = 33mA. This is most likely too strong a resistor; the GPIO pin might get fried after a while.
The above actually applies to any microcontroller.