How to Connect Device to Relay?

Hi, I have a relay that I am trying to use to control a device (such as a desk lamp) via an Arduino and was wondering how I would actually connect the device to the relay. (The relay I purchased can be found here: http://www.amazon.com/gp/product/B0057OC5O8)

In short, how would one go about taking any normal, say, 2-prong desk lamp and connecting it to a relay? Do I have to cut its wire and wire it that way, or what is the best thing to do?

Thanks in advance.

Leave the lamp's cord intact. Wire the relay to a socket, in-line or panel mount (on a box).

What do you mean by "wire the relay to a socket"? Could you either explain this or point me to an article or something? I tried searching for it but couldn't really find anything.

Thanks again.

Sorry but if you have to ask that you are not ready to play with mains, it could kill you or cause a fire. Best to get a ready built unit like those that control mains with IR signals. Then do the IR stuff with the arduino.

In short, how would one go about taking any normal, say, 2-prong desk lamp and connecting it to a relay? Do I have to cut its wire and wire it that way, or what is the best thing to do?

Don't "distroy" the lamp.

For temporary-experimental purposes, you can splice the relay into an extension cord. But, you gotta' be careful, and you might want to put the relay board in a plastic box, or wrap it in electrical tape while you're playing around.

Sometimes a regular electrical box (like the kind inside your walls) works really well, and is very economical. You put your relay in the electrical box, and simply plug-in the lamp. But, you'll have to make sure the relay board and the outlet both fit into the box.

You just go the hardware store and get an [u]outlet box[/u], an [u]outlet[/u] or two, and a [u]cover plate[/u]. Outlet boxes come in various sizes and in plastic or metal. Make sure you get one that fits the outlet. In the U.S., an outlet-plug and light switch have the same mounting holes and fit into the same-size rectangular box.

You'll also need a power cord so that you can plug-in your relay box. The easiest way is to pick-up an extension cord while you're at the hardware store, and whack-off the female end. Or you can get some lamp cord and a plug, and make the power cord yourself.

As an alternative, you can get an [u]AC outlet socket[/u] that you can install in your "project box". But whenever it's practical, I like to use a separate high-voltage "relay box" and a separate low-voltage box for my regular low-voltage electronics (the Arduino, etc.). (There has to be some low-voltage going into the relay box to turn the relay(s) on & off.)

Briggsman, as for wiring, look this topic I have made few days ago :)

http://arduino.cc/forum/index.php/topic,126434

Thank you for the helpful responses. I think I'll make a trip to Home Depot or something and pick up an outlet box and cover plate and get working.

Don't worry Grumpy_Mike, I'll be safe :)

Thanks again everybody. I'll post back if I have any troubles in assembly.