Let's say I have a 10v switching circuit that I want to use to control the digital pins on an arduino. Is it valid to couple the two circuits like this? Photo is attached.
It will kill several parts.
Explain please.
Use a voltage divider or optocoupler.
When the switch is closed the positive end of the capacitor will jump to 10V. The negative end will have no option but to follow it, but as it's already at 3V3 it will jump to 13V3, killing anything connected to the 3V3 supply not capable of withstanding 13V3, which is probably everything. And all that is assuming the capacitor hasn't already exploded because of the reverse voltage applied to it before the switch is closed.
I guess I thought that the negative end of the capacitor would jump to -10v, therefore, negating the +3.3v on the arduino and pulling the digital pin low. at (-6.7v)
But you're saying that a +10v on the positive end will result in a +13.3v voltage on the circuit negative end?
By the way, thanks..
Certainly the circuit you have drawn isn't the way to go. At best it will do nothing. At worst it will burn the Arduino.
Question: you have drawn a ground symbol on the left of the diagram. Presumably this belongs to the 10V source. But you don't show that ground connected to the Arduino's ground pins. Is there a reason why? Is it not safe or not possible for some reason?
If so, then an opto-coupler is the way to go.
But if you can safely connect the 10V ground to the Arduino ground, then a voltage divider is the simplest solution. Two equal resistors will reduce the 10V to half of that, which is ideal for an Arduino digital input pin.
What are you trying to do? Explain in general, don't assume that any circuit is the answer.
example, trying to detect a switch being made.
I don't know why you think that.
In order for the voltage across a capacitor to change then some current must flow into or out of it. The maths for this is that for a 1F capacitor the voltage across it will change by 1V in 1 second for a current of 1A. The steady state of your circuit has the negative end of the capacitor at 3V3 (because it's connected to 3V3) and the positive end at 0V (because it's connected to 0V through a 4k7 resistor). Now, I'm making an assumption here, which is that the charge of the capacitor has stabilised at -3V3, in other words that it has been powered for long enough* to charge through the resistor to that voltage. When you close the switch the instant the switch is closed the voltage across the capacitor does not change, so if the positive end goes up by 10V then so does the negative end, by the same amount. Wait a while and this will change as the capacitor charges or discharges into the 3V3 rail, but by that time the smoke will have escaped from whatever is connected to the 3V3 rail.
*Rule of thumb is that the capacitor will have reached it's fully charged state by the time of 5RC seconds. So that's 5 x 4700 x 0.00047 = 11 seconds for your circuit.
See:
https://www.allaboutcircuits.com/tools/resistor-capacitor-time-constant-calculator/
As stated, a simple voltage divider would work. (R1= 6.8k (connected to 10v), R2=3.3k , connected from R1 to GND.)
