Hello Everyone,
I'm trying to detect if an Arduino-based device is connected to the USB with a simple transistor (the Arduino is also battery powered but the VCC connection from the USB and the battery don't interfere with each-other so lets simply ignore that as it should not matter).
I made a simple circuit with a NPN transistor which works great for doing this but I would like to check first with you guys as I'm not sure if this would cause any problem long-term:
USB VCC is 5V when connected
The Arduino PIN is set to pull-up (3.3V)
The Arduino pin has an interrupt so it when it changes it simply reads the PIN, if it's 0 then the USB is connected, otherwise it's disconnected.
Should I change something in my circuit?
Thanks in advance!
I'm trying to detect if an Arduino-based device is connected to the USB with a simple transistor (the Arduino is also battery powered but the VCC connection from the USB and the battery don't interfere with each-other so lets simply ignore that as it should not matter).
I made a simple circuit with a NPN transistor which works great for doing this but I would like to check first with you guys as I'm not sure if this would cause any problem long-term:
USB VCC is 5V when connected
The Arduino PIN is set to pull-up (3.3V)
The Arduino pin has an interrupt so it when it changes it simply reads the PIN, if it's 0 then the USB is connected, otherwise it's disconnected.
Should I change something in my circuit?
Thanks in advance!
Last edited: