First draw a timing diagram. I'll use NO switches for both sensors.
Up Sw ___| |________________________| |_______
Dn Sw ________________| |_____________________
Up SV |____________| |________
Dn SV ___| |_____________|
Then draw the circuit schematic.
simulate this circuit – Schematic created using CircuitLab
Figure 1. Modified circuit.
Hot it works:
- Hitting the top sensor triggers the SET input on the latch. This turns on Q1 and powers the Down SV (solenoid valve).
- As the actuator moves away from the top prox sensor it turns off but the latch maintains the motion.
- On reaching the bottom sensor the RESET input is activated and the Up SV is turned on reversing the motion. If an NO sensor is used here NOT1 can be omitted.
Could you get away with a 2 wire proxy sensor...
Yes. But these have leakage current as the sensor requires power even when off. For that you need a pull-down resistor. The resistor value needs to be low enough that the input voltage to the latch is low enough to ensure that you always get a logic zero on the input when the switch is off.
Also is there any reason that the Up/Down SV's are in a NPN config.? As this may be an issue with the signal going to the Digital Counter.
It's the normal way of doing things, often because the logic is 3.3 V or 5 V and the load is higher voltage. (See High-side fail for an explanation.) What you have sketched should work OK.
D9 is doing nothing so you can leave it out. D14 is a bad idea as it gives you two different ground voltages. In any case, it's redundant if you have D9 in.
simulate this circuit
Figure 2. Updated schematic.
A couple more items:
- CMOS logic can be run at > 12 V so that would be a good choice for the latch.
- Regarding your regulator question. It might be a good idea to add one to prevent vehicle voltage spikes reaching your logic but this will reduce the voltage to below 12 V so now you have to limit the voltage from your sensors and you're back to NPN switches for the solenoids. Some local filtering - a choke and capacitor - may suffice.
... this may be an issue with the signal going to the Digital Counter.
No. It will be looking for low-high transistions. It won't know the difference.