BlindAssassin111:
Ok, so maybe it is just me but I don’t see how that would help me right this moment…If I have a pos./neg. attached to the arduino that goes to the ground bus for the car, and I have a pos. lead that goes from the switch on the paddle shifter to the solenoid that actuates the pneumatic piston. I need some way of telling when the switch closes but I only have that pos. lead, no ground from that.
Perhaps I should have labelled that schematic better but that bottom line is the common ground. The same reference point that ties the battery - terminal, the alternator (if there's one) - terminal and usually the vehicles frame together. It's the same ground reference for any voltage, including the paddle shifter. Since the Arduino GND pin is also tied to that common ground, you don't need another ground wire from the paddle shifter, all you need is the switched "battery voltage" (ranging from battery 12+V to the alternator 14+V).
So when the paddle switch is open, there’s no voltage applied to the top of R1. R2 makes sure there’s some (weak) path to ground for the Arduino digital input pin and so w/o any voltage, the pin will be read as a LOW. When there is 14+V applied, the R2 and R1 try to make a voltage divider. If the zener were not there, the voltage at the pin would be :
14+V * (R2/{R1+R2}). If R1 = R2, then you’d get 1/2 the applied voltage, which would be 7+V and that’s too high for a 5V input pin. So you get an ~5V zener (4.5-5.1V is OK). Now, if there’s enough current, the zener is said to “break over” and conduct current in what would be a reverse direction for any normal diode. The beauty of a zener is that this happens at a known voltage.
So let’s do some conservative calculations … I want at least 2 mA to flow through the zener under worst case conditions and that, for this part of the calcs, is at the lowest voltage. So let’s say the battery could get down to 12V and still run the vehicle. The current through R1 is set by the voltage difference btw the “battery” and the zener divided by R1 (Ohms law). Some of the current through R1 will flow through the zener and some through R2. The amount through R2 is the voltage set by the zener/R2 (Ohms law again) So :
(12V-5V)/R1 = (0.002A min + 5V/R2) and since we decided to have R1 = R2 :
7/R1 >= 0.002 + 5/R1 or …
7/R1 - 5/R1 >= 0.002 or …
(7-5)/R1 >= 0.002 or …
R1 <= (7-5)/0.002 <= 1000 ohms
1K ohms is a nice round number so let R1 = R2 = 1k ohms !!!
Now check on power dissipations at the highest expected voltage. Let’s have the alternator run to 15V. Since the zener will still be ~5V, the current through R2 is the same. By Ohms law I = V/R so IR2 = 5/1000 or 5 mA. Power is V*I and so PR2 = 5V * 0.005A = 0.025W, aka 25 mW. Since resistors are generally 1/10 or 1/8 W rated (100 or 125 mW), R2 is safe.
The voltage across R1 is now 15V - 5V (set by the zener) = 10V That’s 2X what R2 is seeing and since R1 = R2 it’s 50 mW and so R1 is just safe enough (safety factor of 2) for me.
What about the zener ? If at high voltage 10 mA is flowing through R1 and only 5 mA through R2, the rest must be flowing through the zener … that’s 5 mA. That’s the same as through R2 and so the zener must also be dissipating 25 mW. Since most are 500 mW, it’s safe too.
So all is good and even slight differences in the numbers above won’t change the analysis enough to make a distinction.
BlindAssassin111:
I also have another Idea to run by you, If I were to make the neutral LED a separate circuit and just have the neutral signal somehow connected to the LED and power to get it to turn on would that be an easy job? Would I just put power to the anode with a resistor that dissipates the needed voltage and then the cathode attached to the neutral switch, so that when the switch is grounded, the LED turns on or will this not be a good idea? I have a different idea for the whole setup sequence, that no longer requires the neutral signal going to the arduino) but for right now I will just stick to figuring out wiring, then move on to coding.
You certainly could have a neutral light independent of the Arduino. You could just stick any 12V bulb between the neutral switch and the "battery". When the ground is applied, the light comes on. If you want to be hi-tech, use a resistor and an LED. One end of the resistor goes to the "battery" (12-15 V). The other end is connected to the + end of the LED. The - end of the LED goes to the neutral switch. Same as before, when the ground happens (in neutral) the circuit is complete/closed and current flows from the "battery" through the resistor and LED to ground. The LED lights up. The value of the resistor depends on the LED chosen. There are online calculators for this. But in general most LEDs are "happy" w/20 mA flowing through them, 30 mA MAX ! LEDs have a nominal voltage, called Vf, that varies w/the color of the LED. Red LEDs have the lowest Vf, perhaps ~ 1.8V. Blue and "white" LEDs, the highest, about 3.2V. Similar to the calcs above, you determine R from the current (20 mA) and the voltage difference (highest battery - Vf). So R might range from (15-1.8 )/0.02 = 660 ohms to (15-3.2)/0.02 = 590 ohms. A standard value of 620 ohms might be a good compromise. Higher values if you want a dimmer LED for night time vision.