How can I control AC current through a device so that I can control the brightness of say, a table lamp?
The basic AC control element for this kind of application is the triac (or thyristor). For interfacing with digital logic, an optically-isolated mini-triac is used first, and this mini-triac triggers the "big" triac that actually handles the high-voltage high-current load.
The datasheet for the MOC3010 opto-triac shows some sample circuits (Fig. 9, for example):
http://www.fairchildsemi.com/ds/MO/MOC3010M.pdf
--
Beat707: MIDI drum machine / sequencer / groove-box for Arduino
You are best getting a circuit ready made. These are known as a solid state relay, google it for lots of choice. You have to know the current rating. Also note there are two types, ones that support only on / off, these are often the cheaper, and those that support a PWM input or variable voltage input that will do dimming.
This seems like a popular SSR (cheap)
http://shop.moderndevice.com/products/solid-state-relay-8a
I have a hard time reading the stupid graph on the datasheet. I think it would need a pretty big heatsink for rated 8A. It will only switch < 1A in my project so I don't think I need to worry about heatsink.
For more on this, including a very safe, even if a little expensive ($20) answer, but other stuff too, see...
jvdb:
This seems like a popular SSR (cheap)http://shop.moderndevice.com/products/solid-state-relay-8a
I have a hard time reading the stupid graph on the datasheet. I think it would need a pretty big heatsink for rated 8A. It will only switch < 1A in my project so I don't think I need to worry about heatsink.
I'm using that series, and I like it. It needs about a 4"x4" metal plate heatsink if you want to drive it at full load IIRC.
Also, make sure you use a 180 ohm resistor to drive it from a 5V output pin -- else you may over-current it and blow the internal driver!
Sorry I couldn't reply for the past few days..
What's an SSR?
Solid State Relay