Re Capacitive sensors

Hi
I am new to computing and the arduino, so forgive me for sounding dumb ?

But i am trying to use 1 off capacitive sensor to control 5 leds ? is this possible ?

I have looked back through the library and various sketches but non seem to do this !

I am ramping the sensitivity of the sensor up by using 2 off 2 M resistors in series and am using it

more as a proximity switch that as you get closer to the sensor it turns more and more leds on.

Likewise when you pull away it will turn each led off ?

Is this possible ?

Please help ! if possible ?

Regards

Phil

But i am trying to use 1 off capacitive sensor to control 5 leds ? is this possible ?

What does control mean in this context? On-off, brightness?
Possible? Maybe. How hard is it to test with a short sketch? Experimenting is allowed.

Sounds possible.

Start by taking readings, printing those on the Serial monitor so you have an idea of the values that come out of it, and at what distance you start to see an effect. Based on that, set a series of if statements switching on/off the LEDs. That's about all there is to the sketch part.

The hardest part is probably stability of your sensor, to get consistent values for distances.

groundFungus:
What does control mean in this context? On-off, brightness?
Possible? Maybe. How hard is it to test with a short sketch? Experimenting is allowed.

Thanks for replying.
When i write a sketch and i try to check to see if the code is good it comes back with red lines and{ " etc...
and i think i dont want to blow up the uno ?

the closer i get to the sensor i want the led,s to switch on:

Led 1 on at 50-100 then off
Led 2 on at 150-200 then off
led 3 on at 250-300 then off
led 4 on at 350-400 then off
led 5 on at 450-500 then off

likewise when i get further away the above happens in reverse !

I tried something similar a while back and was not real successful. The correlation between distance from the sensor and the voltage (capacitance) measured was very inconsistent. That is why I suggested experimenting.

When i write a sketch and i try to check to see if the code is good it comes back with red lines and{ " etc...

Post the sketch and the compile errors in accordance with the guidelines in the "how to use the forum-please read" stickies (see #7) and we can try to get your sketch working. Then you can see if you can make the project work the way you want.

pandmairconltd:
Led 1 on at 50-100 then off
Led 2 on at 150-200 then off
led 3 on at 250-300 then off
led 4 on at 350-400 then off
led 5 on at 450-500 then off

That’s easy.

digitalWrite(LED1, (reading >= 50 && reading <= 100) ? HIGH : LOW);

and the same for the rest of the LEDs.

But are you sure about those values? if you have a reading of say 422 no LEDs will be on. Make the ranges consecutive, or even overlapping a bit. Also you’ll have to set the values based on experimenting.

wvmarle:
Sounds possible.

Start by taking readings, printing those on the Serial monitor so you have an idea of the values that come out of it, and at what distance you start to see an effect. Based on that, set a series of if statements switching on/off the LEDs. That’s about all there is to the sketch part.

The hardest part is probably stability of your sensor, to get consistent values for distances.

Thanks for your reply

hello i got the arduino start kit (arduino uno r3)

i build the kit #13 capacity sensor

the kit work when powered with usb cable

but the kit donot work when powered with a 9v battery (jack connection)

why ?

please help me

Grounding.
Capacitive sensing stands and falls with it.