View Single Post
  #2   Spotlight this post!  
Unread 17-02-2014, 14:15
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,112
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: Using an Interposing Relay

I don't see any reason for your relay to be against the rules.

The only problem I see is that the way you have it drawn, it won't do what you expect. If you leave a Digital Input pin unconnected, an internal pullup resistor will bring it to +5v and it will read True. Your relay will connect +5v to it, leaving the value unchanged. If you instead connect "ground" to it when the relay is activated, the input will read False and you can tell the difference. You'll want to remember that the signal is backwards from what you might expect -- or if the sensor has a white wire with the opposite sense from the black one, you could use that instead.

However, the relay might not be necessary. What is the part number of your sensor? If it is NPN output, it doesn't actually provide 12 volts on the output pin. All it can do is pull the pin to ground, and that is perfectly compatible with the DIO on the Digital Sidecar.

On the other hand, if it's a PNP or fully-driven output, then you do need to account for the higher voltage. But instead of the active relay, you could use a simple resistor divider, with 14k in series with the connection to the DIO signal pin and 10k from the DIO pin to ground. Depending on the exact part number, you might also need a 10k resistor directly from the sensor output to ground.
Reply With Quote