Hello! For a project, I'm trying to control a 3 wires valve (this one : 12VDC 1/2" Motorized Brass Ball Valve).
The valve has 3 wires : yellow for ground, red to open and blue to close. So if I connect Vin, which is 12V (from my arduino with a power source), to the red wire and the yellow is connected to ground, the valve opens. If I connect Vin to the blue wire and the yellow wire is still connected to ground, the valve closes. If neither blue or red wires are connected to Vin, the valve remains in its current position.
I have a circuit that can open and close my valve if I switch manually the blue and red wires (see image circuit-initial) which comes from Controlling A Solenoid Valve With Arduino - BC Robotics.
I want to be able to choose automatically which wire, blue or red, to give current to with Arduino. I could then tell my Arduino to put one pin HIGH, the other LOW, so the valve would open; or inverse the states of both pins so that the valve would close. The third option is to put both pin LOW so the valve would not be alimented.
I think a combinaison of transistor TIP120 would do the trick but I'm not so good with electronics, so I really need help. I though to connect the first branch of a TIP120 to a pin of my arduino (with 1K ohm resistor), the second branch to the blue wire of my valve and the current of the circuit that work (as describe earlier) and the third to the ground. It started heating up.. (see image Essai2-surchauffe)
In brief, I want to know how to connect : pins from my arduino to transistor(s)/diode/resistor to the circuit that works (see image circuit-initial) so that I can choose which wire of my valve is powered.
Please help !!
From what I read on that page the valve has two leads to power it and ground - this means that
you need two switches to control it, and that they need to be high-side switches.
So a TIP120, being NPN isn't suitable. You need PNP BJTs or p-channel MOSFETs, and you'll need
something to level-shift 5V logic to 12V to drive these switching devices. Or two relays.
Google "high side switching".
Could also use one relay module for open/close, with 12volt to common and red/blue to the NC/NO contacts.
Then you are sure only one direction can be powered at the time.
The TIP120 can switch the ground line (yellow wire), low-side, for on/off.
An Uno can only power one relay module when powered with 12volt on V-in.
Hi ! Thank you so much for your answers!
SO I went to buy TIP125 which are PNP BJTs and I saw on this website
(see figure 3) https://www.baldengineer.com/pwm-3-pin-pc-fan-arduino.html (after googling"high side switching")
that I should be able to open/close the valve with a combinaison of PNP connect to NPN. So I did the circuit that I attach (see Capture d'écran). And nothing is happening... Could somebody tell me what to change ? I'm really lost!
My code is really simple just doing one of the pin LOW and the other, on HIGH.
My valve is working; I tested with a battery 9V (I saw that the valve was moving even though the power is not enough to actually move it perfectly). So, I really think it is my circuit!
The TIP120, when active, is shorting the base of the TIP125 to ground.
Likely instant death for the TIP125. The TIP120 will eventually also fry.
Must have a 1k resistor between base of the TIP125 and collector of the TIP120.
The TIP120 could be a small-signal transistor (BC547, 2N2222 etc.), because it's only switching milliamps.
The resistors between base and Arduino pin could be 10k.
Finally, the circuit I send in picture does work good !
I will try to put bigger resistors to make it more safe!
Thank you so much both of you !!!!