Just thought I would share this... I found a relay module that uses a 5V signal to drive a 10A 25V relay. I use this with the GPIO to drive the radiator fan based on temperature. Still working on the scripting but there are ton of things you can do with it.
I've confirmed it works great with the GPIO, the ground, and the 5V lines from the RCP and using 12V on the high amp/voltage side of the relay.
http://www.amazon.com/JBtek-Channel-Mod ... s=5V+relay
12V Relay Module for RCP
Moderators: JeffC, rdoherty, stieg, brentp
I am using the board linked to above and have a question. I am using this for a shift light. I have the script running to set GPIO(0,1) when the shift threshold is exceeded. I have tested the script with a multimeter attached and GPIO does change when the RPM threshold is exceeded. My issue is that when I connect GPIO(0,0) to the relay board, the relay immediately energizes and with GPIO(0,1) there is no change in the relay state.
The indicator light on the relay board on the channel is lit for GPIO(0,0) and is lit brighter with GPIO(0,1)
Any suggestions on how to fix this? Not really an electronics person and I am hoping this is something simple.
The indicator light on the relay board on the channel is lit for GPIO(0,0) and is lit brighter with GPIO(0,1)
Any suggestions on how to fix this? Not really an electronics person and I am hoping this is something simple.
The GPIO's are configured as open drains. Meaning, it's like a mechanical switch that closes a connection to ground.
When activated, The GPIO can sink up to 1A of current to ground. When inactive, it's an open circuit, like an open switch. Using a pull up resistor to 5v you'll get a 5v supply at the current the pullup resistor allows. Ohm's law says current is I = V/R http://www.dccwiki.com/Ohm's_Law
so, 5V / 1K ohm pullup = 5mA
Temporarily ignoring the relay module, you can wire up the pullup resistor and put a volt meter on the output, then you can inspect the voltage as you activate / deactivate the output.
In the Lua script, you can control the output as such: setGpio( <port>, <active> )
Note, you should ensure the GPIO configuration in the RCP config page sets the GPIO mode to 'output'. With the 5v pull-up wired, you shoud observe:
setGpio(0, 1)
-- you should measure 0v
setGpio(0, 0)
-- you should measure 5v
Sounds like this would be a good blog post / wiki how to!
Let us know what you find out from your experimentation / measurement.
When activated, The GPIO can sink up to 1A of current to ground. When inactive, it's an open circuit, like an open switch. Using a pull up resistor to 5v you'll get a 5v supply at the current the pullup resistor allows. Ohm's law says current is I = V/R http://www.dccwiki.com/Ohm's_Law
so, 5V / 1K ohm pullup = 5mA
Temporarily ignoring the relay module, you can wire up the pullup resistor and put a volt meter on the output, then you can inspect the voltage as you activate / deactivate the output.
In the Lua script, you can control the output as such: setGpio( <port>, <active> )
Note, you should ensure the GPIO configuration in the RCP config page sets the GPIO mode to 'output'. With the 5v pull-up wired, you shoud observe:
setGpio(0, 1)
-- you should measure 0v
setGpio(0, 0)
-- you should measure 5v
Sounds like this would be a good blog post / wiki how to!
Let us know what you find out from your experimentation / measurement.