It is a common practice that all pins accessing the same net should have the same label; labeling that pin anything but VIN could be more misleading. The behavior you are asking for on the small VIN pin is not unreasonable, but there are also other reasonable functions it can have, you can’t just assume it will be what you’re expecting.
You haven’t answered my question about what your connections are, but I can infer that you are basically doing what you said: shorting 12V to 5V, which will mean your motor battery will be dumping a bunch of current into the Arduino. Since Arduinos don’t have a diode preventing current from flowing into your computer, you will, in turn, be dumping a bunch of current into your computer’s USB port. This has a good chance of breaking the USB port on your computer and is probably why your computer rebooted.
Unfortunately, there isn’t a good way to power the SMC from the Arduino in a way that lets you connect and disconnect the motor battery. What you can do instead is power both the Arduino and the Simple Motor Controller from the same battery. Instead of connecting the Arduino’s 5V to the SMC’s VIN (something you should never do) connect the SMC’s VIN to the Arduino’s VIN. Or, connect the battery leads to the SMC and the Arduino directly. If you do this, you should be able to plug the Arduino into USB and it probably won’t break your computer, but you should be aware of this other issue with the Arduino letting current flow into computers when it is externally powered.
Alternatively, you could plug both devices into USB and have them talking to eachother without the motor battery.
- Ryan
