Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: futurrobotech on December 25, 2010, 07:06:33 PM

Title: Arduino questions
Post by: futurrobotech on December 25, 2010, 07:06:33 PM
okay so I have a few things that I'm not 100% sure about and im try to avoid frying my board. If I have servos could I hook them into the arduino by running a wire from the 5V out and a ground. Also when it comes to modifying servos is there any alternative to super-gluing the pot?
Title: Re: Arduino questions
Post by: Graynomad on December 25, 2010, 07:17:00 PM
You need the GND connection but servos really should be driven from their own PSU, they will draw too much current for the little regulator on the Arduino and also can be noisy which may cause problems.
Title: Re: Arduino questions
Post by: rbtying on December 25, 2010, 07:21:29 PM
You can hook at most ONE (1) servo into the 5v output of the Arduino, and even that will draw a little too much current.  Use a high-current switching regulator or unregulated 4.8v-6v for the servos.  Like Graynomad said, you will need common grounds.

You can use two resistors with equal resistance to make a voltage divider, instead of gluing the pot, but it's not really any easier, or less permanent.
Title: Re: Arduino questions
Post by: futurrobotech on December 25, 2010, 07:35:53 PM
okay thats no problem I have a 5 V regulator.. And I'll probably use a 9V battery.. I might just super glue the pot then.. I was trying to find someway with out getting super gluee.... (I'm a little accident prone lol)
Title: Re: Arduino questions
Post by: tipipliou on December 28, 2010, 09:19:45 AM
I might just super glue the pot then.. I was trying to find someway with out getting super gluee.... (I'm a little accident prone lol)
it's by far the best way to do it ,don't worry,you can  do it easily  ;D
Title: Re: Arduino questions
Post by: VegaObscura on December 28, 2010, 01:50:44 PM
Just remember, that glue will wear off your fingers in just a couple of days and you'll be able to move them again!
Title: Re: Arduino questions
Post by: futurrobotech on December 30, 2010, 08:28:25 PM
I gave in and I've got super glue.. not all i gotta do is get my arduino software working so i can 0 the servos  ::)
Title: Re: Arduino questions
Post by: futurrobotech on December 31, 2010, 02:36:52 AM
okay guys im having a problem getting the servos to work with the arduino.... I have a 5V regulator and where the servos are the output is 4.4 Vs.. I plug it into the arduino and plug the servos up and try to use the demo code but the servo still does not want to turn or anything.. I am able to do this with one power supply correct? I'm just not sure whats going on, I've never had this much of a problem with electronics before
 
Title: Re: Arduino questions
Post by: Graynomad on December 31, 2010, 02:53:38 AM
Quote
I have a 5V regulator
Is this seperate to the Arduino PSU? It's generally accepted that servos should not be driven from the same 5v as the Arduino. They draw too much power and can be noisy.

Quote
and where the servos are the output is 4.4 Vs
That's a large drop, especially if the servos aren't running.

Quote
I am able to do this with one power supply correct?
Not necessarily, the Arduino will need at least 7v but that's too high for the servos, I think you need to power them seperately.
Title: Re: Arduino questions
Post by: futurrobotech on December 31, 2010, 01:02:57 PM
Quote
I have a 5V regulator
Is this seperate to the Arduino PSU? It's generally accepted that servos should not be driven from the same 5v as the Arduino. They draw too much power and can be noisy.

Quote
and where the servos are the output is 4.4 Vs
That's a large drop, especially if the servos aren't running.

Quote
I am able to do this with one power supply correct?
Not necessarily, the Arduino will need at least 7v but that's too high for the servos, I think you need to power them seperately.

I have built the power supply and connected it seperate from the arduino to another 9V battery and I have connected the grounds together. But the program isnt running. I'm stating to think possible there isnt enough voltage coming from the regulator
Title: Re: Arduino questions
Post by: futurrobotech on December 31, 2010, 02:10:29 PM
okay.. so I hooked up the arduino to an LED to see if it worked.. and yes it did coming from the PWN with the same code running, So this means it must be my power supply thats not sufficient.. Should I just give up and get a battery holder for AAs or Ds?
Title: Re: Arduino questions
Post by: rbtying on December 31, 2010, 05:14:07 PM
9V batteries can't provide enough current to run a servo, so, yes, you should be using AA or better.  D cells aren't necessary, four or five AA's should be good (four if alkaline, five if nimh or nicd, since they're only 1.2v/cell)
Title: Re: Arduino questions
Post by: VegaObscura on December 31, 2010, 11:23:46 PM
Four nimh works fine for my servos.  Five would naturally work better, but it can be very hard to find battery holders for 5 AAs.
Title: Re: Arduino questions
Post by: futurrobotech on January 01, 2011, 12:52:00 AM
you could get a four battery holder then a one.. and put them in series,, but im probably gonna go with four alkaline for now... lithiums a little bit out of my budget until like march.. I jacked my old RCX(lego) battery holder but I dont have a soldering iron so using it would be difficult
Title: Re: Arduino questions
Post by: Soeren on January 01, 2011, 02:47:00 AM
Hi,

[...] but I dont have a soldering iron so using it would be difficult
How do you get anything at all done then?
Title: Re: Arduino questions
Post by: Soeren on January 01, 2011, 03:10:55 AM
Hi,

Just remember, that glue will wear off your fingers in just a couple of days and you'll be able to move them again!
Back in 1977 when I bought my first tube of Cyanoacrylate glue on a Friday after work, where a friend of me had bought a load of beer and was planning for a fun night, I just had to try this new wonder glue.

I didn't have any tools available within reach, so I bit down on the end and twisted it off with my right thumb and index finger. The squeeze by holding the rest of the tube made sure my two fingers got about a third of the content and suddenly they were bonded with the tip of the tube in between somewhere.

After trying the most obvious measures (water/soap, scalpel etc.) without luck, we rushed to the paint store that sold me the glue, just before closing time, but they knew nada about how to dissolve it or what it contained (it was a fairly new product back then).
No WWW to the rescue and the chemical labs we called were either closed or knew nothing helpful.

Luckily, the local (night open) pharmacy came through and told us to swing by. They had an arsenal of solvents and other poisonous looking flasks lined up when we arrived and after several disappointing experiments, chloroform finally got me off (and they didn't charge me at all - nice folks).

Needless to say that it kinda ruined the fun for that night (I had scarred my fingertips badly with the scalpel trying to break free, so I could either hold a beer or a girl, but not both ;)) and it gave me a healthy respect for Super Glue in the process.

Later, I have found MEK to dissolve Cyanoacrylate as well, but that is a real Brain degreaser and should be avoided if possible. Don't fool around with Super Glue - it's really no fun.
Title: Re: Arduino questions
Post by: Graynomad on January 01, 2011, 03:19:39 AM
Quote
either hold a beer or a girl, but not both

Tough decision to make, but you need to think outside the box, get the girl to hold your beer.

_____
Rob


Title: Re: Arduino questions
Post by: futurrobotech on January 01, 2011, 03:40:44 AM
I'm using a breadboard.. And it really is a mess, but I'm gonna use it for now cause I've been wanting to do this since i was like 10 and im 15 now so its been a long time coming. I've had a pretty good background in electronics, I've just never had to build something and somewhat design it.. And I got the arduino for free.. So thats why I'm using the arduino.. I was originally planning to buy the roboduino
Title: Re: Arduino questions
Post by: futurrobotech on January 01, 2011, 04:34:40 PM
I have no idea with what can be wrong.. I've got 6.05Vs coming off of my AA battery pack.. The grounds of the arduino and this battery pack going to the servos connect.. I hook it up and nothing still happens.. what can I do to provide you guys something to be able figure out what the problem is a little easier thanks
Title: Re: Arduino questions
Post by: VegaObscura on January 01, 2011, 04:43:57 PM
What is the voltage on the + and gnd DIRECTLY on the pins where you're plugging in your servo?  That is to say, pull out the little black connector on the end of your servo wire, and connect your meter on the 2 non-signal pins there.

If the voltage there is good, and you tested with an LED to see if your MCU is giving a PWM signal, then there are only 2 possible explanations left.

1.Your MCU is not putting out the correct frequency.
2.Your servos are faulty.
Title: Re: Arduino questions
Post by: futurrobotech on January 01, 2011, 04:48:31 PM
The same as whats coming from the battery pack into the bus.. 6.05 Vs
Title: Re: Arduino questions
Post by: VegaObscura on January 01, 2011, 05:05:38 PM
Are you 100% sure that the code you loaded onto the arduino is the code for centering servos?

If you had an oscope or your multimeter had a function to test frequency, you could determine if your arduino is putting out the correct frequency or not.  But seeing as you don't have a soldering iron, I'm willing to bet you don't have an oscope or a multimeter with a frequency function.

Did you ever connect your servos straight to 9V, without a regulator between?  This can possibly damage servos.
Title: Re: Arduino questions
Post by: futurrobotech on January 01, 2011, 05:11:05 PM
No I always had the regulator in between them.. I could probably take it to school and measure it with an oscope monday.. The code I have now is the an example code to make it sweep... I'm just try to get motion out of the servos for now
Title: Re: Arduino questions
Post by: hopslink on January 01, 2011, 06:19:28 PM
If you are using the Sweep demo code from the Arduino IDE then the timings should be ok (unless you have the wrong board type selected under Tools > Board in the menu).

Check and recheck the connection from the arduino to the signal pin of the servo. Is it plugged to the correct arduino pin? Solderless breadboard connections can be finicky - do a continuity test from the signal pin of the plug for your servo connector back to the end of the wire you connect to the arduino. Also test there is no short between signal and either of the servo power lines.
Title: Re: Arduino questions
Post by: futurrobotech on January 02, 2011, 12:49:34 AM
is there perhaps any way to test the servos circuit??
Title: Re: Arduino questions
Post by: hopslink on January 02, 2011, 02:44:38 AM
If you have another servo then try swapping them out...

Your problem is more likely to be a connection/wiring issue than a dodgy servo. Have you performed the tests suggested above?
Title: Re: Arduino questions
Post by: futurrobotech on January 02, 2011, 04:22:14 AM
yes... Im wondering if maybe my problem is coming from where the connection is made to the servo cable... I have wires sticking in it instead of pins..
Title: Re: Arduino questions
Post by: VegaObscura on January 02, 2011, 04:25:24 AM
That sounds like a very likely cause.
Title: Re: Arduino questions
Post by: hardmouse on January 02, 2011, 10:25:56 AM
If you think everything was correctly connected, perhaps the problem is  either in your Arduino or Servo. You may test your servo by using something like this: http://cgi.ebay.ca/ESKY-EK2-0907-Servo-Auto-Test-Adjuster-for-servos-test_W0QQitemZ140376344745QQcategoryZ34056QQcmdZViewItemQQ_trksidZp5197.m7QQ_trkparmsZalgo%3DLVI%26itu%3DUCI%26otn%3D2%26po%3DLVI%26ps%3D63#ht_2821wt_923 (http://cgi.ebay.ca/ESKY-EK2-0907-Servo-Auto-Test-Adjuster-for-servos-test_W0QQitemZ140376344745QQcategoryZ34056QQcmdZViewItemQQ_trksidZp5197.m7QQ_trkparmsZalgo%3DLVI%26itu%3DUCI%26otn%3D2%26po%3DLVI%26ps%3D63#ht_2821wt_923). If you have 2nd servo, try to connect to the same ping or try multimeter or Oscope.

If you are using more than 4 servos then you need to use external 6v battery separately. In that case you might want to use this shield for convenience:
http://www.dfrobot.com/index.php?route=product/product&path=35_39&product_id=264 (http://www.dfrobot.com/index.php?route=product/product&path=35_39&product_id=264)

Didn't really go thru whole replys but hope that helps.
Title: Re: Arduino questions
Post by: blackbeard on January 02, 2011, 11:27:31 AM
i hate hacking servos and would much rather buy cheep ones and rip their guts out so i can hook them up to an l293d H bridge ic. to me it's much more effective then trying to hack the original circuit for full rotation especially since some servos rely on the pot as an shaft for the gears. 
Title: Re: Arduino questions
Post by: futurrobotech on January 02, 2011, 02:40:14 PM
Is there any circuit that I can build with a 556 timer chip to test the servos.. and I have the Futaba S3003 servos and the Pot is part of the main axel
Title: Re: Arduino questions
Post by: hopslink on January 02, 2011, 04:47:03 PM
Yes! (http://www.seattlerobotics.org/encoder/200210/servoex/ServoExcerciser.htm)

Google is your friend!, a search for "556 servo driver" or similar will net you what you want  ;)
Title: Re: Arduino questions
Post by: futurrobotech on January 02, 2011, 08:00:51 PM
If I were to hook the servo up to a frequency generator would I be able to test it that way??
Title: Re: Arduino questions
Post by: futurrobotech on January 02, 2011, 11:39:29 PM
I finally got it to work by cutting the sero wires from the connector and using alligator clips