So I've been trying to make a capacitive sensor where as I go up and down the foil the brightness of LED changes. I have not been successful yet. Have any of you tried such a project before and if so do you have any tips or methods I can do to accomplish it? Thanks
Get one of these.
You could have 12 levels for your LEDs.
.
Why start another thread when you already have one on this project?
You could have edited the title of the other one. I just replied there.
The other thread:-
http://forum.arduino.cc/index.php?topic=408685
My last reply in the other thread:-
Are you using a laptop or desktop computer? You need a good earth connection from the UNO to true ground.
Also, since you're using an UNO, re-read Larry's reply #7. On an UNO, pin 13 is not a PWM output, so cannot be used for 'analogWrite()'. It will go high or low depending on the value written, but it won't dim at all. (As I mentioned in reply #11.)
Can you take a high resolution photo of your setup and post it?
That other thread provides more background for the problem.
Why start another thread when you already have one on this project?
So much for me paying attention
.
LarryD:
So much for me paying attention.
I really only noticed because I'd only just replied to the original thread moments earlier.
So far, everything points to a hardware problem, since the result printed in the serial monitor is a constant value, never changing. A photo will help a lot.
So I'm now using pin 9 on my arduino. In the picture, a 220k resistor is between the led and pin 9. Led is connected to GND. On the breadboard there is 10M resistor and pin 4 is send pin and 2 is receive pin. The white cord goes to a strip of aluminum foil (not pictured)
That's fine and all, but you will not be able to sens a position on the foil. Only contact or no contact. The position on the foil will not change the capacitance...
Is there a way I can make it so it can sense the distance of my finger from the side and that can then lower or increase brightness of my light as I move my finger?
There is a change in capacitance depending on the distance between your finger and the foil. You could try to force multiple distances from the foil with tape or something. But I'll doubt you'll get a good reading / have resolution enough. If build a captive touch sensor like that before and found it to be hard enough to get a solid distinction between touched and untouched no matter the humidity and type of shoe material...
So if you want a slider, just buy a IC of module that can do so.