Go Down

Topic: my port unplug every time i run the sketch (Read 295 times) previous topic - next topic

mikehaw

hey guys, nowadays i met a problem and i cannot find any solutions on the net.

I make a tilt-pan camera use servo MG996R and a usb camera, i write a script in arduino to move the tilt-pan camera to follow my face.

and the face detect part, i use the face++ api in Processing3.0, communicate with arduino by serial port.

Problem: when i run the processing, open the camera, the servo only move several steps and suddenly the port unplugged.

I tried in win10, every time the port unplugged, i'll hear the sound that signs the usb device unplugged.

and in win7, after the servo stopped, i cannot find the port on arduino, the port is grey.

What should i do? please help me guys.

Wawa

I hope you didn't power the servo from the Arduino.
Because that could fry the Arduino as well as the computer's USB port.

Please read the "how to post" sticky.
We can't give you a meaningful answer with that limited amount of information.
Leo..

slipstick

That's my guess...you have that power-hungry servo connected to the Arduino 5V pin and whenever you try to move the servo the voltage drops and the Arduino resets itself.

If you're lucky you haven't yet damaged the Arduino but the servo NEEDS a separate power supply. 4 x AA batteries would probably work, preferably NiMH rechargeable AAs.

Steve

jremington

#3
Jun 04, 2019, 05:12 pm Last Edit: Jun 04, 2019, 05:12 pm by jremington
Quote
in win7, after the servo stopped, i cannot find the port on arduino, the port is grey.
That is because you are drawing too much power from the USB port. You will have to restart the PC.

As stated above, use a separate power supply for motors and servos. Don't forget to connect the grounds.

mikehaw

I hope you didn't power the servo from the Arduino.
Because that could fry the Arduino as well as the computer's USB port.

Please read the "how to post" sticky.
We can't give you a meaningful answer with that limited amount of information.
Leo..
I hope you didn't power the servo from the Arduino.
Because that could fry the Arduino as well as the computer's USB port.

Please read the "how to post" sticky.
We can't give you a meaningful answer with that limited amount of information.
Leo..
oh thank you for your reply, sorry again for didnot obey the rules.
sorry, poor english.

Go Up