Receiving input from a standard touch lamp sensor

I tried searching for awhile and couldn't find any relevant info so I figured I'd post here for some help. A couple weeks ago I built a lamp from my old camshaft. I decided to make it more interesting and wired a touch sensor to it, but instead of grounding it to the body of the lamp, I connected it to my bed. Above my headboard is a metal rod so it is quite easy to just reach up to turn the lamp on and no wires are visible.

Now I'm starting on adding some ambient lighting to my room. I'm going to be using an RGB LED strip which will eventually interface with an Android app but for now I'm going to be using my computer to make it easier. Basically what I want is for the LEDs to turn white (or a matching hue I find) when the lamp is on. The touch sensor is a 3 level dimmer (4 if you count "off") so of course I will match the LED brightness as well. I'm thinking I'll have to have the sensor input into the Arduino somehow and then the Arduino will have to output the lamp and LEDs. I've noticed that when the lamp is unplugged/plugged back in it resets to off so I don't think the sensor is really keeping track of what "state" its in which means I will PROBABLY just get the same input from it and then output in different levels using code (I'll be able to smooth out the transitions too).

Here's the sensor I am using: Amazon.com

I'm not too sure about the specs besides what's listed but here is a wiring guide:

Sooo

  1. Will the Arduino even put out enough power? Since the lamp is (I'm assuming) 120V AC I'll have to jump through some hoops to control it? I'll be using a 9v just to test it since I haven't acquired a 12V adapter yet.

  2. How can I wire this thing up and read from it OR is there just a way easier way with another part that I can use instead? As long as it does the above functionality and isn't too expensive it's no big deal but repurposing things is always cool. 8)

This is my first actual attempt at a project besides starter examples. I'm pretty competent in coding so none of this seems very difficult to me in that respect but I'm not too knowledgeable on electronics. I have wired a lot of car accessories, can solder, etc, but the power specs aren't something I want to play with and start a fire so I'd rather ask you instead of doing trial and error.
If you read this far thank you and I appreciate any help you can provide! Please feel free to ask for more info/pictures/etc.

Your scaring me. Ok. First of all the ONLY thing you are going to change in the lamp wiring is not so much a change but the wire
labeled HOT needs to be cut (with the power off please) and a SSR solid state relay inserted with the output screws connected to the two ends of wire you cut. The arduino will turn the light on and off (if desired) with a digital output pin connected to the +V input screw (dc voltage input) and the ground for the input is connected to the arduino. The SSR will provide isolation from the 120vac. Everything else on the lamp stays exactly the same.

Sorry to scare you haha. What I'm saying is that I ALREADY have the touch sensor installed and I was seeing how to instead have it go through the Arduino. So I guess I'll just have to cut it out altogether and buy an SSR. But would that be controllable as far as dimness goes? If not there's really no point since it already has those features. I just wanted to operate the LEDs at the same time. But maybe I can just use the Arduino as a capacitive touch sensor and just connect that wire to the lamp's touch wire and then they will receive inputs at the same time thus getting a similar effect? Thanks for the info.

Think of the SSR as a little magic black box. The input terminals are on the left side and the output terminals on the right side.
(With lettering right side up)
The ground for the input is bottom left corner, There is no ground for the output because is is a solid state SPST RELAY (single pole ,single throw) . So the LINE (HOT) is connected to the output as described in Reply#1
The input terminals are what you connect the arduino to . GND=>GND , digital or PWM OUT => +V input pin.
digitalWrite gets you simple ON/OFF.
analogWrite (PWM) gets you a dutycycle controlled output, where 20% duty cycle (20% of 255) should result in 20% brightness.
Since it already has the dimming function built in , my recommendation is just use simple ON/OFF with digital write .

Actually the dimming function is part of the touch sensor so I would have to program that with PWM. But I'm pretty sure that's not gonna workout with an incandescent bulb. Will one of those LED replacement bulbs work? I feel like the easiest thing might just be doing what I said and putting an additional capacitive sensor wire with the other one so that the Arduino gets info when the lamp gets switched and then going from there. Or is that a dumb idea? Thanks.

You want to use small energies through Arduino to control larger energies through devices like transistors.

Have you put a meter on that dimmer controller you got?

Do you know how an older house incandescent dimmer works ?
Why are you saying that PWM control of an SSR controlled incandescent lamp would not work ? Have you tried it ? My recommendation is use pin 9 or 10 because those are 980 hz whereas all the other PWM pins are half that frequncy. Why don't you test it by wiring the SSR in series with the hot lead on a socket that has a power cord wired to it to plug in the wall so you can plug any ac powered device in it and dim it with the PWM. If it doesn't work, fine , at least you tried but don't jump to conclusions unless you can support your conclusion.

raschemmel:
Do you know how an older house incandescent dimmer works ?
Why are you saying that PWM control of an SSR controlled incandescent lamp would not work ? Have you tried it ? My recommendation is use pin 9 or 10 because those are 980 hz whereas all the other PWM pins are half that frequncy. Why don't you test it by wiring the SSR in series with the hot lead on a socket that has a power cord wired to it to plug in the wall so you can plug any ac powered device in it and dim it with the PWM. If it doesn't work, fine , at least you tried but don't jump to conclusions unless you can support your conclusion.

Yes I know how it works and the current touch dimmer on it works in the same way. My concern was using the Arduino to do this because I read this thread: Using Solid State Relays with PWM on an Incandescent Bulb - Wiring Help Needed - General Electronics - Arduino Forum (crtl+f retrolefty for cliffnotes). It seems like I have to buy a $50 w/ shipping ac dimmer to make it work...

@GoForSmoke I don't own a meter yet!

Lot of comments on using those dimmers:
http://www.amazon.com/Westek-6503BC-3-Level-Wire-In-Replacement/product-reviews/B00004XS95

Caveat: You never want to run a CFL with that thing! Better to make a variable shade.

I think that you want to wire the lamp as it should then simply run a wire from LAMP GROUND to your touch rod.

The wider blade of a US lamp lug is the "neutral" wire - on most lamp cords there's a rib or wale in the insulation surrounding that wire. Once you've confirmed which wire entering the lamp base is the neutral, it needs to be joined to the grey wire from the 6503BC and one of the supply wires to the lamp(s)...the one which is connected to the shell of the socket(s). 3 wires join together on this neutral leg.
The other wire from the plug, the one from the narrow blade of the plug, is the "hot". It needs to be joined to the black wire of the 6503BC. Usually just two wires at this junction, but if the fixture has multiple lamps there could be more. The supplied wire nuts can handle two or three wires if they aren't too stout, but for four or more you should acquire slightly larger wire nuts.
The second wire supplying the lamps(s), the one going to the base contact(s), is often (but not always) red...it connects to the brown wire of the 6503BC. Again, only two wires at this junction for a single-lamp fixture but you may have more.
Lastly, the yellow wire of the 6503BC connects to the metal body of the lamp fixture - it's the sensor lead that causes the unit to respond when you touch the fixture. Normally if there's a ground wire connected to the body it will be green in color. If there is no ground "pigtail" provided, connect the yellow wire directly to a metal part of the fixture which can be touched to control the lights.

I'm not really sure what you're saying I should do. The lamp already works. I can touch the metal rod and it turns on in 3 stages. I just wanted to reroute that through the Arduino so that I could turn on/dim LED strips at the same time. But now I'm getting the impression that I have to just toss that dimmer and rewire it in a very complicated way (it seems) to achieve that. That's why I was just wondering if it would make more sense to make a basic capacitive sensor on the Arduino and attach the wire to the same ground as the one I'm using for the lamp. Then I could turn on the LEDs as the lamp turns on. Not sure if those will interfere with each other somehow. Sorry if I'm misinterpreting and you're telling me how to do that and I just don't realize it.

You might want to play with capacitive sensing for a while then, including using the metal rod over your bed.
I've been able to use a jumper wire as a rock-solid cap sensor but by leaving the UNO open to static.
When I got that working on insulated wire, I only had to get inches close for it to read the same as touch.
I have used aluminum foil for sensors I could tune to know close from touch. That took a while.
You would need to make something that would not false because you rolled over in the night.

Try turning on the working lamp by touching it with a metal pole. IMO it should work. If so then a wire from the bed to the lamp should also work.

As far as the led strip, you could point a light detector at the lamp and use a positive read to light the leds.
You can even fit an Arduino into it and make things happen that a simple circuit would not.
But I wouldn't have the Arduino sending capacitive read pulses to something that is already being used that way.

Ok, I read RetroLefty's Reply#5 of this post:
http://forum.arduino.cc/index.php?topic=132107.0

The only part of that post I am referring to is the part about the bulb not lasting if you use PWM to switch the SSR. I think my description of the wiring procedure was clear so there's no need to talk about that. Maybe your idea about a LED bulb is the key to making it work with PWM switching the SSR.