Go to Post (Yes, I'm that much of a dork.) - Madison [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-09-2014, 14:03
panther83 panther83 is offline
Registered User
no team
 
Join Date: Feb 2014
Location: Washington, IL
Posts: 10
panther83 is an unknown quantity at this point
Exclamation Programming a 12V relay with Arduino

We are in the process of wiring up a t shirt cannon for my pre-rookie team to be mounted on our modular robot. We have a Arduino micro-controller with the robot open shield. We code to activate the relay, probably in PWM port 9, for a split second to give power to our solenoid to open and shoot the cannon. I have no idea how to code in Arduino or really at all so any help is awesome.
  #2   Spotlight this post!  
Unread 18-09-2014, 14:47
pastelpony's Avatar
pastelpony pastelpony is offline
Programmer/Electrical
AKA: Zach M
FRC #3525 (Nuts and Bolts of Fury)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Waterbury, Connecticut
Posts: 152
pastelpony will become famous soon enough
Re: Programming a 12V relay with Arduino

There is a relay library I'm sure. There should be an example in the Arduino IDE. I hope you're using an external power source.
__________________
Team 3525 Head Programmer (2014- ) - Java (Formerly LabVIEW)

Last edited by pastelpony : 18-09-2014 at 14:50.
  #3   Spotlight this post!  
Unread 18-09-2014, 18:22
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 315
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: Programming a 12V relay with Arduino

Arduino is well documented, so I'm sure there's resources for the particular syntax. You'll probably want to use a simple output rather than a PWM. Just pulse the output to get your relay to switch.

The bigger deal is driving the coil. You'll need to make sure your relay will actually switch at the Arduino output voltage. If that doesn't cut it or if the coil needs more current than the arduino output can provide, you'll need some extra circuitry (like a transistor) to handle the coil drive.
__________________

2013 Alamo Regional Woodie Flowers Finalist Award Winner
2012 Texas Robot Roundup Volunteer of the Year
Texas Robot Roundup Planning Committee, 2012-present
FRC 6357 Mentor, 2016-
FRC 2789 Mentor, 2009-2016 -- 2 Golds, 2 Silvers, 8 Regional Elimination Appearances

FRC 41 Mentor 2007-2009
FLL Mentor 2006
FRC 619 Mentor 2002
FRC 41 Student 1998-2000

Last edited by jee7s : 18-09-2014 at 18:24.
  #4   Spotlight this post!  
Unread 18-09-2014, 20:17
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Programming a 12V relay with Arduino

Quote:
Originally Posted by jee7s View Post
Arduino is well documented, so I'm sure there's resources for the particular syntax. You'll probably want to use a simple output rather than a PWM. Just pulse the output to get your relay to switch.

The bigger deal is driving the coil. You'll need to make sure your relay will actually switch at the Arduino output voltage. If that doesn't cut it or if the coil needs more current than the arduino output can provide, you'll need some extra circuitry (like a transistor) to handle the coil drive.
A perfect example of all of what jee7s mentioned is in the Sparkfun inventors kit, including an example of driving a motor and of driving a relay with code and schematics. The guide for their kit is free and is listed on the product page: http://dlnmh9ip6v2uc.cloudfront.net/...3.0-Online.pdf

Page 71 has the relay example, and you can probably reference what they do in the guide with what your kit does.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
  #5   Spotlight this post!  
Unread 18-09-2014, 21:10
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming a 12V relay with Arduino

If your budget is up for it, you can add the RobotOpen Solenoid Shield to your Arduino. It's perhaps a bit steep for controlling a single solenoid, but it's perfectly supported by the RobotOpen code library.
  #6   Spotlight this post!  
Unread 19-09-2014, 07:55
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,363
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Programming a 12V relay with Arduino

Do you have any spike relays? An arduino can drive them directly.
  #7   Spotlight this post!  
Unread 19-09-2014, 12:26
ajlapp ajlapp is offline
Registered User
AKA: Anthony Lapp
None #0118 (Team RUSH and Robonauts)
 
Join Date: Sep 2001
Rookie Year: 1996
Location: Ortonville, MI
Posts: 648
ajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond reputeajlapp has a reputation beyond repute
Re: Programming a 12V relay with Arduino

Quote:
We have a Arduino micro-controller with the robot open shield. We code to activate the relay, probably in PWM port 9, for a split second to give power to our solenoid to open and shoot the cannon.
Message me or send an email and we can help you get this running...what relays are you driving?

There are several that I know work well. A spike is also good option.

Just reach out and we'll gt this fixed.
__________________
Anthony Lapp
FIRST Engineering Mentor
Owner/Operator 221 Robotic Systems
221 Robotics Systems - Quality Hardware, Made in the USA
RobotOpen
anthony@221robotics.com
Twitter us: @221RobotSystems
Team 1 --> 94 --> 68 --> 221 --> 857 --> 27 --> 118
Design Engineer/Fabricator and 17 year vet
Team Rush (FRC27) and Robonauts (FRC118)
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:40.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi