Spike Relay on HERO Board

Hi guys,

I’m working on controlling a Spike relay via PWM on a HERO board. The wiring is setup right, and the libraries seem to be good. However, I am new to pulse width stuff, and would appreciate some help.

My goal: set the spike relay to what I imagine is a value of “1” or “on”, and then turn it off again (back to “0”).

My problem: How do I determine the pulse width needed for this? Where does the period between pulses come into play?

Are there any resources out there for programming a HERO to operate a Spike? I’ve seen this, but I am confused on how I can take these concepts and implement them on my own thing.


SPIKE relays are not controlled by a PWM signal.
They use the same cable, but they receive two digital input signals (FWD, REV) and ground

There may be a real manual for the part, but I found this via Google that seems to describe the input interface and modes of operation completely.


[Edit] real manual linked from page above: https://web.archive.org/web/20030419143006/http://www.innovationfirst.com/FirstRobotics/pdfs/SpikeBLUEUsersManual.pdf

Basically just two relays. You can control the polarity of each output pin on the spike (high or low) with the state of the two input pins (the signal inputs, not power inputs).

I don’t really know anything about the Hero boards, but if you can set the state of two digital output channels, should be pretty straight fwd


Thanks! I’ll look into all of that tonight!

1 Like

Was able to test it yesterday. Using one OutputPort object, I was able to switch the relay on and off. Thank you so much for the help @otherguy!

1 Like

Awesome, glad it worked out and thanks for following up with a solution for anyone else finding this thread in the future. :+1: