So I just finished my project and everything works fine, but if I connect the arduino using any other cable than the one I used before, or even if I use USB extender I get "The last USB device you connected to this computer has malfunctioned and windows doesn't recognize it" error message.
Any idea how could I fix this?
Seems as if those USB cables are not liked by your Arduino/PC combination.
If possible get another USB cable (from a friend) of which you know it is fully working and try again.
If the error also occurs with that able, my technical wisdom is at its end (although with Windows: you never know, that's why I like Linux or Macs); if it works - throw away the other USB cables or mark them as "not compatible with Arduino".
I tried multiple cables and made sure they worked with other device, even if I just use brand new extender with the working cable it won't work. I had no idea a USB cable could make a difference...
Also: avoid using USB 3.0 on Windows together with Arduinos. Too many problems.
What do you mean extender cable.
If you mean a USB HUB then it should be a POWERED HUB and USB 2.0
rpt007:
Also: avoid using USB 3.0 on Windows together with Arduinos. Too many problems.
It was 2.0
Ballscrewbob:
What do you mean extender cable.
If you mean a USB HUB then it should be a POWERED HUB and USB 2.0
Just female/male cable, I need a bit longer cable than the one that works, I tried other cables on their own and they didn't work so that doesn't seem to be the issue.
Well, get out a working cable and the non-working cables, get your multimeter, set it to resistance mode, and poke around and find out what's different.
This isn't rocket science - either the cable is a charging cable and the data lines are either cut or connected to a few resistors (to emulate the passive signaling of how much current a charger can supply), or the problem is excessive resistance in the cable - consider that the resistance is applied both ways (5 ohms each way means 10 ohms total, so even the 50mA of an Uno with nothing added to it will result in half a volt drop!), or the cable is straight-up bad and one or more wire isn't connected.
I have seen some horrifyingly bad extenders - 4 ohms each way before you plug another cable in series with it. Extenders are often used for very low power devices like mice/keyboards, thumb-drives, etc, so the el-cheapo manufacturers can get away with using hair-thin wire to save money, and most people won't notice, and the ones that do - what do you do when a $2 cable turns out to be crap? Buy another from someone else, nbd - you're not going to try to wrestle the money back from the cable maker (and if you tried, you probably wouldn't get anything anyway) so they ain't worried about customer satisfaction.
So it seems that the length was the issue, my classmate has the same issue, after he got slightly shorter cable it worked fine. All cables I tried were pretty long (1.5-3m) so that might be the issue.