Is it possible connecting both a serial USB (for uploading and serial.print) and the external 24V supply (for powering sensors) can cause problems.
I had been creating a sketch like this without any issues on my laptop. My sketch uses :
- 2 analog inputs connected to 4-20mA sensors (powered directly by the 24V out on the Arduino)
- 2 digital outputs connected to 24V relay switches for rotating a valve
- Ethernet port for configuration via web server
- USB-A mass storage device for writing logs on USB stick
Yesterday I moved the Arduino to the production site where there is a desktop computer instead of laptop. I connected only the analog sensors to test them first. After a minute or so (showing correct readings from the sensors) the power supply suddenly shut down.
Thinking the power supply had failed for some reason I connected a different supply and everything worked again. But then I saw the 12V and 24V leds on the Arduio dimming. At this point I disconnected the USB cable (by mistake , instead of disconnecting the power supply). However, to my suprise the power leds came back on and the sketch kept running fine.
But now the USB ports are completely broken. The Portenta H7 is still running my sketch but does not appear as a COM port on the PC, not even when putting it in bootloader mode by double reset (and getting pulsating green led). Also a USB stick connected to USB-A connector is no longer being recognized by my code.
So it seems both USB ports are fried and it was related to the desktop PC. Someone at work told me you shouldn't connect both USB and external supply to an Arduino because it creates an issue with different grounds. But it seems to me this should not be the case for the Portenta Control since otherwise most official example sketches don't even work since the ports require 24V
When you can include a schematic of the project and show the 24 volt connections, then someone may have an idea of what happened.
It seems you may have applied a high voltage to the USB port.
Not all Arduinos properly isolate power from the USB when using an external power supply. Many people use a special isolation cable (typically by opening the +5V line) or an isolation adapter to prevent this issue.
I work a lot with 12V and 24V setups, usually with the UNO or standard Nano, which have built-in protection. I always check the schematics to confirm this. 24V is approaching the limit of some semiconductor protection devices.
There's a high chance the motherboard was damaged, which might require replacing an SMD chip. It’s also possible you just blew the 5V line. In some cases, the USB port is protected by a resetting thermal fuse, which could reset after powering down and allowing it to cool.
Regarding your desktop, you can possibly fix the issue by installing a new USB expansion card for just a few dollars. This card will have its own connectors and typically won’t interface with the built-in USB ports.
I found this in the Arduino Portenta Machine Control schematics. The 5V from the MicroUSB and 5V from the external 24V power supply seem to be joined with two shottkey diodes. Does this means any current on the 5V rail is simply divided over both supplies?
Also I learned that by connecting the MicroUSB to a desktop PC instead of a laptop, I have grounded the Arduino's GND to earth (through the PCs powersupply). But I still do not understand how this could have caused any short that made the powersupply (not connected to earth btw) go in protection mode and destroy both the microusb and the usb-a connectors
Also if I connect a different working Portenta H7 module to the Machine Control board, the micro-usb connector works again but the USB-A one still does not.