Ive tested with 1 dc motor and a relay connected with the arduino
So with a relay connected directly to an arduino?
and it worked perfectly
What sort of this was this? Was it just a functional test or a parametric test. If you have connected a relay coil direct to your arduino you have almost certainly damaged it. It might still function but probably not for long. Do you know the current the coil is pulling? Anything 40mA or over has damaged it.
Also why are you posting a hardware question here. look at the top of the page and it clearly states:-
Using Arduino with other software (Processing, Flash, PD, MaxMSP, etc.)
This section is NOT for the software problems you get when interfacing hardware!