Timeline for RaspberryPi touch sensor using transistor
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 19, 2021 at 14:07 | comment | added | mdre | Firstly, thanks for the response. However I'm not sure if that is quite the problem. Even when constant touch input without movement is applied, the output still swings. Couldn't it be due to the (rookie speaking) resistance that it is barley enough to register the input, so sight fluctuations are enough to shoot off the correct value? From how I read it, this would more solve the problem if it were only at input change that such fluctuations would arise, but I'm happy to learn if I should be wrong | |
Feb 19, 2021 at 12:49 | history | edited | jwh20 | CC BY-SA 4.0 |
edited body
|
Feb 19, 2021 at 12:47 | comment | added | jwh20 | I'm sure the issue is due to random elements in the input signal. This is similar to switch "bounce" when you might be using a switch on the input of a microcontroller. The simplest solution would be to handle it in your software by averaging the input over time. You can also do this in your circuit by introducing a filtering element such as an RC circuit. I've updated the circuit in the answer to show you a possible solution. Experiment with different R and C values to see what gives you the desired performance. | |
Feb 19, 2021 at 12:43 | vote | accept | mdre | ||
Feb 19, 2021 at 12:43 | comment | added | mdre | hey jwh20, I finally got to try out your suggestion. It works a lot better than before, so thanks already. However even with this setup, I get inconsistent ouputs, probably due to the touch connection. That is to say that the GPIO.IN jumps at times. It would be lovely if you could point me into the direction, on how I can get a reliable signal, that is to say reliable off state when touch contact is present. Cheers! | |
Feb 16, 2021 at 13:25 | history | edited | jwh20 | CC BY-SA 4.0 |
added 442 characters in body
|
Feb 16, 2021 at 13:22 | comment | added | jwh20 | I updated the answer with a suggested circuit that might help. | |
Feb 16, 2021 at 13:22 | comment | added | mdre | I just saw the edit you made and will try that as soon as I can. Thank you! | |
Feb 16, 2021 at 13:20 | comment | added | mdre | Okay, if I didn't misunderstand that, your saying the voltage arriving at the GPIO.IN pin is too low, no? So could I switch the 330 Ohm resistor for say 100 without hurting the LED since our resistance overall has increased? | |
Feb 16, 2021 at 13:20 | history | edited | jwh20 | CC BY-SA 4.0 |
added 358 characters in body
|
Feb 16, 2021 at 13:15 | comment | added | jwh20 | that's because your circuit is not able to pull the GPIO pin (which I assume is setup for input) to a low enough voltage (i.e. Vil) that is will read a logic 0. | |
Feb 16, 2021 at 12:57 | comment | added | mdre | Currently the diode leads to a ground connection, from which I cannot read whether the base is touched ( / the LED is on). So I connected another GPIO Pin after the LED, instead of the Ground. However, the LED is dimmed and the GPIO in pin shows a LOW value.. | |
Feb 16, 2021 at 12:51 | comment | added | jwh20 | GPIO read what voltage? It's not at all clear what else you are asking or what you are trying to do. | |
Feb 16, 2021 at 12:43 | comment | added | mdre | That is already very helpful to understand, thanks! Concerning the rest of the question, do you know why the GPIO pin doesn't read the voltage. I could imagine the resistance increasing as the GPIO becomes the ground, but admittingly I don't know at all | |
Feb 16, 2021 at 12:39 | history | answered | jwh20 | CC BY-SA 4.0 |