I have done a project like this, where the USB is communications link from an embedded device to be plugged into a PC, similar to using RS232 in the good old days. Meanwhile, the device operates on its own, whether its USB is attached or not. . For keeping the power supplies separate, just don't connect anything to the USB connector's pin 1. They have a common ground, but the power supplies are separate. If you think something may take its power from the that USB jack, then you are confusing hosts and devices, and several large dissapointments are headed your way. We'll assume not, and that this thing really is a device. . As to sensing when it's connected, this is not done by detecting power supplies, but rather by detecting that one of the data lines has been pulled up. (Can't find which right now, but I believe it is D+). These lines are normally pulled low. When the cable is plugged in, one of the lines goes high. You connect a 100K resistor from that line to one of the PIC I/O port pins. The firmware watches for that pin to change state. The source code has a #define that lets you say which port pin you used for this. . One more firmware note. This may have changed in later releases, but the USB firmware I got sat in an infinite loop waiting for the connect to happen. Needless to say, the rest of the firmware was hung until that happened. It was an easy enough matter to change the code so that it polled for that connection in my application's main loop instead. Just something else to watch for. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist