SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By jflygare
#96201
I am interested in creating capacitive touch switches to replace the wall switches in my house. I would like it to fit inside a standard switch box and work through a decorative (dielectric) material... Glass, Wood, Ceramic, Plastic, etc... so I can create custom looking switch panels. I have found a couple of commercial products but they are prohibitively expensive. I have also researched some common IC solutions like the Amtel QT100 or the AD7746 (offered by sparkfun) and this looks promising, but I would rather find a through hole chip rather than surface mount as I am not really equipped to work with SMT.
It would also need to be powered off the wall power. Does anyone have some guidance? I am surprised I have not found more about this as I would assume this would be popular alternative to the standard wall switch.
By angelsix
#96235
This is one of my todo projects also as I would like to create a cap touch light switch that is fully enclosed and powered from the original wall sockets, however I have not yet got around to it or researching much about it yet. If space isn't an issue (which I don't think it will be once measured) a simple isolating transformer and bridge rectifier and some other bits could be used to get a clean 5/3V supply from the mains to power a single uC that is connected to the facia as a capacitive input using an in-built capacitive touch circuit to detect touches such as the mTouch from Microchip, and then switching the live feed as needed. Shouldn't be a bit thing to do but like I say I haven't got around to it yet.

The main thing is going to be making sure there is no way during operation that the facia can connect to the mains supply as this would be very bad!
By gmarsh
#96247
Technically anything you put behind a wall plate has to be CSA/UL/whatever approved. If your house burns down, and the fire inspector finds the source of the fire was a homemade gadget behind a wall plate, you might find yourself liable. Likewise if someone gets zapped by a malfunctioning switch. So see if you can buy something that's been put through the industry testing before you build it yourself.

Another thing is, depending on how the house is wired lots of times you won't find a neutral in a wall switch box - often times houses are wired with hot/neutral/ground cable brought to the light fixture, and a hot/switched-hot/ground cable brought from the fixture to the wall switch. In this case, you won't be able to power your project unless you draw current through the load. (And depending on the load, this might not be reliable.)
By angelsix
#96261
My old man is a spark with 30 years experience and he is very safety ortiented when it comes to the regs, so I'm sure I could pass the idea by him and get an acurate description of the reg requirements next time I see him.

I'm sure the regs are a lot simpler than most think though, and just requires that whatever unit comes off the mains had to be done so from a fail-safe isolating unit that is B?? something-something approved. Then anything after that at a lower voltage (12V or lower I think) has no regulations governining it. Of course this is unconfirmed I just remember hearing him mutter something the last project I did for an outdoor fake alarm that stepped down from the mains to 12V so it may have different regs around it regarding indoor usage and switching.
By jflygare
#96309
Good points. I would have to take the insurance risk into consideration. I am still interested in how this can be done. I have found this commercial product:
http://www.futurlec.com/TouchSwitch.shtml
But it is apparently not yet available. The makers posted a couple how-tos on the Silicon Chip site
http://www.siliconchip.com.au/cms/A_30884/article.html
http://www.siliconchip.com.au/cms/A_30637/article.html


I also found this article which may have some great info:
http://www.siliconchip.com.au/cms/A_103314/article.html

However the site requires a subscription (pretty pricey too). Each article is available for about $6. I am tempted to pay for the article. Though it suggests the project is using a PIC and the guts from a commercial remote switch. I would be surprised if there was not a more simple way to do this without the need for a PIC.

I figured I would ask you pros first before forking over the dough on an article that is going in a different direction that I would prefer.

UPDATE: I just found the following schematic:
http://www.discovercircuits.com/PDF-FILES/120v1out.pdf

I have not studied this much but it seems like it may need better isolation from the mains. Anyone have any thoughts on this design?
By rrpilot
#96327
Microchip has lots of good app notes for this sort of thing.

Mains transformerless power supplies: http://www.microchip.com/stellent/idcpl ... e=en021083
Interfacing to AC power lines: http://www.microchip.com/stellent/idcpl ... e=en011013
Designing with HV Microcontrollers: http://www.microchip.com/stellent/idcpl ... e=en026622

Several PIC's available in DIP package have a Charge-time Measurement Unit (CTMU) peripheral which can be used for capacitive touch sensing as well. Honestly I have no experience in the subject so I am unaware of any safety concerns as others have mentioned, I just came across all the info and thought it might help you out.
By boj
#146476
Sorry to be really late to this post, but I found an Arduino library called CapSense that turns any conductive surface into a capacitive sensor. So what I'm going to do is take a small perfboard, put an ATtiny85 and a 16 Mhz crystal on it, and wire it up to a 220volt 30 amp relay, and for the sensor, I'm going to paint a pad of Bare Paint on the wall and punch a nail through to the circuit. Then, I will paint over the Bare Paint with normal paint and I'll have a very hidden light switch.
By Mee_n_Mac
#146483
boj wrote:Sorry to be really late to this post, but I found an Arduino library called CapSense that turns any conductive surface into a capacitive sensor. So what I'm going to do is take a small perfboard, put an ATtiny85 and a 16 Mhz crystal on it, and wire it up to a 220volt 30 amp relay, and for the sensor, I'm going to paint a pad of Bare Paint on the wall and punch a nail through to the circuit. Then, I will paint over the Bare Paint with normal paint and I'll have a very hidden light switch.
Please report back as to how well it worked. I tried capacitive sense "stuff" a long time ago and came away disappointed. Time has marched on and I'm curiuos as to whether things have gotten better.
By boj
#146505
Mee_n_Mac wrote:
boj wrote:Sorry to be really late to this post, but I found an Arduino library called CapSense that turns any conductive surface into a capacitive sensor. So what I'm going to do is take a small perfboard, put an ATtiny85 and a 16 Mhz crystal on it, and wire it up to a 220volt 30 amp relay, and for the sensor, I'm going to paint a pad of Bare Paint on the wall and punch a nail through to the circuit. Then, I will paint over the Bare Paint with normal paint and I'll have a very hidden light switch.
Please report back as to how well it worked. I tried capacitive sense "stuff" a long time ago and came away disappointed. Time has marched on and I'm curiuos as to whether things have gotten better.
I'll be sure to do so! My dad just brought home some higher voltage wire and higher voltage screw terminals so I don't burn the house down, and I'm ordering the ATtiny tomorrow. Thanks for the interest in my project!
By n1ist
#146531
Please use a power supply that has a transformer for isolation. Transformerless power supplies can be quite dangerous if you are not careful and can easily blow up you or your computer if you are not careful.
/mike
By boj
#146537
n1ist wrote:Please use a power supply that has a transformer for isolation. Transformerless power supplies can be quite dangerous if you are not careful and can easily blow up you or your computer if you are not careful.
/mike
I was thinking of having a regulated 5volt transformer coming from a nearby outlet and running in the wall to the ATtiny.
By rrpilot
#146569
I used the CTMU unit on an 8-pin PIC microcontroller (DIP package) on a recent project and it worked great. My assembly was rather sloppy as I was fitting everything in an completely enclosed wax structure and there were surprisingly no issues. The touch sensing was used as an interface from the outside of the structure to the inside. I will say though, it took a bit of tweaking but once I got my sensing algorithm down it worked a treat.
By boj
#146706
rrpilot wrote:I used the CTMU unit on an 8-pin PIC microcontroller (DIP package) on a recent project and it worked great. My assembly was rather sloppy as I was fitting everything in an completely enclosed wax structure and there were surprisingly no issues. The touch sensing was used as an interface from the outside of the structure to the inside. I will say though, it took a bit of tweaking but once I got my sensing algorithm down it worked a treat.
I'm going to just use an ATtiny because I don't have to write any more code (besides porting everything to an 8 Mhz crystal). I soldered up the SparkFun circuit to drive the relay with an Arduino (without shorting out) and it works great. Scroll down on this http://www.sparkfun.com/tutorials/119 tutorial for a schematic. I hot-glued some high-voltage screw terminals onto the relay and I am now wiring them to Common and NC.

Edit: Sorry, forgot link.

Edit 2: Done wiring the terminals to NC and Common, and poured hot glue all over it. I'm still procrastinating the SFE order and I'm not going to order it for at least another month because I'm going out of town and if I ordered them today they wouldn't be here until after I left.