i'm just starting to use arduino for a project and have a few questions.
i want to turn on 4 different lights using motion sensors - by now, i already have an arduino uno and know that i'll need an extra shield to deal with ac electricity.
any other recommendations? i might end up using normal light bulbs, so i'll need cables. anything i should consider when buying cables and bulb sockets?
any useful tutorials or comments highly appreciated. thanks!
If you are having to ask these questions you are in no way ready to start playing with mains.
and know that i'll need an extra shield to deal with ac electricity.
No with that one you won't.
You need a mains SSR (solid state relay) and a competent electrician to wire it up.
Alternatively you can hack into the remote control of an X10 module, that will keep your fingers out of the mains.
First off you provide a proper link not a photograph so we can see what current it takes, and what the spec is.
Then you need to work out if it has a constant current drive in it. If not you then have to build a constant current drive for each of the lamps. You will also need an external power supply that can provide that current.
One idea besides the relay which would probably be easier would be to get a project box from Radio Shack and some light switches from Home Depot/Lowe's and have a servo manually switch the switch on and off.
I think I saw an example of this on Hackaday.com ages ago.
more:
but this is just an example. i'd need something that's (almost) as bright as a "normal" 60watt light bulb.
How far from your Arduino do you need these lights and sensors to be? If you can avoid the need to go with mains power you could run 12V lights (for example) from a car battery or similar, and switch your lights with a relay shield (like this one http://www.seeedstudio.com/depot/relay-shield-v12b-p-693.html). That example uses 4 digital pins on the Arduino so you still have enough to read the PiR inputs on a Uno (Arduino Shield List: Seeed Studio Relay Shield shows the used pins).
If you're running with the PiR motion sensors you need to provide them with power and ground, and the 3rd wire comes back at 5V to be read by an Arduino pin, so there won't be a need for the additional proto-shield you mention in your first post in that scenario since it doesn't appear you'll be needing any other components.
The data sheet for that PiR sensor says it can be powered between 5-12V so with a 12V setup you could even run the sensors on the same power as the lights (unswitched of course!) so the Arduino doesn't need to power them...lots of options.
more:
but this is just an example. i'd need something that's (almost) as bright as a "normal" 60watt light bulb.
How far from your Arduino do you need these lights and sensors to be? If you can avoid the need to go with mains power you could run 12V lights (for example) from a car battery or similar, and switch your lights with a relay shield (like this one http://www.seeedstudio.com/depot/relay-shield-v12b-p-693.html). That example uses 4 digital pins on the Arduino so you still have enough to read the PiR inputs on a Uno (Arduino Shield List: Seeed Studio Relay Shield shows the used pins).
If you're running with the PiR motion sensors you need to provide them with power and ground, and the 3rd wire comes back at 5V to be read by an Arduino pin, so there won't be a need for the additional proto-shield you mention in your first post in that scenario since it doesn't appear you'll be needing any other components.
The data sheet for that PiR sensor says it can be powered between 5-12V so with a 12V setup you could even run the sensors on the same power as the lights (unswitched of course!) so the Arduino doesn't need to power them...lots of options.
They require 12 Volts, so straight away your Arduino's 5Volts isn't going to light them, even if it did have enough power. The Arduino only has a total of 500 mA to play with, to power itself and whatever you run from it. This means anything like powerful lights will need external power, with the Arduino providing switching only.
could you tell me how i would go on with building something like this?
I presume you've got these bare, and they're not mounted in a downlight string that steps down from mains to 12V DC for you. If so my approach (I'm no expert so ignore to your taste) would be to firstly wire up the lights where you want them, and back to your 12V source. Because they draw so much I'm thinking a car battery is a good choice, with something to trickle charge the battery to keep it topped up. Once you have the lights proven and working, run your sensors to your arduino and make sure they trigger as planned, and finally switch the lighting through your arduino controlled relays.
would any 5 to 12 volt relay work?
Many, most probably? Sorry to be so vague but you'll need to ensure that whatever you choose can be triggered by the 5v 40mA max available to you at an Arduino pin. I looked up the first random relay on Element14 that is triggered by 5V and it has a nominal operating power of 200mW, which is right on the edge...so it's clear there will be choices that won't work.
Remember also if you don't use a shield you'll likely need to add some kind of resistor in each of those relay circuits. If you're unfamiliar with why, google Ohm's law or watch Jeremy Blum's excellent tutorial on the subject here http://youtu.be/abWCy_aOSwY/ . If you don't have a data sheet on the relays you're thinking of using you can find out what resistance they have across the coil using a multimeter and size your resistor to suit.
I really don't know how you'd work out their power consumption without a data sheet. You could try them on the Arduino and see if they trigger (I'm hoping the Arduino's internal fuse would save it from being harmed by a bad choice, but someone with more knowledge on the subject might know better).
If you want to keep it simple, the shield might be the best bet for you.