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:
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: 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.