I need a voltage source for an Arduino analogue input. I'm making a capacitive sensor with an NPN BC548B transistor. In the emitter, I connect the GND, in the collector, I connect the analog port of the arduino, together with a 5v and a 10k resistor. So, when I'm not touching the transistor's base, there's no GND to interact with the voltage divider, and the arduino reads 1023. When I touch the transistor, GND is activated and current flows the collector producing a voltage across the 10K resistorand the arduino reads something much less than 1023, sometimes almost 0, like 12 or 50.

Since I want to read multiple capacitive sensors, I bougth a 74HC4051 chip to multiplex all the sensors. My idea was to include the voltage divider after the demultiplexing, so I would use only one transistor and one resistor at the port 0 of the arduino, and I'd only switch between the sensors using the multiplexing. The problem is that when I tried to do that, it didn't work, I got lots of random values in the reading. Also, in this scheme: enter image description here

he uses the voltage divider for each LDR before the demultiplexing, not after. Is there a reason behind it? I believe that the 74HC4051 chip has some internal resistance, but I thought it'd work even with this tiny resistance. Is there something I'm making wrong?

Here's what I am doing:enter image description here In this scheme, I can read exactly as I intended to do, but when I try to switch the transistor base with the multiplexer, it will present strange results. Also, I couldn't just wire each 'analog 0' of the scheme to a different port of the multiplexer, it'd use too many transistors and resistores.

  • 3
    \$\begingroup\$ I think you are describing a resistive sensor, not a capacitive one. \$\endgroup\$
    – HandyHowie
    Oct 4, 2015 at 19:03
  • \$\begingroup\$ The 4051 will multiplex analogue voltages, but you are trying to get it to multiples a current. \$\endgroup\$
    – HandyHowie
    Oct 4, 2015 at 19:07

1 Answer 1


I see that you got your sensor schematic from the lucaszanella website.

Generally it's a bad idea to connect the transistor's base directly to a pad that anyone will be toughing with their finger. An electrostatic discharge can damage the base and short to 5V. Although 5V seems benign for most people it can be deadly for people with pacemakers.

What you should do is put a 10 mega Ohm resistor between the base and the sensor input.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.