Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=177)
-   -   Can Relay Outputs Directly Drive LEDS ? (for testing) (http://www.chiefdelphi.com/forums/showthread.php?t=65864)

de_ 15-03-2008 16:00

Can Relay Outputs Directly Drive LEDS ? (for testing)
 
All 8 relay ports are in use this year (that's a lot of Spikes & PWM cables !). We like to test our software out first on a table test board as much as possible. We would prefer to not have to dedicate 8 more spikes and pwms just to have visual confirmation of the state of the relay outputs.

If I read Kevin Watsons CPU to RC I/O mapping chart and the CPU spec also posted by KW, it appears each pin might be able to provide 25ma, enough to power a led (with an appropriate dropping resistor). We would probably limit it to 10-15ma (just enough to see reliably).

Anyone one know for certain this is doable or more importantly if its a bad idea ? I would hate to blow our test RC. (We asked Innovation First but did not hear back.)

kevin.li.rit 15-03-2008 16:15

Re: Can Relay Outputs Directly Drive LEDS ? (for testing)
 
I don't understand why you don't want to read the state of the spike with the LED already on there. I'm not sure if the signal from the relays goes to a negative voltage, if that's the case then you wouldn't want to wire a LED to the relay output.

You can always write a printf() to print out whenever a relay is forward or reverse.

if(relay1_fwd == 1)
printf("relay 1 foward");

RyanN 15-03-2008 18:31

Re: Can Relay Outputs Directly Drive LEDS ? (for testing)
 
You can also use the Digital I/O as an output, hence the O in I/O... Set it as an ouput and say digital01_out, or whatever the command is (its just like the in one but it says out) and set it equal to 1 for one, or 0 for off, just like relay ports! You can also use Relay ports, but I don't remember if there is a rule that you can only plug up Spikes to the Relay Outputs or not...

DonRotolo 15-03-2008 20:36

Re: Can Relay Outputs Directly Drive LEDS ? (for testing)
 
Quote:

Originally Posted by de_ (Post 718301)
All 8 relay ports are in use this year (that's a lot of Spikes & PWM cables !). We like to test our software out first on a table test board as much as possible. We would prefer to not have to dedicate 8 more spikes and pwms just to have visual confirmation of the state of the relay outputs.

If I read Kevin Watsons CPU to RC I/O mapping chart and the CPU spec also posted by KW, it appears each pin might be able to provide 25ma, enough to power a led (with an appropriate dropping resistor). We would probably limit it to 10-15ma (just enough to see reliably).

Anyone one know for certain this is doable or more importantly if its a bad idea ? I would hate to blow our test RC. (We asked Innovation First but did not hear back.)

For the price of an RC I would research the spec myself; however if an LED draws 15 mA and the output can source 15 mA or more, then the answer is yes.

While you are looking at those specs, also see what the output can "sink" - that is, how much current can it allow to flow when it acts as a ground (and not a power 'source'). Most circuits can sink two or more times the current that they can source. If you want to do this, connect the anode of the LED to +5v, and the cathode (through a dropping resistor, maybe 82 to 120 Ohms) to the digital (relay) output pin.

Don

[EDIT]Digital pins can only source 7 mA. I'd test them by allowing them to sink the current instead, maybe ask IFI

The Lucas 15-03-2008 21:06

Re: Can Relay Outputs Directly Drive LEDS ? (for testing)
 
Quote:

Originally Posted by Don Rotolo (Post 718414)
For the price of an RC I would research the spec myself; however if an LED draws 15 mA and the output can source 15 mA or more, then the answer is yes.

While you are looking at those specs, also see what the output can "sink" - that is, how much current can it allow to flow when it acts as a ground (and not a power 'source'). Most circuits can sink two or more times the current that they can source. If you want to do this, connect the anode of the LED to +5v, and the cathode (through a dropping resistor, maybe 82 to 120 Ohms) to the digital (relay) output pin.

Don

This IFI FAQ entry should be of interest.

One of the questions in the thread is:
Quote:

Originally Posted by IFI FAQ
Could we use the charge from a Digital I/O pin set on the RC to power a single solenoid, or do we have to go through the relay pins and a spike?


You must follow FIRST Rules. As for is it possible, you must check the current required for your solenoid, the Digital pins can only source about 7mA.


Alan Anderson 15-03-2008 22:36

Re: Can Relay Outputs Directly Drive LEDS ? (for testing)
 
Quote:

Originally Posted by de_ (Post 718301)
Anyone one know for certain this is doable or more importantly if its a bad idea ? I would hate to blow our test RC.

It's perfectly doable. On a testbed system, it might even be a good idea. The Spike input is opto-isolated, meaning it is essentially an LED. The specification calls for a 4mA control signal at at least 3V, so if you can manage to get enough light out of that, your test will be perfect.

I once put a three-terminal red/green LED on the relay output, with a resistor chosen to limit the current to about 10mA. It worked fine, and the LED matched exactly what one would see on the built-in LED of a Spike.

de_ 17-03-2008 11:34

Re: Can Relay Outputs Directly Drive LEDS ? (for testing)
 
Thanks for the insights. Makes it a little less nerve racking!

de_ 11-04-2008 15:13

Re: Can Relay Outputs Directly Drive LEDS ? (for testing)
 
Just so you know, the following was posted in IFI forum for the RC.
(Again, this was for just a table top test setup, not for the actual robot).

Yes, it is possible to drive LEDs directly from the Relay FWD / REV Outputs. Connect the anode of the LED to the FWD or REV Output. Connect the cathode of the LED to ground. The outputs can sink and source at least 8 mA. There is a 330 ohm series resistor between the VHCT logic outputs and each the FWD and REV header posts. Assuming the LEDs you are using can handle 15 mA of continuous current, direct connect them as described above.


All times are GMT -5. The time now is 20:34.

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