reading gate signals with digitalRead() from the "Tip Pin" works perfectly. But i am wondering how i can include the "Disconnect Pin" in my program. My goal is to programatically find out if a cable is connected or not via the "Disconnect Pin".
The signal on the "Tip Pin" is an input where i recieve 2V or 5V gate pulses from eurorack modules.
I have set it up without an internal pullup and attachInterrupt():
pinMode(tipPin, INPUT);
Is it possible to use another Arduino pin where i can do something like this pseudo code?
if(tipPin has connectivity to disconnectPin) {
Serial.println("there is *no* cable in the TS female jack");
} else {
Serial.println("cable connected - its time to digitalRead(tipPin) and process incoming signals from exactly that pin");
}
Thank you!
EDIT Due to @PerryBebbington feedback i have edited the problem description
The answer is probably yes, but unfortunately I cannot really follow your Fritzy diagram. Please can you draw a proper schematic, pencil and paper is fine, just photograph and upload the picture.
Thanks but I want a schematic for the whole thing, and in particular the circuit for and around at least 1 of the jack sockets showing the connection, what connects to what and the operation of the built in switch that operates when you put the plug in. Without that I'm guessing.
Your schematic does not even hint at a jack, let alone show any details.
That's MUCH better, I can now understand what you have and what you are asking. That hand drawn schematic is WAY better than your original Fritzy diagram.
The tip is pulled down by the 10k resistor and the BE junction of the transistor. The pin you labelled 'disconnect pin' will see the 10k resistor to the tip in series with the 10k resistor to the left of the diode then to ground via both the BE junction and the 10k resistor in parallel with the BE junction.
I suggest you connect the 'disconnect pin' to another input, configure the pin as INPUT_PULLUP and try reading the input and see if if reliably tells you if the plug is in or not. It mgth be wise to include a 10k resistor between the 'disconnect pin' and the input you connect it to in order to protect the input from whatever is on the tip of the jack. I would expect it to work but you need to check.
Just a note on forum etiquette, it is preferred that you don't completely change the original post but instead leave it as it was and provide the requested information as a new post, that way the flow of the questions and replies makes more sense to other people reading your question. I note you make a comment explaining what you did and why.
Thats really strange! Yesterday (before i created this topic) i did exactly that and It was not reliable at all.
But i have to admit that i used an analog pin with digitalRead().
Now i tried it again with a digital pin and an analog pin and its perfectly reliable.
Sorry for that. I will keep this in mind for the next time(s).
Yes, yesterday i tried INPUTandINPUT_PULLUP and both had heavy fluctuations in the results.
Maybe i messed up something else...
Thanks again for your help!
I suggest you do some more investigation, it is possible you did something wrong yesterday, it is also possible that what I suggested is not reliable. You need to know which it is.
There are plenty of those 3,5mm female jacks in my project and i thought that it does not matter on which jack i test "Disconnect Pin" functionality.
Unfortunately i tested this on an output jack. This has a very similar circuit but without the diode.
So now i was able to reproduce this unreliability from yesterday.
But on the input circuit (where i need this functionality) your suggestion seems to be rock solid reliable.
Thanks again!!!