I'm working on a smart watering system as a home project. I have a water output in my balcony (a tap) and I want to control the water flow using an Arduino Uno and a solenoid valve. I still don't have the valve but the specifications of it are listed here - I'm using Model No. SMOKVW-0516O4.7AC which is the last one on the list (at least that is the plan for now, but I hope to achieve general understanding of how to choose the right components such that even if I'm using different valve at the end, I can adjust the transistor and diode accordingly). My plan is to use a transistor to control the solenoid valve and to use a diode to handle the kickback. My problem is that I'm not sure which specifications of the transistor and the diode I need for this purpose, I've tried looking online for information but I didn't find anything that solved my problem. What I'd like to know is how to adjust the transistor and diode to the solenoid valve I'm using, the things that I'd be grateful if anyone can help me with:
- which transistor do I prefer to use? I thought NPN will be suitable since I need an amplification (my Arduino supplies 5V where the solenoid valve expects 12V input signal) although I also need it to behave like a switch, in order to turn on and off the valve.
- wich parameters should I check when selecting a specific model of a transistor? i.e. if I chose to use NPN, how do I know that the specification of the transistor will allow it to work as expected? how will I know it won't burn?
- I have understood that the solenoid valve has a "kickback" - a current flows in the opposite direction (from the valve to the arduino) when the valve is turned off, and to protect the board I need to add a diode. I'm not sure how can I calculate the current that suppose to be returned or how to choose the right diode?
Thank you very much for your time and attetion