How much ohm resistance I should put between tp120 base and uno?
To calculate you need to know the maximum current the solenoid uses. The TP120 has a gain of around 500-1000. So the current going into the base needs to be 1/500th of the current going through the solenoid. 

So now you know the current needed. Then you can calculate the resistance value you need with R = V/I. So R = 5 / ( &lt;solenoidcurrent&gt; / 500 ). 

So with e.g. a 2A solenoid, you get a value of 1.2kOhm.