PDA

View Full Version : Relay Question



tbh726
03-18-2009, 07:00 PM
I have a need to be able to control 4 or 5 relays from a Eee PC, USB ports only. The load will be from 2 different sources 6 and 12 (7amps) volt Gel Batteries. They will be powering 12 volt 2 amp motors and turning on and off other lower power options. The 6 volt would be used to entergize the relays. I need to control them from a C# program. I know phidgets has a 4 and a 8 relay board that would work, but trying to figure out if there are better and cheaper options. I was also wondering if i can use a usb to serial cable to control some of the serial relay options out there.

I thought i read that someone use a servo controller to control a relay is that possible if so how. my project also has a Polou 8 servo contoller, i am controlling it from a USB 2 Serial cable now, so is this an option?

thanks for any help

tim

jes1510
03-18-2009, 08:48 PM
Unless you need additional inputs or outputs then the relay cards are probably your best bet. If you do need some inputs then an Arduino or similar microcontroller would work great.

Alex
03-19-2009, 08:33 AM
I thought i read that someone use a servo controller to control a relay is that possible if so how. my project also has a Polou 8 servo contoller, i am controlling it from a USB 2 Serial cable now, so is this an option?


Any of these can be controlled from a servo controller:

http://www.trossenrobotics.com/store/p/5194-PicoSwitch-Radio-Controlled-Relay.aspx
http://www.trossenrobotics.com/store/p/5467-BattleSwitch-radio-controlled-10A-relay.aspx
http://www.trossenrobotics.com/store/p/3207-Electronic-R-C-PWM-Switch-RC-100X-.aspx

jes1510
03-19-2009, 08:49 AM
I never new such a beast existed. You learn something every day!

tbh726
03-19-2009, 07:08 PM
So then for the ones I would be able to control via a servo controller I would just send a "Position" move and that turns it on? If does that me if I send a second "Position" it would turn it off? I am interested in knowing what i can do, but for my project i need 4 to 8 relays to be usable. if i am pulling 12 volts per motor, i think they are 1 or 2 amps and the supply will be a 12 volt 7 amp gel battery does it matter which phidgets relay I use?

darkback2
03-19-2009, 11:17 PM
I believe the positions are based on a joystick, so center position or 1500...with phidgets I believe its set motor position 113 or so...would turn it off, and going to one extreme or the other turns it on...thats atleast how the ones that I have work.

Hope this helps.

DB

Adrenalynn
03-20-2009, 12:36 AM
>> and the supply will be a 12 volt 7 amp gel battery

You might already know this, but just to make sure...

That's not a "7 amp" battery. It's a 7 A/h or 7 Amp/Hour battery. That means that, in theory, you could draw 1A for 7hrs before it was _completely dead_. In practice, it's much less. However: you can pull well over 300A from it in a direct short. My stalled drill motors will routinely pull 120A for a short period of time from it.

Yes - R/C relays are "all or nothing" affairs. Usually a signal equating to 45deg + will trip them on, 0 or 45 deg - turning them off. The big question is: What are your motors when they're *stalled*. You didn't mention what specific motors they are, I don't believe.

mannyr7
03-20-2009, 01:23 AM
Let's say, um,... one or two RC tank airsoft gun motors at 4.8 to 6V NiMH, for example....
Could such a circuit be used on one channel to switch two devices on? -45deg=motor1 on, 0=off, +45deg=motor2 on??

Adrenalynn
03-20-2009, 03:01 AM
Nope! The relay only knows how to do one thing. The switch is on or the switch is off. No "trinary computing" allowed here. ;) A large enough relay could drive both motors simultaneously though. Just not selectively.

Two R/C-type relays could be wired to two separate servo channels on your servo controller and do something like that though...

As a postscript: You don't want to run those guns at 6v. They'll shoot like ick. Run 'em at 9v at least.

gdubb2
03-20-2009, 01:21 PM
tbh726.. this one would do 2 motors at once.. they have larger ones too.

mannyr7.. here's one that should do what you were suggesting..

http://www.robotmarketplace.com/products/0-TD-RCE220.html

look over the data sheet on the web site..

mannyr7
03-20-2009, 07:17 PM
Gdubb2, Thanks for the link! That's a cool unit. Think I'm gonna go with the pico switch after all or try to make something similar. Still learning about electronics. Progressing, but still long way to go. And thank you too Adrenalynn! I fried my walmart $18.99 special on 9V but the little tank motors take it quite nicely. I was too afraid to try. Oh well, the walmart unit was too heavy and clunky even chopped down to bare minimum.

gdubb2
03-20-2009, 08:05 PM
Manny.. I run my tank guns at 9 volts. I just have them fireing opposite each other, so that there are 2 shots in 1 time frame. I use 1 relay for both guns and it works fine.

mannyr7
03-21-2009, 03:57 PM
So you are running them parallel off a single 9v, with the gears 180deg out of sync? What barrels are you using and how did you attach them to the guns? I have the Mato Toys guns not the TOYEAST ones. (mine didn't come with barrels)

gdubb2
03-21-2009, 04:18 PM
Hey Manny,
We have the same guns. Yes, I'm running mine in parallel from 1 9V battery. 180 out of sync.
I made my barrels and mounts, see link below. Mato also has replacement barrels. See other link.

https://matomart.com/prodview.php?p=472
http://forums.trossenrobotics.com/gallery/files/2/0/3/3/barrels1.jpg

Good luck
Gary

mannyr7
03-21-2009, 05:12 PM
Cool, did you fabricate, find, or buy the replacement barrels and strip off the plastic covering? I like the mounts! Do the barrels insert partially into the breach? I was worried about alignment issues, but I suppose a little taper on the inner diameter would help. Also, can you provide any higher res of the pic???

gdubb2
03-21-2009, 06:02 PM
That picture is about the best I can do, but here is some more info. I made the barrels from 0.50" aluminum round bar. The end where the flange is has an OD of 0.331". The flange is 0.050" OD. The rest of the barrell is 0.307" OD, but could be any diameter you liked. The end where the flange is 0.474" from the end of the barrell to the face of the flange. The bore is 0.238" ID, and I bored it with a size "C" drill bit. This part is kind of tricky since you have to drill from each end and meet in the middle.

The flanged end is a snug fit inside the breach and are held in place by the brackets. There are small holes on the side of the breach for some small screws, but I cut mine off so that they wouldn't hit anything inside. I also put a very small taper where the BB meets the barrel.

At the time, I didn't see the barrels on the Mato site, or I would have bought them instead. It took all day to make 4 barrels, and since the bore was done with a drill bit, it's a little rough.

Good Luck
Gary

mannyr7
03-21-2009, 06:12 PM
I picked up a relay board kit last night to switch my airsoft guns on from my ssc32.
http://picasaweb.google.com/lh/photo/HA6LkHd4HdpHOqIboI9VkQ?authkey=Gv1sRgCN7I0NT2_43dM A&feat=directlinkhttp://picasaweb.google.com/lh/photo/HA6LkHd4HdpHOqIboI9VkQ?authkey=Gv1sRgCN7I0NT2_43dM A&feat=directlink
Question one: Are resistors polarized, or do they work in either direction?
Question two: I have this gizmo assembled. Now where exactly and how would I interface it to my ssc and the load (9v and gun motors)??:confused:
I could just pick up a http://www.trossenrobotics.com/store/p/5194-PicoSwitch-Radio-Controlled-Relay.aspx
, but I would really like to learn something along the way!
BTW, ssc is running separate VL @ 9v and VS @ 6v.

gdubb2
03-21-2009, 06:35 PM
I don't know about the ssc32, never used one. But on the gun end of things, I would use a separate battery for the guns, connect the negative lead to the black gun wire. Then connect the positive from the battery to the C or common terminal of the relay. The NO (normally open) would then go to the red gun lead. However it's conceivable that you may have to use the NC relay connections if I'm lying..

Resistors are not directional.. any way is fine..

I'm a little paranoid about running external motors from the controller power. I just prefer to have a separate power source so that the controller doesn't go up in smoke if the guns do.

Gary

gdubb2
03-21-2009, 06:36 PM
I couldn't read that data sheet.. it was to fuzzy.

mannyr7
03-21-2009, 08:02 PM
Resistors are not directional.. any way is fine..That's good, cuz it's already soldered together.:o
I am planning to run them off a separate 9v supply.

I couldn't read that data sheet.. it was to fuzzy. There's actually a little magnifying glass icon to zoom in, upper right corner of pic.
Thanks for the connection explanation. I'll try it out!!!:happy:

Adrenalynn
03-21-2009, 09:11 PM
Yuppers! That's how you'd connect it. Then the servo wire would go to the SSC32. If you had it on channel 0 of the SSC32, you'd send a command like:

#0 P1600<cr> (or whatever the required pulse width is) to start it, and then whatever the "stop" pulse width is to shut it off. I didn't read what pulse width it took to turn it on.

Have a look at my C# tutorial here on the forums for talking to the SSC32.

gdubb2
03-21-2009, 09:57 PM
It look as though this relay board doesn't use a servo output for operation. Instead it uses an voltage high or low for operation. There needs to be 12 VDC to operate the relays, and a logic high or low to make it do it's stuff. I find this kind of different.

If you can output a +5 or so from the SSC32 to the "hi" input, it should work.

I don't know too much about the SSC, but I would think an output could be configured an a digital out.

gary

tbh726
03-23-2009, 10:53 PM
boy the more i learn the more i see i have a lot to still learn... good info.. so then would you agree that these motors can be operated by the phidgets 8 way relay board.

http://banebots.com/pc/MOTOR-BRUSH/M2-RS550-120

their specs are:

Motor SpecificationsPerformanceOperating v: 6v - 14.4vNominal v: 12vNo Load RPM: 19300No Load A: 1.2AStall Torque: 70.55 oz-in498.2 mN-mStall Current: 85AKt: 0.83 oz-in/A5.9 mN-m/AKv: 1608 rpm/VEfficiency: 70%RPM - Peak Eff: 17250Current - Peak Eff: 10APhysicalWeight: 7.7 oz(218g)Length - for motor: 2.24 in(57mm)Diameter (with flux ring): 1.52 in(38.5mm)Diameter (no flux ring): 1.41 in(35.8mm)ShaftDiameter: 0.12 in(3.2mm)Shaft Length: 0.3 in(7.6mm)Mounting Screws (2)M3
think the motors in a power wheels car and the battery (12vdc 7amp/hour) it has to power them. I need to turn them on for forward and then turn them on for reverse. will they work for this? will they burn up if i wire the motors together and use the relays to switch everything? Any advice is good advice...

tbh726
03-23-2009, 10:55 PM
Oh and please keep in mind, i need to control whatever using C#.

Adrenalynn
03-23-2009, 11:31 PM
I suspect that won't be pretty if you stall the motor. Wanna be careful not to do that. ;)

tbh726
03-24-2009, 08:34 AM
Ok now I will show my noob-ness in this area... what is stalling the motor? Is that where it just is not turning, but juice is going to it?

jes1510
03-24-2009, 08:56 AM
Ok now I will show my noob-ness in this area... what is stalling the motor? Is that where it just is not turning, but juice is going to it?

Yeah that's pretty close. If the motor shaft stops turning then the only resistance the current sees is the internal resistance of the coils so the current goes up very fast. If the motor controller isn't spec'd for it then the controller will go up in flames. Always make sure that if your motor can stall that the controller can handle the current.

tbh726
03-24-2009, 09:48 AM
Can you put a fuse between the relay and the motor to prevent blowing the board if the motor stalls?

Adrenalynn
03-24-2009, 12:02 PM
Not really. Every motor stalls briefly every time it starts.

The right way is to source the right size relay or motor controller, or source the right size motor.

No shortcuts.

tbh726
03-24-2009, 12:44 PM
From what is see on most boards is that an 85 amp relay does not exist, so it is back to the drawing board, would you agree?

Adrenalynn
03-24-2009, 01:14 PM
If you're set on that motor. I guess the project parameters dictate and we haven't heard those. If you've calculated the requirements and are stuck with that motor, you'll probably be needing to go with speed controllers instead.

tbh726
03-24-2009, 02:06 PM
Ok i will bite... what is a speed controller and can i control it from C# code. As far as the motor is concern, i can switch to a different 12 volt motor, but it would be in my guess something more powerful like a windshield wiper or electric window motor. I would also then be switching to a direct drive system with chain and gears over the gear system i have today... another option would be to have a servo pull a switch back and forth and by pass the relay concept.

gdubb2
03-25-2009, 10:56 AM
tbh726.. look here... Speed controllers and a tutorial.

http://www.trossenrobotics.com/store/c/2666-DC-Motor-Controllers.aspx

Gary