Pages: [1] 2   Go Down
Author Topic: Sending data through xbee  (Read 1290 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure if I'm posting in the right place... :-/

I've got an arduino which controls relays which in turn control motors, two for each motor (reverse and forward). Power supply comes from a battery. I am able to control it smoothly with Processing when the arduino is hooked up to a USB Cord, however when I switch over to the xbees, the relays go haywire and start switching like mad when I send the command over for the arduino to begin.

What I'd like to know, is there a way I can send the command over without having the arduino continue turning the relays on and off?
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 731
skcor oniudrA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried increasing the size of the battery? If there isn't enough juice to supply whats being drawn then the relays can flicker.

That took me a week to figure out once with a similar problem.

But! there could be other reasons, its one to eliminate.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sorry :-[, I think I didn't explain the situation well enough.
The battery isn't the problem. The connection between the computer and arduino however is the problem. When the arduino is hooked up via the USB Cable, I am able to keep a relay on without problem. However, when I switch over to the xbees, the relays turn off and on constantly. I'm guessing it has something to do with the way wireless works, but I'd actually like to know how to prevent the relay from turning off and on when I send the command to the arduino to turn the relay on.

I hope that was more helpful. smiley-wink
Logged

Lacomb, Oregon
Offline Offline
Sr. Member
****
Karma: 0
Posts: 302
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you post your circuit? Two questions, do you have a ground between all your units and are you trying to drive the relays directly from an arduino pin?
Logged

Stephen

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I do have a ground between all my units and yes I am driving my relays from the arduino pins, but the power for the relays come from the battery.
Logged

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

"I do have a ground between all my units and yes I am driving my relays from the arduino pins, but the power for the relays come from the battery. "

Any what is the battery voltage? If it is not 5vdc like the Arduino internal regulator and if you are not using a switching transistor between the Arduino digital output and the relay coil then that might be a problem.
« Last Edit: December 13, 2008, 04:24:17 pm by retrolefty » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The battery is 12v. I'm using the Arduino only to control the coil. Also, the Arduino currently doesn't get it's power from the battery.
Logged

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

"The battery is 12v. I'm using the Arduino only to control the coil. Also, the Arduino currently doesn't get it's power from the battery. "

Ok, so a Arduino output pin is wired to one of the relay coil pins, what is the other end of the relay coil wire to? And what is the current requirements for the relay coil? This can be figured out but all the specifications and details need to be known.  smiley-wink

Lefty
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I'll try and post as much info as I can. Hope all of it's relevant.  smiley-wink

The other end of the relay coil is hooked up to ground. I have six relays paired up (so 3 pairs). Each pair is wired together in such a way that I can reverse the polarity of the 12V motor which is hooked up to one of the relays.

The relays themselves are 5VDC (I think that's for the coil); 8A, 250V~, AC1.

I hope I made sense.  :-?
Logged

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

"The relays themselves are 5VDC (I think that's for the coil); 8A, 250V~, AC1.

I hope I made sense.   "

Ok, that means a digital output HIGH is suppose to energize the relay coil as the other end is wired to ground. The micro's output pin has a maximum current avaliblity of around 30-35 milliamps. You didn't state the coil current requirements so it's most likely not printed on the package, however any 5vdc relay with contact ratings that large is bound to require much more then 30ma.

If you can give us a manufacture name and model number then we may be able to search for a data sheet to confirm it's coil current requirements.

I know you originally posted that the relay works of when powered via USB and that would tend to say the relay is ok, but first one should be certain that the basic requirements for the relay are being met and that requires we know it's coil current requirement and if more then 30-35ma then use a switching transistor to control the relay coil.

Lefty

Make sense?
« Last Edit: December 13, 2008, 09:07:45 pm by retrolefty » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's the data sheet for the relays:

http://ecb.omron.com.sg/pdf/relay/power/G2RL.pdf

Not that I can understand most of it :smiley, but it's the relay with 8 pins. smiley-grin
Logged

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

Well from the data sheet the 5vdc coil models are avalible in two versions, a high sensitivity model that requires 50ma and a general purpose version that requires 80ma. Neither of these can be driven safetly directly  from a digital output pin, rated at 30-35ma maximum, and can damage the output pin.  

Lefty
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's been fine so far, I haven't seen any problems occuring because of it. Back to my original question. Why do the relays work perfectly with a USB cord, but when I switch over to xbee wireless the relays more or less go haywire?
Logged

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

"It's been fine so far, I haven't seen any problems occuring because of it. Back to my original question. Why do the relays work perfectly with a USB cord, but when I switch over to xbee wireless the relays more or less go haywire? "

I don't own a xbee nor familiar with them. Does the xbee take additional current draw from the Arduino board?

  I suggest you deal with one problem at a time and it appears to me that you are overloading an Arduino digital output pin by trying to drive the relay coil directly and that should be addressed first. But I'll let anyone else jump in that wants to give further thoughts to your problem.

Good luck

Lefty
« Last Edit: December 14, 2008, 06:57:29 pm by retrolefty » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, thanks for your help Lefty!

I'll just continue experimenting...maybe I'll get lucky  ;D.
Logged

Pages: [1] 2   Go Up
Jump to: