Pages: [1]   Go Down
Author Topic: Arduino UNO won't stay connected  (Read 361 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

This is my first post on these forums. I am looking for a little help on a school project I am working on. I need to control a servo motor by using an IR proximity sensor. I have the base code written and it works, however when I upload the code and run it the board has trouble staying connected to the computer and it continuously resets itself and won't run smoothly. I originally thought it was an issue with the computer so I connected the board to an external power supply (9v battery) and the same problem occurs. The board resets itself all the time and won't run the program smoothly.

Any assistance in helping me solve this problem will be greatly appreciated.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What happens when you try a different sketch?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have had mixed results with different sketches. I loaded a sketch to just do a sweep of a servo not using any input and it ran fine one time, another time it would reset randomly and twitch and it didn't matter if it was connected to the computer or the battery. I was also able to run a sketch just to output the data from the sensor to the serial monitor , not run the servo at all, and it ran fine.
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1857
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It sounds like your servo is drawing more power than the Arduino can supply.  You probably need to wire the servo motor to a separate power supply, and just have the control come from the Arduino.  Be sure to connect the grounds of the two power supplies.  DuaneB wrote a tutorial on how to wire up servos: http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html.

Note, that you will not be able to use pins 9 and 10 for PWM functionality for other items on an UNO with a servo.  I ran into this when I tried to use an LCD shield (which wanted to use those pins) and a servo.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply. I will try wiring another power supply for the servo today or over the weekend and see if that solves the problem.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, powering even a single servo from either USB power or one of those wimply 9 volt batteries is asking for problems, so many before you have experienced the same problem symptoms. 9 volt batteries are for powering smoke alarms not arduino projects.

Lefty
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try a different power supply, and make sure it is smooth. Maybe you should use a DC power supply and regulate the voltage.
Logged

Pages: [1]   Go Up
Jump to: