12V Relay Module for RCP

Race Capture Pro hardware installation- power, wiring, physical installation, etc. See the dedicated forum for Sensor related topics

Moderators: JeffC, rdoherty, stieg, brentp

Post Reply
rob_h
Posts: 19
Joined: Thu Mar 13, 2014 4:18 am
Location: United States

12V Relay Module for RCP

Post by rob_h »

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

brentp
Site Admin
Posts: 5986
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

That's great! A perfect use for the GPIO outputs on RaceCapture/Pro.

How's that radiator fan working for you? Note, we recently released v2.8.5 which will dramatically improve stability around Lua scripting.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

torkey
Posts: 30
Joined: Tue Sep 22, 2015 3:09 am

Post by torkey »

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.

brentp
Site Admin
Posts: 5986
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi, The GPIO output will pull the output to ground when it is activated. You likely need a pull-up resistor (to 12v, or to 5v) to make sure when the GPIO output is inactive, the voltage swings away from ground voltage.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

torkey
Posts: 30
Joined: Tue Sep 22, 2015 3:09 am

Post by torkey »

It behaves the same with or without the pull up resistor. Anything else I could try?

brentp
Site Admin
Posts: 5986
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Are you verifying the voltage on the output swings between ground (when activated) and the pullup voltage (when not activated)?

If so, then there's a problem with the module you're connecting it to. I would check it's specs and ensure it's not defective.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

torkey
Posts: 30
Joined: Tue Sep 22, 2015 3:09 am

Post by torkey »

According to the description of the relay board it supports PIC ARM AVR DSP Arduino MSP430 TTL Logic. Is the RCP comparable with this type of device?

brentp
Site Admin
Posts: 5986
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

If you supply a 5v pullup, then the output signal is equivalent. The acid test is - when you activate / de-activate the output, you should be able to measure either 0v or 5v from the output.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

torkey
Posts: 30
Joined: Tue Sep 22, 2015 3:09 am

Post by torkey »

The voltage at GPIO0 is 5VDC. when i connect it to the relay coil there is no response. When I connect the relay to the 5 VDC supply on RCP the relay responds. Is the problem that the GPIO can't drive the relay. It's a really small relay. 60ma coil.
Any suggestions?

brentp
Site Admin
Posts: 5986
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

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.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply